|
TP Intégration Numérique
|
Useful tools to illustrate the course of C Language : header file. More...
Go to the source code of this file.
Macros | |
| #define | PRINT_DEBUG(C, A) |
| #define | PRINT_VERBOSE(C) |
| #define | MAX(a, b) ((a>b)?(a):(b)) |
| #define | MIN(a, b) ((a>b)?(b):(a)) |
Typedefs | |
| typedef unsigned long | MEMORY_TYPE |
Enumerations | |
| enum | Bool { false =0, true =1 } |
Functions | |
| void * | Calloc (size_t nmemb, size_t size) |
Interface to usual calloc function with same parameters. | |
| void * | Malloc (size_t size) |
Interface to usual malloc function with same parameters. | |
| void | Free (void *ptr) |
Interface to usual free function with same parameters. | |
| void | FREE (void **ptr) |
Modified version of the usual free function. | |
| void | printDoubleDynArray (double *X, int N, char *Name, char *format, int perline) |
| Matlab like printing array. | |
| void | saveDoubleDynArray (double *X, int N, char *FileName, char *format) |
| save X array in file | |
| void | saveTwoDoubleDynArray (double *X, double *Y, int N, char *FileName, char *format) |
| save X and Y arrays in file | |
Useful tools to illustrate the course of C Language : header file.
For printing memory information compile with -DDEBUG option and for more information compile with -DVERBOSE option.
gcc sample command:
gcc -DDEBUG -DVERBOSE -c utils.c
or more generaly
make DEBUG=1 VERBOSE=1
Definition in file utils.h.
| void FREE | ( | void ** | ptr | ) |
| void printDoubleDynArray | ( | double * | X, |
| int | N, | ||
| char * | Name, | ||
| char * | format, | ||
| int | perline | ||
| ) |
Matlab like printing array.
| [in] | X | pointer to dynamic array of doubles, |
| [in] | N | number of doubles in X, |
| [in] | Name | displaying name, |
| [in] | format | format specification for displaying double values, "%.16lf" for example, |
| [in] | perline | number of double values per line. |
| void saveDoubleDynArray | ( | double * | X, |
| int | N, | ||
| char * | FileName, | ||
| char * | format | ||
| ) |
| void saveTwoDoubleDynArray | ( | double * | X, |
| double * | Y, | ||
| int | N, | ||
| char * | FileName, | ||
| char * | format | ||
| ) |
save X and Y arrays in file
| [in] | X | pointer to dynamic array of doubles, |
| [in] | Y | pointer to dynamic array of doubles, |
| [in] | N | number of doubles in X and in Y, |
| [in] | FileName | name of the file, |
| [in] | format | format specification for writing double values, "%.16lf %.16lf" for example, |
Two double values by line!