v2.0.0
Loading...
Searching...
No Matches
numerics.cpp File Reference

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

#include <cmath>
#include <iostream>
#include "numerics.h"
#include <QDebug>
#include <QStringList>
Include dependency graph for numerics.cpp:

Go to the source code of this file.

Macros

#define _USE_MATH_DEFINES

Detailed Description

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

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

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.

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 31 of file numerics.cpp.