Implementations of GCD, sparsity test, histogram binning and baseline rescaling. More...

Go to the source code of this file.
Macros | |
| #define | _USE_MATH_DEFINES |
Implementations of GCD, sparsity test, histogram binning and baseline rescaling.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Implements the static helpers declared in numerics.h. The GCD uses the standard Euclidean recursion and runs in O(log min(a,b)); the sparsity heuristic counts non-zeros against a fixed density threshold so callers can decide whether to promote a dense vector to an Eigen sparse matrix; the histogram binner divides [min,max] into equal-width bins and increments counts in a single pass.
Numerics::rescale dispatches on the baseline-mode string ("logratio", "ratio", "zscore", "mean", "percent") and applies the transform in place across the (m x n_time) data matrix using the per-row mean (and, for zscore, standard deviation) computed over the baseline window resolved against times.
Definition in file numerics.cpp.
| #define _USE_MATH_DEFINES |
Definition at line 31 of file numerics.cpp.