Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
funclib.h
Go to the documentation of this file.
1// This program is free software; you can redistribute it and/or
2// modify it under the terms of the GNU General Public License
3// as published by the Free Software Foundation; either version 2
4// of the License, or (at your option) any later version.
5
6// This program is distributed in the hope that it will be useful,
7// but WITHOUT ANY WARRANTY; without even the implied warranty of
8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// GNU General Public License for more details.
10
11// You should have received a copy of the GNU General Public License
12// along with this program; if not, write to the Free Software
13// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
20
21#ifndef _FUNCLIB_H
22#define _FUNCLIB_H
23
24// common definitions needed here:
25#include "./stfnum.h"
26
27namespace stfnum {
28
32
34
44 StfnumDll double fexp(double x, const Vector_double& p);
45
47
65
67
76 void fexp_init(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
77
79
89 void fexp_init2(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
90
92
107 StfnumDll double fexpde(double x, const Vector_double& p);
108
109#if 0
111
145 Vector_double fexpde_jac(double x, const Vector_double& p);
146#endif
147
149
156 void fexpde_init(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
157
158
160
176 StfnumDll double fexpbde(double x, const Vector_double& p);
177
179
197 double fexptde(double x, const Vector_double& p);
198
199#if 0
201
235 Vector_double fexpbde_jac(double x, const Vector_double& p);
236#endif
237
239
246 void fexpbde_init(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
247
249
256 void fexptde_init(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
257
259
267 StfnumDll double falpha(double x, const Vector_double& p);
268
270
287
289
298 StfnumDll double fHH(double x, const Vector_double& p);
299
301
314 double fgauss(double x, const Vector_double& p);
315
318
320
329 StfnumDll double fgnabiexp(double x, const Vector_double& p);
330
332
358
360
367 void falpha_init(const Vector_double& data, double base, double peak, double RTLoHI, double HalfWidth, double dt, Vector_double& pInit );
368
370
377 void fgauss_init(const Vector_double& data, double base, double peak, double RTLoHI, double HalfWidth, double dt, Vector_double& pInit );
378
380
387 void fHH_init(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
388
390
397 void fgnabiexp_init(const Vector_double& data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double& pInit );
398
400
407 double xscale(double param, double xscale, double xoff, double yscale, double yoff);
408
410
417 double xunscale(double param, double xscale, double xoff, double yscale, double yoff);
418
420
426 double yscale(double param, double xscale, double xoff, double yscale, double yoff);
427
429
435 double yscaleoffset(double param, double xscale, double xoff, double yscale, double yoff);
436
438
445 double yunscale(double param, double xscale, double xoff, double yscale, double yoff);
446
448
455 double yunscaleoffset(double param, double xscale, double xoff, double yscale, double yoff);
456
458
461 std::vector<stfnum::parInfo> getParInfoExp(int n_exp);
462
464
469 stfnum::Table outputWTau(const Vector_double& p, const std::vector<stfnum::parInfo>& parsInfo, double chisqr);
470
472
476 std::size_t whereis(const Vector_double& data, double value);
477
479
482 std::vector<stfnum::storedFunc> GetFuncLib();
483
485
486}
487
488#endif
A table used for printing information.
Definition stfnum.h:152
std::vector< double > Vector_double
Definition core.h:55
StfnumDll double falpha(double x, const Vector_double &p)
Alpha function.
StfnumDll double fexpbde(double x, const Vector_double &p)
Biexponential function with delay.
void fgnabiexp_init(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::falpha() to data.
double yunscale(double param, double xscale, double xoff, double yscale, double yoff)
Unscales a parameter that linearly depends on y.
void fexptde_init(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::fexpde() to data.
StfnumDll double fexp(double x, const Vector_double &p)
Sum of n exponential functions.
Vector_double fgnabiexp_jac(double x, const Vector_double &p)
Computes the Jacobian of stfnum::fgnabiexp().
void fexp_init2(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Yet another initialiser for fitting stfnum::fexp() to data.
void fHH_init(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::falpha() to data.
StfnumDll double fexpde(double x, const Vector_double &p)
Monoexponential function with delay.
double fexptde(double x, const Vector_double &p)
Triexponential function with delay.
StfnumDll double fgauss(double x, const Vector_double &p)
Computes the sum of an arbitrary number of Gaussians.
void fexpde_init(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::fexpde() to data.
void falpha_init(const Vector_double &data, double base, double peak, double RTLoHI, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::falpha() to data.
Vector_double fgauss_jac(double x, const Vector_double &p)
Computes the Jacobian of a sum of Gaussians.
StfnumDll double fHH(double x, const Vector_double &p)
Hodgkin-Huxley sodium conductance function.
StfnumDll std::vector< stfnum::storedFunc > GetFuncLib()
Returns the library of functions for non-linear regression.
double xunscale(double param, double xscale, double xoff, double yscale, double yoff)
Unscales a parameter that linearly depends on x.
std::vector< stfnum::parInfo > getParInfoExp(int n_exp)
Creates stfnum::parInfo structs for n-exponential functions.
double yscaleoffset(double param, double xscale, double xoff, double yscale, double yoff)
Scales a parameter that linearly depends on y and adds an offset.
void fexpbde_init(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::fexpde() to data.
void fexp_init(const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::fexp() to data.
double yunscaleoffset(double param, double xscale, double xoff, double yscale, double yoff)
Unscales a parameter that linearly depends on y and removes the offset.
StfnumDll double base(enum stfnum::baseline_method method, double &var, const std::vector< double > &data, std::size_t llb, std::size_t ulb)
Calculate the average of all sampling points between and including llb and ulb.
Vector_double falpha_jac(double x, const Vector_double &p)
Computes the Jacobian of stfnum::falpha().
std::size_t whereis(const Vector_double &data, double value)
Finds the index of data where value is encountered for the first time.
double xscale(double param, double xscale, double xoff, double yscale, double yoff)
Scales a parameter that linearly depends on x.
StfnumDll double peak(const std::vector< double > &data, double base, std::size_t llp, std::size_t ulp, int pM, stfnum::direction, double &maxT)
Find the peak value of data between llp and ulp.
Vector_double fexp_jac(double x, const Vector_double &p)
Computes the Jacobian of stfnum::fexp().
void fgauss_init(const Vector_double &data, double base, double peak, double RTLoHI, double HalfWidth, double dt, Vector_double &pInit)
Initialises parameters for fitting stfnum::fgauss() to data.
StfnumDll double fgnabiexp(double x, const Vector_double &p)
power of 1 sodium conductance function.
stfnum::Table outputWTau(const Vector_double &p, const std::vector< stfnum::parInfo > &parsInfo, double chisqr)
Calculates a weighted time constant.
double yscale(double param, double xscale, double xoff, double yscale, double yoff)
Scales a parameter that linearly depends on y.
Definition fit.h:32
Math functions.
#define StfnumDll
Defines dll export or import functions for libstfnum on Windows.
Definition stfnum.h:38