User Tools

Site Tools


libnum:classes:index

This is an old revision of the document!


Libnum Classes

namespace NumericMethods

class Gear;
class GearUserProc;
struct GearEngineContext;
class GearEngineCallback;
class GearAssistant;
typedef DoubleParamsMap GearParams;
class GearStatistics;
class GearAllocator;

Gear

class Gear
{
 public:
  Gear();
 ~Gear();
  void set(int n, GearUserProc* derFunc, GearUserProc* jacFunc);
  void setCallback(GearEngineCallback& f) { callback = &f;}
  Message solve(const double t_begin, const double t_end, const double* y0);
  GearEngineContext engineContext;
  GearAssistant assistant;
};

The 'set' method of Gear objects defines the dimension, starting Y values and functions to calculate the derivative function values and DY, the Jacobian.

The Gear object has its private Allocator which provides memory to consecutive runs of 'solve' procedure.

The rest settings and user interactions are done via GearAssistance object, the public property of the Gear object. E.g. 'parameters', 'statistics'.

GearUserProc

GearEngineContext

GearEngineCallback

class GearEngineCallback   // hook/callback object in Gear::solve()
{
 public:
  virtual bool call(const GearEngineContext&) {
    return true;  // return 'false' to cancel caller proc
  }
};

GearAssistant

class GearAssistant
{
 public:
  GearParams     params;
  GearStatistics statistics;
};

GearAllocator

class GearAllocator
{
 public:
  GearAllocator(Gear& owner);
  ~GearAllocator();
  bool allocateMemory(int task_dimension);
};
libnum/classes/index.1772617431.txt.gz · Last modified: by abc