00001 /* 00002 * Prototypes of various utilities for Lorene 00003 * 00004 */ 00005 00006 /* 00007 * Copyright (c) 1999-2001 Eric Gourgoulhon 00008 * 00009 * This file is part of LORENE. 00010 * 00011 * LORENE is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * LORENE is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with LORENE; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 * 00025 */ 00026 00027 00028 #ifndef __UTILITAIRES_H_ 00029 #define __UTILITAIRES_H_ 00030 00031 00032 /* 00033 * $Id: utilitaires.h,v 1.11 2008/08/19 06:41:59 j_novak Exp $ 00034 * $Log: utilitaires.h,v $ 00035 * Revision 1.11 2008/08/19 06:41:59 j_novak 00036 * Minor modifications to avoid warnings with gcc 4.3. Most of them concern 00037 * cast-type operations, and constant strings that must be defined as const char* 00038 * 00039 * Revision 1.10 2004/09/01 09:47:55 r_prix 00040 * fixed/improved string-reading with read_variable(): allocates returned string 00041 * 00042 * Revision 1.9 2004/03/22 13:12:44 j_novak 00043 * Modification of comments to use doxygen instead of doc++ 00044 * 00045 * Revision 1.8 2003/12/17 23:12:30 r_prix 00046 * replaced use of C++ <string> by standard ANSI char* to be backwards compatible 00047 * with broken compilers like MIPSpro Compiler 7.2 on SGI Origin200. ;-) 00048 * 00049 * Revision 1.7 2003/12/05 15:05:53 r_prix 00050 * added read_variable() for (C++-type) strings. 00051 * 00052 * Revision 1.6 2003/12/04 12:33:21 r_prix 00053 * added prototypes and documentation for variable-reading functions 00054 * (read_variable, load_file, load_file_buffered) 00055 * 00056 * Revision 1.5 2002/05/02 15:16:22 j_novak 00057 * Added functions for more general bi-fluid EOS 00058 * 00059 * Revision 1.4 2002/04/16 08:06:44 j_novak 00060 * Addition of zerosec_borne 00061 * 00062 * Revision 1.3 2002/04/11 09:19:46 j_novak 00063 * Back to old version of zerosec 00064 * 00065 * Revision 1.2 2001/12/04 21:24:33 e_gourgoulhon 00066 * 00067 * New functions fwrite_be and fread_be for writing/reading in a 00068 * binary file according to the big endian convention. 00069 * 00070 * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon 00071 * LORENE 00072 * 00073 * Revision 1.6 2001/09/14 14:23:53 eric 00074 * Ajout de la fonction zero_list. 00075 * 00076 * Revision 1.5 2001/05/29 16:11:21 eric 00077 * Modif commentaires (mise en conformite Doc++ 3.4.7). 00078 * 00079 * Revision 1.4 1999/12/24 12:59:54 eric 00080 * Ajout de la routine zero_premier. 00081 * 00082 * Revision 1.3 1999/12/15 15:39:42 eric 00083 * *** empty log message *** 00084 * 00085 * Revision 1.2 1999/12/15 15:17:03 eric 00086 * *** empty log message *** 00087 * 00088 * Revision 1.1 1999/12/15 09:41:47 eric 00089 * Initial revision 00090 * 00091 * 00092 * $Header: /cvsroot/Lorene/C++/Include/utilitaires.h,v 1.11 2008/08/19 06:41:59 j_novak Exp $ 00093 * 00094 */ 00095 00096 #include "stdio.h" 00097 #include <string.h> 00098 00099 class Param ; 00100 class Tbl ; 00101 00117 void arrete(int a = 0) ; 00118 00137 bool zero_premier(double (*f)(double, const Param&), const Param& par, 00138 double a, double b, int n, double& a0, double& b0) ; 00139 00140 00141 00163 double zerosec( double (*f)(double, const Param&), const Param& par, 00164 double a, double b, double precis, int nitermax, 00165 int& niter) ; 00166 00189 double zerosec_b( double (*f)(double, const Param&),const Param& par, 00190 double a, double b, double precis, int nitermax, 00191 int& niter) ; 00192 00217 void zero_list( double (*f)(double, const Param&), const Param& par, 00218 double xmin, double xmax, int nsub, 00219 Tbl*& az, Tbl*& bz ) ; 00220 00238 int fwrite_be(const int* aa, int size, int nb, FILE* fich) ; 00239 00257 int fwrite_be(const double* aa, int size, int nb, FILE* fich) ; 00258 00276 int fread_be(int* aa, int size, int nb, FILE* fich) ; 00277 00295 int fread_be(double* aa, int size, int nb, FILE* fich) ; 00296 00297 00304 char *load_file(char *fname); 00305 00314 char *load_file_buffered(char *fname); 00315 00334 int read_variable(char *fname, char *var_name, char *fmt, void *varp); 00335 00337 int read_variable(char *fname, char *var_name, int &var); 00339 int read_variable(char *fname, char *var_name, bool &var); 00341 int read_variable(char *fname, char *var_name, double &var); 00343 int read_variable (char *fname, char *var_name, char **str); 00344 00346 void *MyMalloc (long bytes); 00347 00349 int FS_filelength (FILE *f); 00350 00352 void c_est_pas_fait(const char * ) ; 00353 00356 #endif
1.4.6