ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::odeiv2::system Class Reference

Class that extends gsl_odeiv2_system so that it can be constructed from function objects. More...

#include <odeiv2_system.hpp>

Inheritance diagram for gsl::odeiv2::system:
Inheritance graph
Collaboration diagram for gsl::odeiv2::system:
Collaboration graph

Classes

struct  Concept
 This is an empty base class. More...
 

Public Member Functions

 system ()
 The default constructor is only really useful for assigning to. More...
 
 system (gsl_odeiv2_system &v)
 Could construct from a gsl_odeiv2_system object. More...
 
template<typename T >
 system (T &t)
 Construct from an object that implements gsl::odeiv2::system::Concept. More...
 
 system (system const &v)
 The copy constructor. More...
 
systemoperator= (system const &v)
 The assignment operator. More...
 
 system (system &&v)
 Move constructor. More...
 
systemoperator= (system &&v)
 Move operator. More...
 
 ~system ()
 The destructor unshares any shared resource. More...
 

Public Attributes

base_F * f
 This gives something for params to point to. More...
 
size_t * count
 The shared reference count: used for copying this. More...
 

Friends

template<typename T >
void system_constructor (system &sys, T &t)
 

Detailed Description

Class that extends gsl_odeiv2_system so that it can be constructed from function objects.

Since gsl::odeiv2::system is a subclass of gsl_odeiv2_system, a pointer to an object of this class can be used whenever a pointer to a gsl_odeiv2_system object is required. Thus, pointers to objects of this class can be used directly with the GNU Scientific Library.

You can construct a gsl::odeiv2::system object from function objects. If the function object is not already implemented, implementing it as a subclass T of gsl::odeiv2::system::Concept will make it easy to construct using gsl::odeiv2::system<T>(). If the function object uses a single class T that cannot readily be modified, try something like

class System : public gsl::odeiv2::system::Concept {
public:
System( T& t ) : t( t );
int function( double t, gsl::vector const& y, gsl::vector& dydt ){ ... }
int jacobian( double t, gsl::vector const& y, gsl::matrix& dfdy, gsl::vector& dfdt ){ ... }
private:
T& t;
};
...
System system( t );
This class handles matrix objects as shared handles.
Definition: matrix.hpp:72
Class that extends gsl_odeiv2_system so that it can be constructed from function objects.
system()
The default constructor is only really useful for assigning to.
This class handles vector objects as shared handles.
Definition: vector.hpp:74
This is an empty base class.

You can use similar constructions if function and jacobian are defined in different classes.

This class is designed for flexibility rather than efficient copying. So if objects are to be copied frequently, consider using shared pointers or the like. Moving is defined for C++11.

Definition at line 66 of file odeiv2_system.hpp.

Constructor & Destructor Documentation

◆ system() [1/5]

gsl::odeiv2::system::system ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 436 of file odeiv2_system.hpp.

References count, and f.

◆ system() [2/5]

gsl::odeiv2::system::system ( gsl_odeiv2_system &  v)
inlineexplicit

Could construct from a gsl_odeiv2_system object.

This constuctor is not actually visible, but gsl::odeiv2::system::system<T>() will construct the object correctly.

Parameters
vThe gsl_odeiv2_system.

Definition at line 451 of file odeiv2_system.hpp.

References count, and f.

◆ system() [3/5]

template<typename T >
gsl::odeiv2::system::system ( T &  t)
inline

Construct from an object that implements gsl::odeiv2::system::Concept.

Parameters
tAn object that implements gsl::odeiv2::system::Concept.

Definition at line 468 of file odeiv2_system.hpp.

◆ system() [4/5]

gsl::odeiv2::system::system ( system const &  v)
inline

The copy constructor.

This shares f. This constuctor is not actually visible, but gsl::odeiv2::system::system<T>() will construct the object correctly.

Parameters
vThe system to copy.

Definition at line 478 of file odeiv2_system.hpp.

References count.

◆ system() [5/5]

gsl::odeiv2::system::system ( system &&  v)
inline

Move constructor.

Parameters
vThe system to move.

Definition at line 511 of file odeiv2_system.hpp.

References count.

◆ ~system()

gsl::odeiv2::system::~system ( )
inline

The destructor unshares any shared resource.

Definition at line 537 of file odeiv2_system.hpp.

References count, and f.

Member Function Documentation

◆ operator=() [1/2]

system & gsl::odeiv2::system::operator= ( system &&  v)
inline

Move operator.

Parameters
vThe system to move.
Returns
A reference to f in this.

Definition at line 524 of file odeiv2_system.hpp.

References count, and f.

◆ operator=() [2/2]

system & gsl::odeiv2::system::operator= ( system const &  v)
inline

The assignment operator.

This makes a shared copy.

Parameters
vThe system to copy

Definition at line 490 of file odeiv2_system.hpp.

References count, and f.

Friends And Related Function Documentation

◆ system_constructor

template<typename T >
void system_constructor ( system sys,
T &  t 
)
friend

Member Data Documentation

◆ count

size_t* gsl::odeiv2::system::count

The shared reference count: used for copying this.

Definition at line 431 of file odeiv2_system.hpp.

Referenced by operator=(), system(), and ~system().

◆ f

base_F* gsl::odeiv2::system::f

This gives something for params to point to.

Definition at line 427 of file odeiv2_system.hpp.

Referenced by operator=(), system(), and ~system().


The documentation for this class was generated from the following file: