Allink
v0.1
|
Implementation of useful algorythms. More...
#include <Matematica.h>
Public Types | |
typedef double(Matematica::* | FUNC) (double x) |
A tipical f(x) function. | |
typedef void(Matematica::* | ELAB) (double *st, double *sw, int NMass) |
Public Member Functions | |
Matematica () | |
Constructor. | |
int | PermuteRandomAll (int *Sequence, int NMass) |
Permutes a sequence without repeating. | |
int | PermuteRandomAll (PERMUTE *Sequence, int NMass) |
Permutes a sequence without repeating. | |
int | ApplyFilter (Matrice *Point, Matrice *Res, Matrice *Mask) |
Applies the filter. More... | |
int | ApplyFilter (Matrice *Res, Matrice *Mask) |
Applies the filter. More... | |
int | Transform (int *Out, int *In, int NEdge, int operation) |
Boh. | |
void | BackFold (Matrice *In, Matrice *Out, int NShift) |
Shift all the rows upwards/downwards. | |
void | Smooth (double *st, double *sw, int NIn, int NOut) |
Smooth the line with BSplines. | |
double | Evalx (double x) |
Pointer to a generic function. | |
double | ContactAngle (double x) |
Definition of the contact angle. | |
double | fProva (double x) |
Trial function. | |
double | F (double TD, double T) |
Boh. | |
double | Df (double x, double Delta) |
Boh. | |
void | ElabSt (double *st, double *sw, int NMass) |
Pointer to a function which operates on. More... | |
void | Derivata (double *st, double *sw, int NMass) |
Derivate of. More... | |
void | DerO4 (double *st, double *sw, int NMass) |
Derivate O(4) of. More... | |
double | Integrazione (double *Punti, double *sw, int NMass) |
Integral of. More... | |
void | IntegraA3 () |
Perform a integration of a LJ6 Potential. | |
void | SquareGradient (double *st, double *sw, int NMass) |
Square of the gradient. | |
double | Integrazione (double a, double b) |
Integrates the function within. More... | |
double | IntegrazioneGauss (double a, double b, double Scarto) |
Itegrate a Gaussian. | |
int | Zeri (double a, double b, double *Radici, int NRadici) |
Find the. More... | |
RADICE | RegulaFalsi (double a, double b) |
Use regula falsi algorithm to find the roots. | |
RADICE | Newton (double a) |
Use Newton to find the roots. | |
double | Estremo (double a, double b) |
Other algorithm to find the roots. | |
double | Fattoriale (int n) |
Compute the factorial. | |
double | Gamma (int n) |
Euler's gamma. | |
double | Elevato (double x, int Volte) |
Integer power. | |
double | Bessel (double Val, int Ord) |
Bessel function. | |
double | Neumann (double Val, int Ord) |
Neumann function. | |
double | Segno (int n) |
Sign of -^n. | |
double | QuasiBessel (double Val, int Ord) |
A faster Bessel. | |
double | QuasiNeumann (double Val, int Ord) |
A faster Neumann. | |
double | WeightFunction (double x, double a) |
Definition of a weighting function. | |
double | WeightFunction2 (double x, double a) |
Definition of a weighting function. | |
double | LJHamaker (double r, double r_np, double theta) |
Integration of the LJ 6 term. | |
double | LJHamakerCum (double Rad, double RadNpMin, double RadNpMax) |
Integrate over r_np up to RadNp. | |
double | LJHamaker (double Rad, double r_np) |
Integrate over theta. | |
double | LJ39 (double r, double r_np) |
Integration of the LJ 6 term. | |
void | ExecCommand (double *st, double *st1, int NMass, char *cmd) |
Execute a command defined in string. | |
double | ExecFormula (double x, double y, char *cmd) |
Execute a formula. | |
double | ExecFormula (double **st, int n, char *cmd) |
Execute a formula. | |
double | Gauss (double Media, double Scarto, double x) |
Gaussian. | |
bool | InizializzaGaussiano (double Scarto, int N) |
Initialize the Gaussian number generator. | |
double | Gaussiano (double Media, double Scarto) |
Gaussian random number. More... | |
void | Spettro (double *st, double *sw, int NMass) |
Compute the spectrum. | |
void | Spettro2d (double *st, double *sw, int NMass) |
Compute the 2d spectrum of. More... | |
void | Spettro2d (double *st, double **sw, int NMass) |
Compute the 2d spectrum of. More... | |
void | SpettroDFT (double *st, double *sw, int NMass) |
DFT implementation of the spectrum, slow. | |
void | Radice (double *st, double *sw, int N) |
Compute the root of the signal. | |
void | Autocor (bool *st, double *sAuto, int N) |
Compute the autocorrelation of a boolean signal. | |
void | Autocor (double *st, double *sAuto, int NMass) |
Compute the autocorrelation of the signal. | |
double | Norm (double *st, int NMass) |
Norm of an array. | |
int | NormalizeArea (double *st, int NMass) |
Normalize. | |
void | NormalizeVect (double *st, int NMass) |
Normalize. | |
int | Normalizza (double *st, int NMass) |
Normalize. | |
int | Normalizza (double *st, double *sw, int NMass) |
Normalize. | |
void | Modulo (double *st, double *sw, int NMass) |
Compute the modulus. | |
void | MediaMobile (double *st, int NMass, double *sw, int Parti) |
Running average. | |
int | MediaMobile (double *st, int NMass, double *sw, double *sErr, int Parti) |
Running average. | |
int | CorrelaDuePunti (double *st, int NMass, double *sw, int Punti) |
Two points correlation. | |
void | Autosimilarita (double *st, int NMass, double *sw, int Valori) |
Self similarity. | |
MOMENTI | Distribuzione (const double *st, int NMass) |
Moments of a signal. | |
MOMENTI | Distribuzione (const double *st, int NMass, double *Intervalli, int Valori, int IfNorm) |
Moments and histogram of a signal. | |
MOMENTI | Distribuzione (const double *st, int NMass, double *Intervalli, int Valori, double *Confine, int IfNorm) |
Moments and histogram of a signal between two values. | |
MOMENTI | DistrErr (const double *st, int NMass, double *Intervalli, double *Err, int Valori, double *Confine, int IfNorm) |
Moments and histogram of a signal between two values. | |
MOMENTI | DistribuzioneGauss (const double *st, int NMass, double *Intervalli, double *dInt, int Valori, int IfNorm) |
Look for the Gaussian distribution. | |
MOMENTI | DistribuzioneMaxwell (const double *st, int NMass, double *Intervalli, double *dInt, int Valori, int IfNorm) |
Look for the Maxwellian distribution. | |
void | DistrSample (double *Px, double *Py, int NMax, double **Distr, int NBin, const int NSample, int IfNorm, double *xBound) |
Compare the distribution of a sample of data. | |
MOMENTI | WeightAverage (const double *sx, const double *sy, int NMax) |
Calculate the weighted average. | |
void | WeightHisto (double **hist, double *Border, int NBin, int NHisto, double tolerance, double *OrPos, double *kSpring) |
Weighted histogram analysis. | |
void | Sort (double *Sign, int NMass) |
Sort. | |
void | Swap (int i, int j, double *Sign) |
Swap to indices. | |
void | Swap (double *s, int si, double *t, int ti, const int NDim) |
Swap to arrays. | |
void | Sort (int *Sign, int NMass) |
Sort. | |
void | Swap (int i, int j, int *Sign) |
Swap to indices. | |
void | FileSin1d (char *FName) |
Create a file with a sign function. | |
void | FileSin2d (char *FName) |
Create a file with a sign function in 2d. | |
void | ConvWeight (double *st, int NMax, double *sw, int *WIndex, int NWeight) |
Convolute with a weight. | |
void | FillWeightGauss (double *st, int *WIndex, int NWeight, double CutOff, double Sigma) |
Fill the weight array with a gaussian fuction. | |
double | LinInterp (double Px1, double Px2, double Py1, double Py2, double x) |
Linear interpolation between two points. | |
RETTA | InterRett (double *Px, double *Py, int NMass) |
Linear interpolation. | |
RETTA | InterExp (double *Px, double *Py, int NMass) |
Exponential interpolation. | |
MOMENTI | InterGauss (double *Px, double *Py, int NMass) |
Gaussian interpolation. | |
RETTA | InterRett (double *Px, double *Py, double *Peso, int NMass) |
Linear weighted interpolation. | |
PARABOLA | MinimoParabola (double a, double b, double *Px, double *Py, int NMass) |
Minimum of the Parabola between. More... | |
PARABOLA | MinimoParabola (double *Px, double *Py, int NMass) |
Global minimum interpolating via a Parabola. | |
SPLINE | Parab (double *P1, double *P2, double *P3, int x, int y) |
Three points parabolic interpolation. | |
SPLINE | Parab2 (double *PA, double *PB, double *PC, int x, int y) |
Three points parabolic interpolation. | |
CIRCLE | Osculante (double *PA, double *PB, double *PC, int x, int y) |
Osculant circle. | |
SPLINE | Cubica (double *PA, double *PB, double *PC, double *PD, int x, int y) |
Four point cubic interpolation. | |
SPLINE | Forth (double *PA, double *PB, double *PC, double *PD, double *PE, int x, int y) |
Five points four order interpolation. | |
SPLINE | Spline3 (double *P1, double *P2, double *P3, int x, int y) |
Three order spline. | |
SPLINE | Spline3Beg (double *P1, double *P2, double *P3, int x, int y) |
Three order spline first boundary. | |
SPLINE | Spline3End (double *P1, double *P2, int x, int y) |
Three order spline last boundary. | |
SPLINE | Spline4Beg (double *P1, double *P2, double *P3, double *P4, int x, int y) |
Four order spline first boundary. | |
SPLINE | Spline4 (double *P1, double *P2, double *P3, double *P4, int x, int y) |
Four order spline. | |
SPLINE | Spline4 (double *P1, double *P2, double *P3, int x, int y) |
Four order spline. | |
SPLINE | Spline4PreEnd (double *P1, double *P2, double *P3, int x, int y) |
Four order spline just before the end. | |
SPLINE | Spline4End (double *P1, double *P2, int x, int y) |
Four order spline last boundary. | |
int | Polinomio (double *P1, double *P2, int NMass, Spline *Sp) |
Polinimial interpolation of NMass order. | |
int | DerMatrix (double *Px, double *Py, int NMass, SPLINE Wg, Spline *Sp) |
Boh. | |
double | Casuale () |
Random uniform number. | |
double | RandDiscrProb (double *Prob, int NBin) |
Random number following a discrete probability. | |
double | QBezier (double *P1, double *P2, double *P3, double x, int y) |
QBezier curve of three points. | |
int | Factorial (int times) |
Computes. More... | |
double | Binomial (int times, int n) |
For the BSpline. | |
double | Blend (const double *dPoint, double x, int nPoint, int nOrder) |
For the BSpline. | |
double | Blend (double *dPoint, size_t Incr, double x, int nPoint, int nOrder) |
For the BSpline. | |
int | InterBSpline2D (Matrice *MaIn, Matrice *MaOut) |
Computes the BSpline of a given. More... | |
int | Voronoi () |
Voronoi tassellation, in progress. | |
Public Attributes | |
FUNC | Func |
Pointer to a function. | |
ELAB | Elab |
double | Ypsilon |
External parameter to calculate the contact angle. | |
double | PreFact |
External parameter in the definition of the contact angle. | |
Implementation of useful algorythms.
Definition at line 76 of file Matematica.h.
Applies the filter.
Mask | on |
Point | to |
Res |
Definition at line 82 of file MatematicaFilter.cpp.
References Matrice::Add(), Matrice::Size(), and Matrice::Val().
Referenced by DrEffect::EffectCoarseGrain(), DrEffect::EffectFilter(), and VarData::SpatialDerivative().
Applies the filter.
Mask | on |
Res |
Definition at line 108 of file MatematicaFilter.cpp.
References Matrice::CopyOn(), Matrice::pNCol(), Matrice::pNRow(), Matrice::Set(), and Matrice::Val().
|
inline |
Pointer to a function which operates on.
sw | with the data of |
st |
Definition at line 130 of file Matematica.h.
Referenced by VarDatFile::ElabSegnale().
void Derivata | ( | double * | st, |
double * | sw, | ||
int | NMass | ||
) |
Derivate of.
st |
Definition at line 41 of file MatematicaFunc.cpp.
Referenced by Matematica().
void DerO4 | ( | double * | st, |
double * | sw, | ||
int | NMass | ||
) |
Derivate O(4) of.
st |
Definition at line 46 of file MatematicaFunc.cpp.
Referenced by VarDatFile::DerivataSegnale(), SquareGradient(), and VarDatFile::VarieSegnale().
double Integrazione | ( | double * | Punti, |
double * | sw, | ||
int | NMass | ||
) |
Integral of.
st |
Definition at line 30 of file MatematicaFunc.cpp.
Referenced by F(), and VarDatFile::IntSegnale().
double Integrazione | ( | double | a, |
double | b | ||
) |
Integrates the function within.
a | and |
b |
Definition at line 22 of file MatematicaFunc.cpp.
References Evalx().
int Zeri | ( | double | a, |
double | b, | ||
double * | Radici, | ||
int | NRadici | ||
) |
Find the.
NRadici | zeros of the pointed function between a |
a | and |
b | using different algorithm |
Definition at line 58 of file MatematicaFunc.cpp.
References RADICE::IfRis, RegulaFalsi(), and RADICE::Zero.
Referenced by ElPoly::Angle(), Normalizza(), and ElPoly::RadialShell().
double Gaussiano | ( | double | Media, |
double | Scarto | ||
) |
Gaussian random number.
Mersenne Twister + Box-Muller transform.
Definition at line 23 of file MatematicaSign.cpp.
Referenced by VarData::AddChains(), VarData::AddCholesterol(), VarData::AddSolvent(), Forces::AndersenTherm(), Forces::CreateElectro(), Forces::CreateMD(), Forces::CreateSetBond(), VarData::CreateSoft(), VarData::DefRest(), Forces::InsertRest(), Forces::MinimalMD(), Forces::MoveBead(), VarData::PutPart(), Forces::WeightSetBond(), and ElPoly::WidomIn().
void Spettro2d | ( | double * | st, |
double * | sw, | ||
int | NMass | ||
) |
Compute the 2d spectrum of.
st,return | the 1d |
Definition at line 156 of file MatematicaSign.cpp.
Referenced by RandDiscrProb(), ElPoly::SpectrumF(), and VarData::Spettro2d().
void Spettro2d | ( | double * | st, |
double ** | sw, | ||
int | NMass | ||
) |
Compute the 2d spectrum of.
st,return | the 2d |
Definition at line 204 of file MatematicaSign.cpp.
PARABOLA MinimoParabola | ( | double | a, |
double | b, | ||
double * | Px, | ||
double * | Py, | ||
int | NMass | ||
) |
Minimum of the Parabola between.
a | and |
b |
Definition at line 496 of file MatematicaInterp.cpp.
References PARABOLA::a0, PARABOLA::a1, PARABOLA::a2, PARABOLA::Minimo, and PARABOLA::MinimoY.
Referenced by VarDatFile::ParabolaSegnale().
int Factorial | ( | int | times | ) |
Computes the BSpline of a given.
MaIn |