28#ifndef __UTILITAIRES_H_
29#define __UTILITAIRES_H_
163 double a,
double b,
int n,
double& a0,
double& b0) ;
191 double a,
double b,
double precis,
int nitermax,
192 int& niter,
bool abort=
true) ;
217 double a,
double b,
double precis,
int nitermax,
245 double xmin,
double xmax,
int nsub,
298int fwrite_be(
const int* aa,
int size,
int nb, FILE* fich) ;
317int fwrite_be(
const double* aa,
int size,
int nb, FILE* fich) ;
336int fread_be(
int* aa,
int size,
int nb, FILE* fich) ;
355int fread_be(
double* aa,
int size,
int nb, FILE* fich) ;
394int read_variable(
const char *fname,
const char *var_name,
char *fmt,
void *varp);
397int read_variable(
const char *fname,
const char *var_name,
int &var);
399int read_variable(
const char *fname,
const char *var_name,
bool &var);
401int read_variable(
const char *fname,
const char *var_name,
double &var);
403int read_variable (
const char *fname,
const char *var_name,
char **str);
416 bool search_file(ifstream& infile,
const string& pattern) ;
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 poly_regression(const Tbl &, const Tbl &, int)
Polynomial regression, giving Chebyshev coefficients.
Tbl integ1D(const Tbl &xx, const Tbl &ff)
Integrates a function defined on an unequally-spaced grid, approximating it by piecewise parabolae.
int FS_filelength(FILE *f)
A portable routine to determine the length of a file.
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.
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.
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.
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.