libnum:classes:index
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| libnum:classes:index [2026/03/04 15:24] – abc | libnum:classes:index [2026/03/04 15:43] (current) – abc | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| namespace NumericMethods | namespace NumericMethods | ||
| - | * [[gear|Integration of Linear differential equations. | + | * [[gear|Gear |
| - | See: '' | ||
| - | |||
| - | class [[# | ||
| - | class [[# | ||
| - | struct [[# | ||
| - | class [[# | ||
| - | class [[# | ||
| - | typedef DoubleParamsMap [[# | ||
| - | class [[# | ||
| - | class [[# | ||
| - | |||
| - | ===== Gear ===== | ||
| - | class Gear | ||
| - | { | ||
| - | | ||
| - | Gear(); | ||
| - | | ||
| - | void set(int n, GearUserProc* derFunc, GearUserProc* jacFunc); | ||
| - | void setCallback(GearEngineCallback& | ||
| - | Message solve(const double t_begin, const double t_end, const double* y0); | ||
| - | GearEngineContext engineContext; | ||
| - | GearAssistant assistant; | ||
| - | }; | ||
| - | |||
| - | The ' | ||
| - | to calculate the derivative function values and DY, the Jacobian. | ||
| - | |||
| - | The Gear object has its private Allocator which provides memory to consecutive runs of | ||
| - | ' | ||
| - | |||
| - | The rest settings and user interactions are done via GearAssistance object, the public | ||
| - | property of the Gear object. E.g. ' | ||
| - | |||
| - | ===== GearUserProc ===== | ||
| - | The Base class of procedures to calculate //y'= ∂y/∂t// and //jacobian = Dy'/ | ||
| - | May be used as the default, being the wrapper of ordinary C-functions | ||
| - | // | ||
| - | |||
| - | class GearUserProc { | ||
| - | | ||
| - | typedef bool(*PUDF)(int, | ||
| - | GearUserProc(PUDF = nullptr); | ||
| - | //virtual bool operator()(int n, double x, const double y[], double result[]); | ||
| - | virtual bool call(int n, double x, const double y[], double result[]); | ||
| - | }; | ||
| - | |||
| - | ===== GearEngineContext ===== | ||
| - | Read-only references to member variables of the Gear object. | ||
| - | |||
| - | struct GearEngineContext | ||
| - | { | ||
| - | const int& | ||
| - | const int& | ||
| - | const double& h; // current step of integration | ||
| - | const double& t; // current time | ||
| - | const double* const& Z; // values (ref to Z[]) | ||
| - | }; | ||
| - | ===== GearEngineCallback ===== | ||
| - | The hook/ | ||
| - | |||
| - | class GearEngineCallback | ||
| - | { | ||
| - | | ||
| - | virtual bool call(const GearEngineContext& | ||
| - | return true; // return ' | ||
| - | } | ||
| - | }; | ||
| - | |||
| - | class GearEngineCallbackEmbed : public GearEngineCallback | ||
| - | { | ||
| - | | ||
| - | typedef bool (*PCallback)(const GearEngineContext& | ||
| - | GearEngineCallbackEmbed(PCallback = nullptr); // nullptr -- no output in solve() | ||
| - | virtual bool call(const GearEngineContext& | ||
| - | }; | ||
| - | |||
| - | ===== GearAssistant ===== | ||
| - | class GearAssistant | ||
| - | { | ||
| - | | ||
| - | GearParams | ||
| - | GearStatistics statistics; | ||
| - | }; | ||
| - | |||
| - | ===== GearAllocator ===== | ||
| - | class GearAllocator | ||
| - | { | ||
| - | | ||
| - | GearAllocator(Gear& | ||
| - | ~GearAllocator(); | ||
| - | bool allocateMemory(int task_dimension); | ||
| - | }; | ||
| - | |||
| - | ===== GearParams ===== | ||
| - | class DoubleParamsMap | ||
| - | { | ||
| - | | ||
| - | DoubleParamsMap() : params() {} | ||
| - | bool declareParameter(const char* name, double value=0); | ||
| - | bool setParameter(ParamID id, double value); | ||
| - | double getParameter(ParamID id) const; | ||
| - | std::string getParameterNames() const; | ||
| - | | ||
| - | std:: | ||
| - | }; | ||
| - | |||
| - | // | ||
| - | EPS = 0.01; | ||
| - | HINI = 1e-10; | ||
| - | HMIN = 1e-18; | ||
| - | HMAX = BIG_VAL; | ||
| - | RHMAX = 1; | ||
| - | See Gear Algorithm for details. | ||
libnum/classes/index.1772627071.txt.gz · Last modified: by abc
