28#ifndef __UTILITAIRES_H_
29#define __UTILITAIRES_H_
153bool zero_premier(
double (*f)(
double,
const Param&),
const Param& par,
154 double a,
double b,
int n,
double& a0,
double& b0) ;
181double zerosec(
double (*f)(
double,
const Param&),
const Param& par,
182 double a,
double b,
double precis,
int nitermax,
183 int& niter,
bool abort=
true) ;
207double zerosec_b(
double (*f)(
double,
const Param&),
const Param& par,
208 double a,
double b,
double precis,
int nitermax,
235void zero_list(
double (*f)(
double,
const Param&),
const Param& par,
236 double xmin,
double xmax,
int nsub,
237 Tbl*& az, Tbl*& bz ) ;
252 Tbl
integ1D(
const Tbl& xx,
const Tbl& ff) ;
271int fwrite_be(
const int* aa,
int size,
int nb, FILE* fich) ;
290int fwrite_be(
const double* aa,
int size,
int nb, FILE* fich) ;
309int fread_be(
int* aa,
int size,
int nb, FILE* fich) ;
328int fread_be(
double* aa,
int size,
int nb, FILE* fich) ;
367int read_variable(
const char *fname,
const char *var_name,
char *fmt,
void *varp);
370int read_variable(
const char *fname,
const char *var_name,
int &var);
372int read_variable(
const char *fname,
const char *var_name,
bool &var);
374int read_variable(
const char *fname,
const char *var_name,
double &var);
376int read_variable (
const char *fname,
const char *var_name,
char **str);
char * load_file_buffered(char *fname)
Returns pointer to data from a file using a buffer.
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.
char * load_file(char *fname)
Read file into memory and returns pointer to data.
Tbl integ1D(const Tbl &xx, const Tbl &ff)
Integrates a function defined on an unequally-spaced grid, approximating it by piece parabolae.
int FS_filelength(FILE *f)
A portable routine to determine the length of a file.
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
void arrete(int a=0)
Setting a stop point in a code.
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from 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.
void * MyMalloc(long bytes)
'Improved' malloc that sets memory to 0 and also auto-terminates on error.
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.
int read_variable(const char *fname, const char *var_name, char *fmt, void *varp)
Reads a variable from file.
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.
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.