Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
stfnum.h File Reference

Math functions. More...

#include <vector>
#include <complex>
#include <deque>
#include <boost/function.hpp>
#include <fftw3.h>
#include "../libstfio/stfio.h"
#include "./spline.h"
Include dependency graph for stfnum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  stfnum::parInfo
 Information about parameters used in storedFunc. More...
class  stfnum::Table
 A table used for printing information. More...
struct  stfnum::storedFunc
 Function used for least-squares fitting. More...

Namespaces

namespace  stfnum

Macros

#define StfnumDll   __declspec( dllimport )
 Defines dll export or import functions for libstfnum on Windows.

Typedefs

typedef boost::function< double(double, const Vector_double &)> stfnum::Func
 A function taking a double and a vector and returning a double.
typedef boost::function< Vector_double(double, const Vector_double &)> stfnum::Jac
 The jacobian of a stfnum::Func.
typedef boost::function< double(double, double, double, double, double)> stfnum::Scale
 Scaling function for fit parameters.
typedef boost::function< Table(const Vector_double &, const std::vector< stfnum::parInfo >, double)> stfnum::Output
 Print the output of a fit into a stfnum::Table.
typedef boost::function< void(const Vector_double &, double, double, double, double, double, Vector_double &)> stfnum::Init
 Initialising function for the parameters in stfnum::Func to start a fit.
typedef std::vector< stfnum::storedFunc >::const_iterator c_stfunc_it

Enumerations

enum  stfnum::direction { stfnum::up , stfnum::down , stfnum::both , stfnum::undefined_direction }
 The direction of peak calculations. More...
enum  stfnum::baseline_method { stfnum::mean_sd = 0 , stfnum::median_iqr = 1 }
 Methods for Baseline computation. More...

Functions

Vector_double stfnum::nojac (double x, const Vector_double &p)
 Dummy function, serves as a placeholder to initialize functions without a Jacobian.
double stfnum::noscale (double param, double xscale, double xoff, double yscale, double yoff)
 Dummy function, serves as a placeholder to initialize parameters without a scaling function.
Table stfnum::defaultOutput (const Vector_double &pars, const std::vector< parInfo > &parsInfo, double chisqr)
 Default fit output function, constructing a stfnum::Table from the parameters, their description and chisqr.
template<typename T>
stfnum::SQR (T a)
 Calculates the square of a number.
StfnumDll Vector_double stfnum::filter (const Vector_double &toFilter, std::size_t filter_start, std::size_t filter_end, const Vector_double &a, int SR, stfnum::Func func, bool inverse=false)
 Convolves a data set with a filter function.
std::map< double, int > stfnum::histogram (const Vector_double &data, int nbins=-1)
 Computes a histogram.
StfnumDll Vector_double stfnum::deconvolve (const Vector_double &data, const Vector_double &templ, int SR, double hipass, double lopass, stfio::ProgressInfo &progDlg)
 Deconvolves a template from a signal.
template<class T>
std::vector< T > stfnum::cubicSpline (const std::vector< T > &y, T oldF, T newF)
 Interpolates a dataset using cubic splines.
template<class T>
std::vector< T > stfnum::diff (const std::vector< T > &input, T x_scale)
 Differentiate data.
StfnumDll double stfnum::integrate_simpson (const Vector_double &input, std::size_t a, std::size_t b, double x_scale)
 Integration using Simpson's rule.
StfnumDll double stfnum::integrate_trapezium (const Vector_double &input, std::size_t a, std::size_t b, double x_scale)
 Integration using the trapezium rule.
int stfnum::linsolv (int m, int n, int nrhs, Vector_double &A, Vector_double &B)
 Solves a linear equation system using LAPACK.
StfnumDll Vector_double stfnum::quad (const Vector_double &data, std::size_t begin, std::size_t end)
 Solve quadratic equations for 3 adjacent sampling points.
StfnumDll Vector_double stfnum::detectionCriterion (const Vector_double &data, const Vector_double &templ, stfio::ProgressInfo &progDlg)
 Computes the event detection criterion according to Clements & Bekkers (1997).
StfnumDll std::vector< int > stfnum::peakIndices (const Vector_double &data, double threshold, int minDistance)
 Searches for positive-going peaks.
StfnumDll Vector_double stfnum::linCorr (const Vector_double &va1, const Vector_double &va2, stfio::ProgressInfo &progDlg)
 Computes the linear correlation between two arrays.
StfnumDll double stfnum::fgaussColqu (double x, const Vector_double &p)
 Computes a Gaussian that can be used as a filter kernel.
double stfnum::fboltz (double x, const Vector_double &p)
 Computes a Boltzmann function.
double stfnum::fbessel (double x, int n)
 Computes a Bessel polynomial.
StfnumDll double stfnum::fbessel4 (double x, const Vector_double &p)
 Computes a 4th-order Bessel polynomial that can be used as a filter kernel.
int stfnum::fac (int arg)
 Computes the faculty of an integer.
int stfnum::pow2 (int arg)
 Computes \( 2^{arg} \). Uses the bitwise-shift operator (<<).
template<typename T>
void SWAP (T s1, T s2)
 Swaps s1 and s2.

Detailed Description

Math functions.

Author
Christoph Schmidt-Hieber
Date
2008-01-16

Definition in file stfnum.h.

Macro Definition Documentation

◆ StfnumDll

Typedef Documentation

◆ c_stfunc_it

typedef std::vector<stfnum::storedFunc>::const_iterator c_stfunc_it

constant stfnum::storedFunc iterator

Definition at line 547 of file stfnum.h.

Function Documentation

◆ SWAP()

template<typename T>
void SWAP ( T s1,
T s2 )

Swaps s1 and s2.

Parameters
s1will be swapped with
s2

Definition at line 556 of file stfnum.h.