ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::interp::accel Class Reference

Workspace for acceleration. More...

#include <interp.hpp>

Collaboration diagram for gsl::interp::accel:
Collaboration graph

Public Member Functions

 accel ()
 The default constructor creates a new accel. More...
 
 accel (gsl_interp_accel *v)
 Could construct from a gsl_interp_accel. More...
 
 accel (accel const &v)
 The copy constructor. More...
 
acceloperator= (accel const &v)
 The assignment operator. More...
 
 ~accel ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 accel (accel &&v)
 Move constructor. More...
 
acceloperator= (accel &&v)
 Move operator. More...
 
bool operator== (accel const &v) const
 Two accel are identically equal if their elements are identical. More...
 
bool operator!= (accel const &v) const
 Two accel are different if their elements are not identical. More...
 
bool operator< (accel const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (accel const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (accel const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (accel const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the accel is empty. More...
 
void swap (accel &v)
 Swap two accel objects. More...
 
gsl_interp_accel * get () const
 Get the gsl_interp_accel. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_interp_accel. More...
 
size_t use_count () const
 Find how many accel objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
int reset ()
 C++ version of gsl_interp_accel_reset(). More...
 
size_t find (double const xa[], size_t len, double x)
 C++ version of gsl_interp_accel_find(). More...
 
template<typename XA >
size_t find (XA const &xa, double x)
 C++ version of gsl_interp_accel_find(). More...
 

Private Attributes

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

Detailed Description

Workspace for acceleration.

Definition at line 237 of file interp.hpp.

Constructor & Destructor Documentation

◆ accel() [1/4]

gsl::interp::accel::accel ( )
inline

The default constructor creates a new accel.

Definition at line 244 of file interp.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ accel() [2/4]

gsl::interp::accel::accel ( gsl_interp_accel *  v)
inlineexplicit

Could construct from a gsl_interp_accel.

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

Parameters
vThe accel

Definition at line 260 of file interp.hpp.

References ccgsl_pointer, and count.

◆ accel() [3/4]

gsl::interp::accel::accel ( accel const &  v)
inline

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe accel to copy.

Definition at line 271 of file interp.hpp.

References ccgsl_pointer, and count.

◆ ~accel()

gsl::interp::accel::~accel ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 290 of file interp.hpp.

References ccgsl_pointer, and count.

◆ accel() [4/4]

gsl::interp::accel::accel ( accel &&  v)
inline

Move constructor.

Parameters
vThe accel to move.

Definition at line 302 of file interp.hpp.

References count.

Member Function Documentation

◆ empty()

bool gsl::interp::accel::empty ( ) const
inline

Find if the accel is empty.

Returns
true if has size zero; otherwise false

Definition at line 379 of file interp.hpp.

References ccgsl_pointer.

◆ find() [1/2]

size_t gsl::interp::accel::find ( double const  xa[],
size_t  len,
double  x 
)
inline

C++ version of gsl_interp_accel_find().

Parameters
xa[]an array
lenthe size of the array
xthe element to find
Returns
the index i such that x_array[i] <= x < x_array[i+1]

Definition at line 439 of file interp.hpp.

References get().

◆ find() [2/2]

template<typename XA >
size_t gsl::interp::accel::find ( XA const &  xa,
double  x 
)
inline

C++ version of gsl_interp_accel_find().

This version handles std::vector and gsl::vector.

Parameters
xaan array
xthe element to find
Returns
the index i such that x_array[i] <= x < x_array[i+1]

Definition at line 449 of file interp.hpp.

References get().

◆ get()

◆ operator bool()

gsl::interp::accel::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

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

Definition at line 425 of file interp.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::interp::accel::operator!= ( accel const &  v) const
inline

Two accel are different if their elements are not identical.

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

Definition at line 332 of file interp.hpp.

References operator==().

◆ operator<()

bool gsl::interp::accel::operator< ( accel 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 accel is nonnegative.

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

Definition at line 344 of file interp.hpp.

References ccgsl_pointer.

◆ operator<=()

bool gsl::interp::accel::operator<= ( accel 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 accel is nonnegative.

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

Definition at line 364 of file interp.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

accel & gsl::interp::accel::operator= ( accel &&  v)
inline

Move operator.

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

Definition at line 311 of file interp.hpp.

References accel().

◆ operator=() [2/2]

accel & gsl::interp::accel::operator= ( accel const &  v)
inline

The assignment operator.

This copies elementwise.

Parameters
vThe accel to copy

Definition at line 278 of file interp.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::interp::accel::operator== ( accel const &  v) const
inline

Two accel are identically equal if their elements are identical.

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

Definition at line 324 of file interp.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

bool gsl::interp::accel::operator> ( accel 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 accel is nonnegative.

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

Definition at line 354 of file interp.hpp.

References ccgsl_pointer.

◆ operator>=()

bool gsl::interp::accel::operator>= ( accel 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 accel is nonnegative.

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

Definition at line 374 of file interp.hpp.

References ccgsl_pointer.

◆ reset()

int gsl::interp::accel::reset ( )
inline

C++ version of gsl_interp_accel_reset().

Returns
Error code on failure

Definition at line 431 of file interp.hpp.

References get().

◆ swap()

void gsl::interp::accel::swap ( accel v)
inline

Swap two accel objects.

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

Parameters
vThe accel to swap with this.

Definition at line 386 of file interp.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::interp::accel::unique ( ) const
inline

Find if this is the only object sharing the gsl_interp_accel.

Returns
true or falses according as this is the only accel object sharing the gsl_interp_accel.

Definition at line 411 of file interp.hpp.

References count.

◆ use_count()

size_t gsl::interp::accel::use_count ( ) const
inline

Find how many accel objects share this pointer.

Returns
the number of accel objects that share this pointer.

Definition at line 416 of file interp.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

gsl_interp_accel* gsl::interp::accel::ccgsl_pointer
private

The shared pointer.

Definition at line 394 of file interp.hpp.

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

◆ count

size_t* gsl::interp::accel::count
private

The shared reference count.

Definition at line 398 of file interp.hpp.

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


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