28 #ifndef __UTILITAIRES_H_ 29 #define __UTILITAIRES_H_ 165 bool zero_premier(
double (*f)(
double,
const Param&),
const Param& par,
166 double a,
double b,
int n,
double& a0,
double& b0) ;
193 double zerosec(
double (*f)(
double,
const Param&),
const Param& par,
194 double a,
double b,
double precis,
int nitermax,
195 int& niter,
bool abort=
true) ;
219 double zerosec_b(
double (*f)(
double,
const Param&),
const Param& par,
220 double a,
double b,
double precis,
int nitermax,
247 void zero_list(
double (*f)(
double,
const Param&),
const Param& par,
248 double xmin,
double xmax,
int nsub,
249 Tbl*& az, Tbl*& bz ) ;
264 Tbl
integ1D(
const Tbl& xx,
const Tbl& ff) ;
301 int fwrite_be(
const int* aa,
int size,
int nb, FILE* fich) ;
320 int fwrite_be(
const double* aa,
int size,
int nb, FILE* fich) ;
339 int fread_be(
int* aa,
int size,
int nb, FILE* fich) ;
358 int fread_be(
double* aa,
int size,
int nb, FILE* fich) ;
397 int read_variable(
const char *fname,
const char *var_name,
char *fmt,
void *varp);
400 int read_variable(
const char *fname,
const char *var_name,
int &var);
402 int read_variable(
const char *fname,
const char *var_name,
bool &var);
404 int read_variable(
const char *fname,
const char *var_name,
double &var);
406 int read_variable (
const char *fname,
const char *var_name,
char **str);
419 bool search_file(ifstream& infile,
const string& pattern) ;
424 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.
void arrete(int a=0)
Setting a stop point in a code.