TP Intégration Numérique
 All Files Functions
mesh1D.c
Go to the documentation of this file.
1 
8 #include "mesh1D.h"
9 
10 
11 void DisReg(double a, double b, int N, double *X,double *ph){
12  int i;
13  PRINT_VERBOSE("->");
14  assert( (N>1) && (b>a) );
15  *ph=(b-a)/(N-1);
16  for (i=0;i<N;i++)
17  X[i]=a+i*(*ph);
18  PRINT_VERBOSE("<-");
19 }
20 
21 
22 void DisRegAlloc(double a, double b, int N, double **pX,double *ph){
23  PRINT_VERBOSE("->");
24  assert( (N>1) && (b>a) );
25  //Free(*pX);
26  *pX=(double *)Malloc(N*sizeof(double));
27  DisReg(a,b,N,*pX,ph);
28  PRINT_VERBOSE("<-");
29 }
30