15 #include "randomlib.h" 16 #include "MatematicaVect.h" 17 #include "MatematicaQuadri.h" 18 #include "MatematicaMatrix.h" 19 #include "MatematicaStruct.h" 20 #include "MatematicaPlane.h" 21 #include <mt19937ar.h> 24 #include <gsl/gsl_math.h> 25 #include <gsl/gsl_rng.h> 31 #define STRLEN STRSIZE 32 #define QUAD(A) ((A)*(A)) 33 #define SQUARE(A) QUAD(A) 34 #define SQR(A) QUAD(A) 35 #define CUB(A) (QUAD(A)*(A)) 36 #define CUBE(A) (QUAD(A)*(A)) 37 #define SIGN(A) (A>0?1.:-1.) 39 #define DUE_PI (6.2831853071795864769252867665590057683943) 40 #define DEG_RAD (0.0174532925199433) 41 #define RAD_DEG (57.2957795130823) 42 #define INV_DUE_PI (0.159154943091895) 44 #define SQRT_PI 1.77245385090552 45 #define MIN(a,b) ( ( (a)<=(b) ) ? (a) : (b) ) 46 #define MIN3(a,b,c) ( MIN(MIN(a,b),c) ) 47 #define MAS(a,b) ( ( (a)>=(b) ) ? (a):(b) ) 48 #define MAX(a,b) MAS(a,b) 49 #define POS(a) ( ( a>=0 ) ? (a):(-a) ) 52 #define OP_IF(c,t) ( ((c)&(t))==(t) ) 53 #define OP_INVERT 0x00001 54 #define OP_ROT_90 0x00002 55 #define OP_ROT_180 0x00004 56 #define OP_MIRROR 0x00008 57 #define OP_ROT_270 0x0000c 58 #define OP_TRANSPOSE 0x0000f 63 int NumeroStringa(
const char *NumeroC);
64 void abort_(
const char * s, ...);
65 void SigErr(
int IfWrong,
const char * s, ...);
66 void Message(
const char * s, ...);
70 float zigset(
unsigned long);
94 int PermuteRandomAll(
int *Sequence,
int NMass);
96 int PermuteRandomAll(
PERMUTE *Sequence,
int NMass);
102 int Transform(
int *Out,
int *In,
int NEdge,
int operation);
106 void Smooth(
double *st,
double *sw,
int NIn,
int NOut);
113 double Evalx(
double x){
return (*this.*Func)(x);}
115 double ContactAngle(
double x);
117 double fProva(
double x);
121 double F(
double TD,
double T);
123 double Df(
double x,
double Delta);
127 typedef void(
Matematica::*ELAB)(
double *st,
double *sw,
int NMass);
130 void ElabSt(
double *st,
double *sw,
int NMass){
return (*this.*Elab)(st,sw,NMass);};
132 void Derivata(
double *st,
double *sw,
int NMass);
134 void DerO4(
double *st,
double *sw,
int NMass);
136 double Integrazione(
double *Punti,
double *sw,
int NMass);
140 void SquareGradient(
double *st,
double *sw,
int NMass);
142 double Integrazione(
double a,
double b);
144 double IntegrazioneGauss(
double a,
double b,
double Scarto);
146 int Zeri(
double a,
double b,
double *Radici,
int NRadici);
148 RADICE RegulaFalsi(
double a,
double b);
152 double Estremo(
double a,
double b);
154 double Fattoriale(
int n);
158 double Elevato(
double x,
int Volte);
160 double Bessel(
double Val,
int Ord);
162 double Neumann(
double Val,
int Ord);
166 double QuasiBessel(
double Val,
int Ord);
168 double QuasiNeumann(
double Val,
int Ord);
170 double WeightFunction(
double x,
double a);
172 double WeightFunction2(
double x,
double a);
174 double LJHamaker(
double r,
double r_np,
double theta);
176 double LJHamakerCum(
double Rad,
double RadNpMin,
double RadNpMax);
178 double LJHamaker(
double Rad,
double r_np);
180 double LJ39(
double r,
double r_np);
183 void ExecCommand(
double *st,
double *st1,
int NMass,
char *cmd);
185 double ExecFormula(
double x,
double y,
char *cmd);
187 double ExecFormula(
double **st,
int n,
char *cmd);
189 double Gauss(
double Media,
double Scarto,
double x);
191 bool InizializzaGaussiano(
double Scarto,
int N);
193 double Gaussiano(
double Media,
double Scarto);
195 void Spettro(
double *st,
double *sw,
int NMass);
197 void Spettro2d(
double *st,
double *sw,
int NMass);
199 void Spettro2d(
double *st,
double **sw,
int NMass);
201 void SpettroDFT(
double *st,
double *sw,
int NMass);
203 void Radice(
double *st,
double *sw,
int N);
205 void Autocor(
bool *st,
double *sAuto,
int N);
207 void Autocor(
double *st,
double *sAuto,
int NMass);
209 double Norm(
double *st,
int NMass);
211 int NormalizeArea(
double *st,
int NMass);
213 void NormalizeVect(
double *st,
int NMass);
215 int Normalizza(
double *st,
int NMass);
217 int Normalizza(
double *st,
double *sw,
int NMass);
219 void Modulo(
double *st,
double *sw,
int NMass);
221 void MediaMobile(
double *st,
int NMass,
double *sw,
int Parti);
223 int MediaMobile(
double *st,
int NMass,
double *sw,
double *sErr,
int Parti);
225 int CorrelaDuePunti(
double *st,
int NMass,
double *sw,
int Punti);
227 void Autosimilarita(
double *st,
int NMass,
double *sw,
int Valori);
229 MOMENTI Distribuzione(
const double *st,
int NMass);
231 MOMENTI Distribuzione(
const double *st,
int NMass,
double *Intervalli,
int Valori,
int IfNorm);
233 MOMENTI Distribuzione(
const double *st,
int NMass,
double *Intervalli,
int Valori,
double *Confine,
int IfNorm);
235 MOMENTI DistrErr(
const double *st,
int NMass,
double *Intervalli,
double *Err,
int Valori,
double *Confine,
int IfNorm);
237 MOMENTI DistribuzioneGauss(
const double *st,
int NMass,
double *Intervalli,
double *dInt,
int Valori,
int IfNorm);
239 MOMENTI DistribuzioneMaxwell(
const double *st,
int NMass,
double *Intervalli,
double *dInt,
int Valori,
int IfNorm);
241 void DistrSample(
double *Px,
double *Py,
int NMax,
double **Distr,
int NBin,
const int NSample,
int IfNorm,
double *xBound);
243 MOMENTI WeightAverage(
const double *sx,
const double *sy,
int NMax);
245 void WeightHisto(
double **hist,
double *Border,
int NBin,
int NHisto,
double tolerance,
double *OrPos,
double *kSpring);
247 void Sort(
double *Sign,
int NMass);
249 void Swap(
int i,
int j,
double *Sign);
251 void Swap(
double *s,
int si,
double *t,
int ti,
const int NDim);
253 void Sort(
int *Sign,
int NMass);
255 void Swap(
int i,
int j,
int *Sign);
257 void FileSin1d(
char *FName);
259 void FileSin2d(
char *FName);
261 void ConvWeight(
double *st,
int NMax,
double *sw,
int *WIndex,
int NWeight);
263 void FillWeightGauss(
double *st,
int *WIndex,
int NWeight,
double CutOff,
double Sigma);
266 double LinInterp(
double Px1,
double Px2,
double Py1,
double Py2,
double x);
268 RETTA InterRett(
double *Px,
double *Py,
int NMass);
270 RETTA InterExp(
double *Px,
double *Py,
int NMass);
272 MOMENTI InterGauss(
double *Px,
double *Py,
int NMass);
274 RETTA InterRett(
double *Px,
double *Py,
double *Peso,
int NMass);
276 PARABOLA MinimoParabola(
double a,
double b,
double *Px,
double *Py,
int NMass);
278 PARABOLA MinimoParabola(
double *Px,
double *Py,
int NMass);
280 SPLINE Parab(
double *P1,
double *P2,
double *P3,
int x,
int y);
282 SPLINE Parab2(
double *PA,
double *PB,
double *PC,
int x,
int y);
284 CIRCLE Osculante(
double *PA,
double *PB,
double *PC,
int x,
int y);
286 SPLINE Cubica(
double *PA,
double *PB,
double *PC,
double *PD,
int x,
int y);
288 SPLINE Forth(
double *PA,
double *PB,
double *PC,
double *PD,
double *PE,
int x,
int y);
290 SPLINE Spline3(
double *P1,
double *P2,
double *P3,
int x,
int y);
292 SPLINE Spline3Beg(
double *P1,
double *P2,
double *P3,
int x,
int y);
294 SPLINE Spline3End(
double *P1,
double *P2,
int x,
int y);
296 SPLINE Spline4Beg(
double *P1,
double *P2,
double *P3,
double *P4,
int x,
int y);
298 SPLINE Spline4(
double *P1,
double *P2,
double *P3,
double *P4,
int x,
int y);
300 SPLINE Spline4(
double *P1,
double *P2,
double *P3,
int x,
int y);
302 SPLINE Spline4PreEnd(
double *P1,
double *P2,
double *P3,
int x,
int y);
304 SPLINE Spline4End(
double *P1,
double *P2,
int x,
int y);
306 int Polinomio(
double *P1,
double *P2,
int NMass,
Spline *Sp);
308 int DerMatrix(
double *Px,
double *Py,
int NMass,
SPLINE Wg,
Spline *Sp);
312 double RandDiscrProb(
double *Prob,
int NBin);
314 double QBezier(
double *P1,
double *P2,
double *P3,
double x,
int y);
316 int Factorial(
int times);
318 double Binomial(
int times,
int n);
320 double Blend(
const double *dPoint,
double x,
int nPoint,
int nOrder);
322 double Blend(
double *dPoint,
size_t Incr,
double x,
int nPoint,
int nOrder);
336 uint sTable(
char *String);
338 uint sTable(
char Char);
342 virtual double operator()(
double x)=0;
343 virtual double Call(
double x)=0;
347 double (Classe::*ftp)(
const double x);
350 SpecFuntore(Classe* _pt2Object,
void (Classe::*_ftp)(
double x))
351 { pt2Object = _pt2Object; ftp = _ftp; };
352 virtual double operator()(
const double x)
353 {
return (*pt2Object.*ftp)(x);};
354 virtual double Call(
double x)
355 {
return (*pt2Object.*ftp)(x);};
358 #endif //MATEMATICA_H double Ypsilon
External parameter to calculate the contact angle.
coeficients of a N order spline
Indices for the permutation.
void ElabSt(double *st, double *sw, int NMass)
Pointer to a function which operates on.
FUNC Func
Pointer to a function.
Moments of a distribution.
double PreFact
External parameter in the definition of the contact angle.
Matrice computes the algebric operations on matrices.
Where a root was searched.
double Evalx(double x)
Pointer to a generic function.
Implementation of useful algorythms.
Radius and center of a circle.