NLToolbox
|
00001 /* 00002 * PointerSystem.h 00003 * 00004 * Created on: Jan 22, 2013 00005 * Author: romain 00006 */ 00007 00008 #ifndef POINTERSYSTEM_H_ 00009 #define POINTERSYSTEM_H_ 00010 00011 #include "DynamicalSystem.h" 00012 #include "utils.h" 00013 #include "Box.h" 00014 #include "stdexcept" 00015 00016 namespace nltool { 00017 00018 00019 class PointerSystem: public DynamicalSystem { 00020 public: 00021 00025 PointerSystem(); 00026 00036 PointerSystem(int dim, Number (*f)(const int x, const stdVector &pt, void* data), 00037 Number (*df)(const int x, const stdVector &pt, const int dx, void* data), 00038 Number (*ddf)(const int x, const stdVector &pt, const int dx, 00039 const int dy, void* data), void* data, bool discretized = false); 00040 00044 virtual ~PointerSystem(); 00045 00051 Vector eval(const Vector& x); 00052 00060 Vector evalCurvature(const Vector& x, int dx, int dy); 00061 00070 Number getMaxCurvature(const unsigned i, const unsigned dx, 00071 const unsigned dy, const Box& domain); 00072 00080 static double CurvatureFunc(const std::vector<double> &x, 00081 std::vector<double> &grad, void* f_data); 00082 // variable used by CurvatureFunc 00083 unsigned curvatureFunctionX; 00084 unsigned curvatureFunctionDx; 00085 unsigned curvatureFunctionDy; 00086 void* dataPtr; 00087 private: 00088 Number (*fPtr)(const int x, const stdVector &pt, void* data); //function studied f 00089 Number (*dfPtr)(const int x, const stdVector &pt, const int dx, void* data); // df/dx 00090 Number (*ddfPtr)(const int x, const stdVector &pt, const int dx, 00091 const int dy, void* data); // d^2f/dxdy 00092 00093 00094 }; 00095 00096 } // namespace nltool 00097 00098 00099 #endif /* POINTERSYSTEM_H_ */