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

Stepping functions. More...

#include <odeiv2.hpp>

Collaboration diagram for gsl::odeiv2::step:
Collaboration graph

Public Types

typedef gsl_odeiv2_step_type type
 Convenience typedef. More...
 

Public Member Functions

 step ()
 The default constructor is only really useful for assigning to. More...
 
 step (step::type const *T, size_t dim)
 The standard constructor creates a new step of type T and dimensions dim. More...
 
 step (gsl_odeiv2_step *v)
 Could construct from a gsl_odeiv2_step. More...
 
 step (step const &v)
 The copy constructor. More...
 
stepoperator= (step const &v)
 The assignment operator. More...
 
 ~step ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 step (step &&v)
 Move constructor. More...
 
stepoperator= (step &&v)
 Move operator. More...
 
bool operator== (step const &v) const
 Two step are identically equal if their elements are identical. More...
 
bool operator!= (step const &v) const
 Two step are different if their elements are not identical. More...
 
bool operator< (step const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (step const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (step const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (step const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the step is empty. More...
 
void swap (step &v)
 Swap two step objects. More...
 
gsl_odeiv2_step * get () const
 Get the gsl_odeiv2_step. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_odeiv2_step. More...
 
size_t use_count () const
 Find how many step objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
int reset ()
 C++ version of gsl_odeiv2_step_reset(). More...
 
char const * name () const
 C++ version of gsl_odeiv2_step_name(). More...
 
unsigned int order ()
 C++ version of gsl_odeiv2_step_order(). More...
 
template<typename Y , typename YERR , typename DYDT_IN , typename DYDT_OUT >
int apply (double t, double h, Y &y, YERR &yerr, DYDT_IN const &dydt_in, DYDT_OUT dydt_out, system const &sys)
 C++ version of gsl_odeiv2_step_apply(). More...
 
int set_driver (driver const &d)
 C++ version of gsl_odeiv2_step_set_driver(). More...
 

Static Public Member Functions

static type const * rk2 ()
 Static type. More...
 
static type const * rk4 ()
 Static type. More...
 
static type const * rkf45 ()
 Static type. More...
 
static type const * rkck ()
 Static type. More...
 
static type const * rk8pd ()
 Static type. More...
 
static type const * rk2imp ()
 Static type. More...
 
static type const * rk4imp ()
 Static type. More...
 
static type const * bsimp ()
 Static type. More...
 
static type const * rk1imp ()
 Static type. More...
 
static type const * msadams ()
 Static type. More...
 
static type const * msbdf ()
 Static type. More...
 

Private Attributes

gsl_odeiv2_step * ccgsl_pointer
 The shared pointer. More...
 
size_t * count
 The shared reference count. More...
 

Detailed Description

Stepping functions.

These advance a solution from time \(t\) to time \(t+h\) for a fixed step size \(h\). They also estimate the local error.

Definition at line 38 of file odeiv2.hpp.

Member Typedef Documentation

◆ type

typedef gsl_odeiv2_step_type gsl::odeiv2::step::type

Convenience typedef.

Definition at line 43 of file odeiv2.hpp.

Constructor & Destructor Documentation

◆ step() [1/5]

gsl::odeiv2::step::step ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 47 of file odeiv2.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ step() [2/5]

gsl::odeiv2::step::step ( step::type const *  T,
size_t  dim 
)
inline

The standard constructor creates a new step of type T and dimensions dim.

Parameters
TThe type
dimThe number of dimensions

Definition at line 58 of file odeiv2.hpp.

References ccgsl_pointer, and count.

◆ step() [3/5]

gsl::odeiv2::step::step ( gsl_odeiv2_step *  v)
inlineexplicit

Could construct from a gsl_odeiv2_step.

This is not usually a good idea. In this case we should not use gsl_odeiv2_step_free() to deallocate the memory.

Parameters
vThe step

Definition at line 74 of file odeiv2.hpp.

References ccgsl_pointer, and count.

◆ step() [4/5]

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

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe step to copy.

Definition at line 85 of file odeiv2.hpp.

References ccgsl_pointer, and count.

◆ ~step()

gsl::odeiv2::step::~step ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 104 of file odeiv2.hpp.

References ccgsl_pointer, and count.

◆ step() [5/5]

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

Move constructor.

Parameters
vThe step to move.

Definition at line 116 of file odeiv2.hpp.

References count.

Member Function Documentation

◆ apply()

template<typename Y , typename YERR , typename DYDT_IN , typename DYDT_OUT >
int gsl::odeiv2::step::apply ( double  t,
double  h,
Y &  y,
YERR &  yerr,
DYDT_IN const &  dydt_in,
DYDT_OUT  dydt_out,
system const &  sys 
)
inline

C++ version of gsl_odeiv2_step_apply().

This version works with gsl::vector (or std::vector<double>) objects.

Parameters
tCurrent time
hStep size
yCurrent state
yerrAbsolute error value (return value)
dydt_inArray of derivatives at time t (not null)
dydt_outArray of derivatives at time t+h (not null)
sysThe odeiv::system
Returns
Error code on failure

Definition at line 339 of file odeiv2.hpp.

References get().

◆ bsimp()

static type const * gsl::odeiv2::step::bsimp ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 390 of file odeiv2.hpp.

◆ empty()

bool gsl::odeiv2::step::empty ( ) const
inline

Find if the step is empty.

Returns
true if has size zero; otherwise false

Definition at line 193 of file odeiv2.hpp.

References ccgsl_pointer.

◆ get()

gsl_odeiv2_step * gsl::odeiv2::step::get ( ) const
inline

Get the gsl_odeiv2_step.

Returns
the gsl_odeiv2_step

Definition at line 219 of file odeiv2.hpp.

References ccgsl_pointer.

Referenced by gsl::odeiv2::evolve::apply(), apply(), gsl::odeiv2::evolve::apply_fixed_step(), gsl::odeiv2::control::hadjust(), name(), order(), reset(), and set_driver().

◆ msadams()

static type const * gsl::odeiv2::step::msadams ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 400 of file odeiv2.hpp.

◆ msbdf()

static type const * gsl::odeiv2::step::msbdf ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 405 of file odeiv2.hpp.

◆ name()

char const * gsl::odeiv2::step::name ( ) const
inline

C++ version of gsl_odeiv2_step_name().

Returns
The name of the step type

Definition at line 251 of file odeiv2.hpp.

References get().

◆ operator bool()

gsl::odeiv2::step::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

Returns
true or false according as this contains a pointer to a gsl_odeiv2_step.

Definition at line 239 of file odeiv2.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::odeiv2::step::operator!= ( step const &  v) const
inline

Two step are different if their elements are not identical.

Parameters
vThe step to be compared with this
Returns
false or true according as this and v have identical elements or not

Definition at line 146 of file odeiv2.hpp.

References operator==().

◆ operator<()

bool gsl::odeiv2::step::operator< ( step const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a step is nonnegative.

Parameters
vThe step to be compared with this
Returns
false or true according as this is less than v lexicographically

Definition at line 158 of file odeiv2.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::odeiv2::step::operator<= ( step const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a step is nonnegative.

Parameters
vThe step to be compared with this
Returns
false or true according as this is less than or equal to v lexicographically

Definition at line 178 of file odeiv2.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

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

Move operator.

Parameters
vThe step to move.
Returns
A reference to this.

Definition at line 125 of file odeiv2.hpp.

References step().

◆ operator=() [2/2]

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

The assignment operator.

This copies elementwise.

Parameters
vThe step to copy

Definition at line 92 of file odeiv2.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::odeiv2::step::operator== ( step const &  v) const
inline

Two step are identically equal if their elements are identical.

Parameters
vThe step to be compared with this
Returns
true or false according as this and v have identical elements or not

Definition at line 138 of file odeiv2.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

bool gsl::odeiv2::step::operator> ( step const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a step is nonnegative.

Parameters
vThe step to be compared with this
Returns
false or true according as this is greater than v lexicographically

Definition at line 168 of file odeiv2.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::odeiv2::step::operator>= ( step const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a step is nonnegative.

Parameters
vThe step to be compared with this
Returns
false or true according as this is no less than v lexicographically

Definition at line 188 of file odeiv2.hpp.

References ccgsl_pointer.

◆ order()

unsigned int gsl::odeiv2::step::order ( )
inline

C++ version of gsl_odeiv2_step_order().

Returns
The order of the stepping function

Definition at line 256 of file odeiv2.hpp.

References get().

◆ reset()

int gsl::odeiv2::step::reset ( )
inline

C++ version of gsl_odeiv2_step_reset().

Returns
Error code on failure

Definition at line 246 of file odeiv2.hpp.

References get().

◆ rk1imp()

static type const * gsl::odeiv2::step::rk1imp ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 395 of file odeiv2.hpp.

◆ rk2()

static type const * gsl::odeiv2::step::rk2 ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 355 of file odeiv2.hpp.

◆ rk2imp()

static type const * gsl::odeiv2::step::rk2imp ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 380 of file odeiv2.hpp.

◆ rk4()

static type const * gsl::odeiv2::step::rk4 ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 360 of file odeiv2.hpp.

◆ rk4imp()

static type const * gsl::odeiv2::step::rk4imp ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 385 of file odeiv2.hpp.

◆ rk8pd()

static type const * gsl::odeiv2::step::rk8pd ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 375 of file odeiv2.hpp.

◆ rkck()

static type const * gsl::odeiv2::step::rkck ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 370 of file odeiv2.hpp.

◆ rkf45()

static type const * gsl::odeiv2::step::rkf45 ( )
inlinestatic

Static type.

Returns
the named step type

Definition at line 365 of file odeiv2.hpp.

◆ set_driver()

int gsl::odeiv2::step::set_driver ( driver const &  d)
inline

C++ version of gsl_odeiv2_step_set_driver().

Parameters
dThe driver
Returns
Error code on failure

Definition at line 1406 of file odeiv2.hpp.

References get(), and gsl::odeiv2::driver::get().

◆ swap()

void gsl::odeiv2::step::swap ( step v)
inline

Swap two step objects.

This works even if the step have different sizes because it swaps pointers.

Parameters
vThe step to swap with this.

Definition at line 200 of file odeiv2.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::odeiv2::step::unique ( ) const
inline

Find if this is the only object sharing the gsl_odeiv2_step.

Returns
true or falses according as this is the only workspace object sharing the gsl_odeiv2_step.

Definition at line 225 of file odeiv2.hpp.

References count.

◆ use_count()

size_t gsl::odeiv2::step::use_count ( ) const
inline

Find how many step objects share this pointer.

Returns
the number of workspace objects that share this pointer.

Definition at line 230 of file odeiv2.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

gsl_odeiv2_step* gsl::odeiv2::step::ccgsl_pointer
private

The shared pointer.

Definition at line 208 of file odeiv2.hpp.

Referenced by empty(), get(), operator bool(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), step(), swap(), and ~step().

◆ count

size_t* gsl::odeiv2::step::count
private

The shared reference count.

Definition at line 212 of file odeiv2.hpp.

Referenced by operator=(), step(), swap(), unique(), use_count(), and ~step().


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