- Timestamp:
- Nov 29, 2002, 3:03:45 PM (23 years ago)
- Location:
- trunk/SophyaLib/NTools
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/Makefile
r1949 r2283 211 211 $(INC)perrors.h fmath.h \ 212 212 $(INC)sopemtx.h 213 $(OBJ)integ.o: integ.cc integ.h $(INC)machdefs.h \213 $(OBJ)integ.o: integ.cc integ.h classfunc.h $(INC)machdefs.h \ 214 214 $(INC)pexceptions.h generalfit.h \ 215 215 $(INC)tvector.h \ -
trunk/SophyaLib/NTools/integ.cc
r244 r2283 54 54 {} 55 55 56 Integrator::Integrator(fun f, double xmin, double xmax) 57 // 58 // Constructeur à partir de la fonction double->double, et des 59 // bornes d'intégration. 60 //-- 61 : mFunc(new Function(f)), mGFF(NULL), mGFFParm(NULL), 62 mNStep(50), mDX(-1), mReqPrec(-1), 63 mXMin(xmin), mXMax(xmax) 64 {} 65 66 56 67 //++ 57 68 Integrator::Integrator(FUNC f) … … 66 77 67 78 //++ 79 Integrator::Integrator(fun f) 80 // 81 // Constructeur sans spécifier les bornes. Elles sont positionnées 82 // à [0,1], et on pourra les modifier plus tard. 83 //-- 84 : mFunc(new Function(f)), mGFF(NULL), mGFFParm(NULL), 85 mNStep(50), mDX(-1), mReqPrec(-1), 86 mXMin(0), mXMax(1) 87 {} 88 89 //++ 68 90 Integrator::Integrator(GeneralFunction* gff, double* par, double xmin, double xmax) 69 91 // … … 95 117 96 118 Integrator::~Integrator() 97 { }119 {delete mFunc;} 98 120 99 121 //++ … … 193 215 DBASSERT( mFunc || (mGFF && mGFFParm) ); 194 216 return mFunc ? (*mFunc)(x) : mGFF->Value(&x, mGFFParm); 195 }217 } 196 218 197 219 double … … 236 258 : Integrator(f, xmin, xmax) 237 259 {} 260 //++ 261 TrpzInteg::TrpzInteg(fun f, double xmin, double xmax) 262 // 263 //-- 264 : Integrator(f, xmin, xmax) 265 {} 238 266 239 267 //++ 240 268 TrpzInteg::TrpzInteg(FUNC f) 269 // 270 //-- 271 : Integrator(f) 272 {} 273 274 TrpzInteg::TrpzInteg(fun f) 241 275 // 242 276 //-- … … 331 365 NStep(1); 332 366 } 333 367 GLInteg::GLInteg(fun f, double xmin, double xmax) 368 // 369 //-- 370 : Integrator(f, xmin, xmax), mXPos(NULL), mWeights(NULL), mOrder(8) 371 { 372 NStep(1); 373 } 334 374 //++ 335 375 GLInteg::GLInteg(FUNC f) 376 // 377 //-- 378 : Integrator(f), mXPos(NULL), mWeights(NULL), mOrder(8) 379 { 380 NStep(1); 381 } 382 GLInteg::GLInteg(fun f) 336 383 // 337 384 //-- -
trunk/SophyaLib/NTools/integ.h
r1371 r2283 10 10 #include "pexceptions.h" 11 11 #include <set> 12 #include "classfunc.h" 12 13 13 14 namespace SOPHYA { … … 17 18 class Integrator { 18 19 public: 19 typedef double(*FUNC)(double); 20 //typedef double(*FUNC)(double); 21 typedef ClassFunc *FUNC; 22 typedef double (*fun)(double); 20 23 21 24 Integrator(); 22 25 Integrator(FUNC, double xmin, double xmax); 23 26 Integrator(FUNC); 27 28 Integrator(fun, double xmin, double xmax); 29 Integrator(fun); 30 24 31 Integrator(GeneralFunction*, double* par, double xmin, double xmax); 25 32 Integrator(GeneralFunction*, double* par); … … 60 67 TrpzInteg(FUNC, double xmin, double xmax); 61 68 TrpzInteg(FUNC); 69 TrpzInteg(fun, double xmin, double xmax); 70 TrpzInteg(fun); 62 71 TrpzInteg(GeneralFunction*, double* par, double xmin, double xmax); 63 72 TrpzInteg(GeneralFunction*, double* par); … … 73 82 GLInteg(FUNC, double xmin, double xmax); 74 83 GLInteg(FUNC); 84 GLInteg(fun, double xmin, double xmax); 85 GLInteg(fun); 75 86 GLInteg(GeneralFunction*, double* par, double xmin, double xmax); 76 87 GLInteg(GeneralFunction*, double* par);
Note:
See TracChangeset
for help on using the changeset viewer.