28 #ifndef __UTILITAIRES_H_ 29 #define __UTILITAIRES_H_ 168 bool zero_premier(
double (*f)(
double,
const Param&),
const Param& par,
169 double a,
double b,
int n,
double& a0,
double& b0) ;
196 double zerosec(
double (*f)(
double,
const Param&),
const Param& par,
197 double a,
double b,
double precis,
int nitermax,
198 int& niter,
bool abort=
true) ;
222 double zerosec_b(
double (*f)(
double,
const Param&),
const Param& par,
223 double a,
double b,
double precis,
int nitermax,
250 void zero_list(
double (*f)(
double,
const Param&),
const Param& par,
251 double xmin,
double xmax,
int nsub,
252 Tbl*& az, Tbl*& bz ) ;
267 Tbl
integ1D(
const Tbl& xx,
const Tbl& ff) ;
304 int fwrite_be(
const int* aa,
int size,
int nb, FILE* fich) ;
323 int fwrite_be(
const double* aa,
int size,
int nb, FILE* fich) ;
342 int fread_be(
int* aa,
int size,
int nb, FILE* fich) ;
361 int fread_be(
double* aa,
int size,
int nb, FILE* fich) ;
400 int read_variable(
const char *fname,
const char *var_name,
char *fmt,
void *varp);
403 int read_variable(
const char *fname,
const char *var_name,
int &var);
405 int read_variable(
const char *fname,
const char *var_name,
bool &var);
407 int read_variable(
const char *fname,
const char *var_name,
double &var);
409 int read_variable (
const char *fname,
const char *var_name,
char **str);
422 bool search_file(ifstream& infile,
const string& pattern) ;
427 Tbl*& p_press, Tbl*& p_ener, Tbl*& p_nb, Tbl*& p_temp,
void * MyMalloc(long bytes)
'Improved' malloc that sets memory to 0 and also auto-terminates on error.
Tbl poly_regression(const Tbl &, const Tbl &, int)
Polynomial regression, giving Chebyshev coefficients.
double zerosec_b(double(*f)(double, const Param &), const Param &par, double a, double b, double precis, int nitermax, int &niter)
Finding the zero a function on a bounded domain.
double zerosec(double(*f)(double, const Param &), const Param &par, double a, double b, double precis, int nitermax, int &niter, bool abort=true)
Finding the zero a function.
char * load_file(char *fname)
Read file into memory and returns pointer to data.
int FS_filelength(FILE *f)
A portable routine to determine the length of a file.
bool search_file(ifstream &infile, const string &pattern)
A function that searches for a pattern in a file and places the file stream after the found pattern...
void zero_list(double(*f)(double, const Param &), const Param &par, double xmin, double xmax, int nsub, Tbl *&az, Tbl *&bz)
Locates approximatively all the zeros of a function in a given interval.
bool read_compose_table(const string &tablename, Tbl *&p_ental, Tbl *&p_entro, Tbl *&p_press, Tbl *&p_ener, Tbl *&p_nb, Tbl *&p_temp, Tbl *&p_ye)
A function to read CompOSE table and return themro quantities in Lorene units.
Tbl integ1D(const Tbl &xx, const Tbl &ff)
Integrates a function defined on an unequally-spaced grid, approximating it by piecewise parabolae...
void compute_derivative(const Tbl &xx, const Tbl &ff, Tbl &dfdx)
Derives a function defined on an unequally-spaced grid, approximating it by piecewise parabolae...
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.
bool zero_premier(double(*f)(double, const Param &), const Param &par, double a, double b, int n, double &a0, double &b0)
Locates the sub-interval containing the first zero of a function in a given interval.
char * load_file_buffered(char *fname)
Returns pointer to data from a file using a buffer.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
int read_variable(const char *fname, const char *var_name, char *fmt, void *varp)
Reads a variable from file.
bool admissible_fft(int)
Checks whether or not a given number of degrees of freedom is compatible with the FFT transform...
void arrete(int a=0)
Setting a stop point in a code.