Path: blob/devel/ElmerGUI/Application/plugins/egutils.h
3203 views
/* nrutil.h + common.h -> egutils.h */123#ifndef _EGUTILS_H_4#define _EGUTILS_H_567typedef double Real;8#define Rvector dvector9#define Ivector ivector10#define Cvector cvector11#define Rmatrix dmatrix12#define Imatrix imatrix13#define free_Rvector free_dvector14#define free_Ivector free_ivector15#define free_Cvector free_cvector16#define free_Rmatrix free_dmatrix17#define free_Imatrix free_imatrix18#define TRUE 119#define FALSE 02021/* Numerical Recipes' uncopyrighted vector and matrix allocation22and deallocation routines. */23int MemoryUsage();2425void nrerror(const char error_text[]);2627float *vector(int,int);28int *ivector(int,int);29char *cvector(int,int);30unsigned long *lvector(int,int);31double *dvector(int,int);3233float **matrix(int,int,int,int);34double **dmatrix(int,int,int,int);35int **imatrix(int,int,int,int);36float **submatrix(float **,int,int,int,int,int,int);37double ***f3tensor(int nrl,int nrh,int ncl,int nch,int ndl,int ndh);3839void free_vector(float *,int,int);40void free_ivector(int *,int,int);41void free_cvector(char *,int,int);42void free_lvector(unsigned long *,int,int);43void free_dvector(double *,int,int);4445void free_matrix(float **,int,int,int,int);46void free_dmatrix(double **,int,int,int,int);47void free_imatrix(int **,int,int,int,int);48void free_submatrix(float **,int,int,int,int);49void free_f3tensor(double ***t,int nrl,int nrh,int ncl,int nch,int ndl,int ndh);5051/* Common subroutines that operate on vectors, matrices and other basic52data types: Find the minimum or maximum place or value, find53the mean, calculate the mean difference, save to or load from54an external file etc. */5556void timer_init();57void timer_activate(const char *prefix);58void timer_show();5960void bigerror(const char error_text[]);61void smallerror(const char error_text[]);62int FileExists(char *filename);63Real Minimum(Real *vector,int first,int last);64int Minimi(Real *vector,int first,int last);65Real Maximum(Real *vector,int first,int last);66int Maximi(Real *vector,int first,int last);67void AddExtension(const char *fname1,char *fname2,const char *newext);68int StringToStrings(const char *buf,char argv[10][15],int argc,char separator);69int StringToReal(const char *buf,Real *dest,int maxcnt,char separator);70int StringToInteger(const char *buf,int *dest,int maxcnt,char separator);71int StringToIntegerNoZero(const char *buf,int *dest,int maxcnt,char separator);72int next_int(char **start);73int next_int_n(char **start, int n);74Real next_real(char **start);75void SortIndex( int N, double *Key, int *Ord );76#endif777879