00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef __GRID_H_
00039 #define __GRID_H_
00040
00041
00042
00043
00044
00048 class Grid {
00049
00050
00051
00052 protected:
00053 const int nn ;
00054 double* xx ;
00055
00056
00057
00058 public:
00063 Grid(int nb_nodes, double* xi) ;
00064
00065 Grid(const Grid& ) ;
00066
00067 protected:
00071 Grid(int nb_nodes) ;
00072
00073 public:
00074 virtual ~Grid() ;
00075
00076
00077
00078 public:
00080 void operator=(const Grid&) ;
00081
00082
00083
00084 public:
00085 int n() const ;
00086
00087 double operator()(int i) const ;
00088
00123 void plot(int color = 1, int nfig = 0, double ymin = -1.,
00124 double ymax = 1., const char* title = 0x0,
00125 const char* label_y = 0x0, const char* device = 0x0) const ;
00126
00127
00128
00129 public:
00140 double lagrange(int i, double x) const ;
00141
00151 double nodal_polynomial(double x) const ;
00152
00160 double interpole(double (*f)(double), double x) const ;
00161
00163 double lebesgue_constant() const ;
00164
00165 };
00166
00168 ostream& operator<<(ostream& , const Grid& ) ;
00169
00170
00171
00172
00173
00174
00175
00176
00180 class Grid_uniform : public Grid {
00181
00182
00183
00184 public:
00188 Grid_uniform(int nb_nodes) ;
00189
00190 Grid_uniform(const Grid_uniform& ) ;
00191
00192 virtual ~Grid_uniform() ;
00193
00194
00195
00196 public:
00198 void operator=(const Grid_uniform&) ;
00199
00200
00201 };
00202
00204 ostream& operator<<(ostream& , const Grid_uniform& ) ;
00205
00206
00207
00208
00209
00210
00211
00215 class Grid_Legendre_Gauss : public Grid {
00216
00217
00218
00219 public:
00223 Grid_Legendre_Gauss(int nb_nodes) ;
00224
00225 Grid_Legendre_Gauss(const Grid_Legendre_Gauss& ) ;
00226
00227 virtual ~Grid_Legendre_Gauss() ;
00228
00229
00230
00231 public:
00233 void operator=(const Grid_Legendre_Gauss&) ;
00234
00235
00236 };
00237
00239 ostream& operator<<(ostream& , const Grid_Legendre_Gauss& ) ;
00240
00241
00242
00243
00244
00245
00246
00250 class Grid_Legendre_GL : public Grid {
00251
00252
00253
00254 public:
00258 Grid_Legendre_GL(int nb_nodes) ;
00259
00260 Grid_Legendre_GL(const Grid_Legendre_GL& ) ;
00261
00262 virtual ~Grid_Legendre_GL() ;
00263
00264
00265
00266 public:
00268 void operator=(const Grid_Legendre_GL&) ;
00269
00270
00271 };
00272
00274 ostream& operator<<(ostream& , const Grid_Legendre_GL& ) ;
00275
00276
00277
00278
00279
00280
00281
00282
00286 class Grid_Chebyshev_Gauss : public Grid {
00287
00288
00289
00290 public:
00294 Grid_Chebyshev_Gauss(int nb_nodes) ;
00295
00296 Grid_Chebyshev_Gauss(const Grid_Chebyshev_Gauss& ) ;
00297
00298 virtual ~Grid_Chebyshev_Gauss() ;
00299
00300
00301
00302 public:
00304 void operator=(const Grid_Chebyshev_Gauss&) ;
00305
00306
00307 };
00308
00310 ostream& operator<<(ostream& , const Grid_Chebyshev_Gauss& ) ;
00311
00312
00313
00314
00315
00316
00317
00321 class Grid_Chebyshev_GL : public Grid {
00322
00323
00324
00325 public:
00329 Grid_Chebyshev_GL(int nb_nodes) ;
00330
00331 Grid_Chebyshev_GL(const Grid_Chebyshev_GL& ) ;
00332
00333 virtual ~Grid_Chebyshev_GL() ;
00334
00335
00336
00337 public:
00339 void operator=(const Grid_Chebyshev_GL&) ;
00340
00341
00342 };
00343
00345 ostream& operator<<(ostream& , const Grid_Chebyshev_GL& ) ;
00346
00347 #endif