Debian Codegraph @

School05/Tuesday/solver.C

raw
1 #include "headcpp.h"
2 #include "math.h"
3
4 #include "tbl.h"
5 #include "matrice.h"
6 #include "leg.h"
7 #include "cheby.h"
8
9 //*******************
10 // First derivative
11 //*******************
12 Tbl ope_der_cheb (const Tbl& so) {
13 cout << "You have to work a bit : please implement me !" << endl ;
14 abort() ;
15 return so ;
16 }
17 //*******************
18 // Second derivative
19 //*******************
20 Tbl ope_der_sec_cheb (const Tbl& so) {
21 // Verification of size :
22 assert (so.get_ndim() == 1) ;
23 int size = so.get_dim(0) ;
24
25 // The result is set to zero
26 Tbl res (size) ;
27 res.annule_hard() ;
28
29 // the computation
30 for (int n=0 ; n<size ; n++)
31 for (int p=n+2 ; p<size ; p++)
32 if ((p+n)%2 == 0)
33 res.set(n) += p*(p*p-n*n)*so(p) ;
34
35 // Normalisation of the first coef :
36 res.set(0) /= 2. ;
37
38 return res ;
39 }
40
41
42 // Main code :
43
44 int main() {
45
46 cout << "I am a lazy code... I dont do a thing ..." << endl ;
47 return EXIT_SUCCESS ;
48 }