TP Intégration Numérique
 All Files Functions
utils.h
Go to the documentation of this file.
1 
19 #ifndef _UTILS_H
20 #define _UTILS_H
21 
22 #include <assert.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include "textcolors.h"
26 
27 typedef enum{ false=0, true=1} Bool;
28 typedef unsigned long MEMORY_TYPE;
29 
30 #ifdef DEBUG
31 #define PRINT_DEBUG(C,A) printf("%sdebug : %s (memory adress: %#lX)%s\n",DEBUGCOLOR,C,(MEMORY_TYPE)A,TEXTCOLOR_END);
32 #else
33 #define PRINT_DEBUG(C,A)
34 #endif
35 
36 #ifdef VERBOSE
37 #define PRINT_VERBOSE(C) printf("%sverbose : %s function %s [%s line %d]%s\n",VERBOSECOLOR,C,__FUNCTION__,__FILE__,__LINE__,TEXTCOLOR_END);
38 #else
39 #define PRINT_VERBOSE(C)
40 #endif
41 
42 #define MAX(a,b) ((a>b)?(a):(b))
43 #define MIN(a,b) ((a>b)?(b):(a))
44 
49 void *Calloc(size_t nmemb,size_t size);
50 
55 void *Malloc(size_t size);
56 
61 void Free(void *ptr);
62 
70 void FREE(void **ptr);
71 
82 void printDoubleDynArray(double *X,int N,char *Name,char *format,int perline);
83 
95 void saveDoubleDynArray(double *X,int N,char *FileName,char *format);
96 
109 void saveTwoDoubleDynArray(double *X,double *Y,int N,char *FileName,char *format);
110 #endif
111