ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::rstat::quantile_workspace Class Reference

Workspace for quantile running statistics. More...

#include <rstat.hpp>

Collaboration diagram for gsl::rstat::quantile_workspace:
Collaboration graph

Public Member Functions

 quantile_workspace ()
 The default constructor is only really useful for assigning to. More...
 
 quantile_workspace (double const p)
 The default constructor creates a new quantile_workspace. More...
 
 quantile_workspace (gsl_rstat_quantile_workspace *v)
 Could construct from a gsl_rstat_quantile_workspace*. More...
 
 quantile_workspace (quantile_workspace const &v)
 The copy constructor. More...
 
quantile_workspaceoperator= (quantile_workspace const &v)
 The assignment operator. More...
 
 ~quantile_workspace ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 quantile_workspace (quantile_workspace &&v)
 Move constructor. More...
 
quantile_workspaceoperator= (quantile_workspace &&v)
 Move operator. More...
 
bool operator== (quantile_workspace const &v) const
 Two quantile_workspace are identically equal if their elements are identical. More...
 
bool operator!= (quantile_workspace const &v) const
 Two quantile_workspace are different if their elements are not identical. More...
 
bool operator< (quantile_workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (quantile_workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (quantile_workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (quantile_workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the quantile_workspace is empty. More...
 
void swap (quantile_workspace &v)
 Swap two quantile_workspace objects. More...
 
gsl_rstat_quantile_workspace * get () const
 Get the gsl_rstat_quantile_workspace. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_rstat_quantile_workspace. More...
 
size_t use_count () const
 Find how many quantile_workspace objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
int reset ()
 C++ version of gsl_rstat_quantile_reset(). More...
 
int add (double const x)
 C++ version of gsl_rstat_quantile_add(). More...
 
double get_value ()
 C++ version of gsl_rstat_quantile_get(). More...
 

Private Attributes

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

Detailed Description

Workspace for quantile running statistics.

Definition at line 377 of file rstat.hpp.

Constructor & Destructor Documentation

◆ quantile_workspace() [1/5]

gsl::rstat::quantile_workspace::quantile_workspace ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 382 of file rstat.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ quantile_workspace() [2/5]

gsl::rstat::quantile_workspace::quantile_workspace ( double const  p)
inlineexplicit

The default constructor creates a new quantile_workspace.

Parameters
pQuantile parameter in (0,1)

Definition at line 390 of file rstat.hpp.

References ccgsl_pointer, and count.

◆ quantile_workspace() [3/5]

gsl::rstat::quantile_workspace::quantile_workspace ( gsl_rstat_quantile_workspace *  v)
inlineexplicit

Could construct from a gsl_rstat_quantile_workspace*.

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

Parameters
vThe quantile_workspace

Definition at line 406 of file rstat.hpp.

References ccgsl_pointer, and count.

◆ quantile_workspace() [4/5]

gsl::rstat::quantile_workspace::quantile_workspace ( quantile_workspace const &  v)
inline

The copy constructor.

This creates a new reference to the quantile_workspace.

Parameters
vThe quantile_workspace to copy.

Definition at line 417 of file rstat.hpp.

References ccgsl_pointer, and count.

◆ ~quantile_workspace()

gsl::rstat::quantile_workspace::~quantile_workspace ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 437 of file rstat.hpp.

References ccgsl_pointer, and count.

◆ quantile_workspace() [5/5]

gsl::rstat::quantile_workspace::quantile_workspace ( quantile_workspace &&  v)
inline

Move constructor.

Parameters
vThe quantile_workspace to move.

Definition at line 449 of file rstat.hpp.

References count.

Member Function Documentation

◆ add()

int gsl::rstat::quantile_workspace::add ( double const  x)
inline

C++ version of gsl_rstat_quantile_add().

Parameters
xA new data point
Returns
Error code on failure

Definition at line 593 of file rstat.hpp.

References get().

◆ empty()

bool gsl::rstat::quantile_workspace::empty ( ) const
inline

Find if the quantile_workspace is empty.

Returns
true if has size zero; otherwise false

Definition at line 532 of file rstat.hpp.

References ccgsl_pointer.

◆ get()

gsl_rstat_quantile_workspace * gsl::rstat::quantile_workspace::get ( ) const
inline

Get the gsl_rstat_quantile_workspace.

Returns
the gsl_rstat_quantile_workspace

Definition at line 559 of file rstat.hpp.

References ccgsl_pointer.

Referenced by add(), gsl::rstat::quantile::add(), gsl::rstat::quantile::get(), get_value(), reset(), and gsl::rstat::quantile::reset().

◆ get_value()

double gsl::rstat::quantile_workspace::get_value ( )
inline

C++ version of gsl_rstat_quantile_get().

Returns
The current estimate of the quantile

Definition at line 599 of file rstat.hpp.

References get().

◆ operator bool()

gsl::rstat::quantile_workspace::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

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

Definition at line 579 of file rstat.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::rstat::quantile_workspace::operator!= ( quantile_workspace const &  v) const
inline

Two quantile_workspace are different if their elements are not identical.

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

Definition at line 481 of file rstat.hpp.

References operator==().

◆ operator<()

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

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

Definition at line 493 of file rstat.hpp.

References ccgsl_pointer.

◆ operator<=()

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

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

Definition at line 515 of file rstat.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

quantile_workspace & gsl::rstat::quantile_workspace::operator= ( quantile_workspace &&  v)
inline

Move operator.

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

Definition at line 459 of file rstat.hpp.

References quantile_workspace().

◆ operator=() [2/2]

quantile_workspace & gsl::rstat::quantile_workspace::operator= ( quantile_workspace const &  v)
inline

The assignment operator.

This copies elementwise.

Parameters
vThe quantile_workspace to copy

Definition at line 424 of file rstat.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::rstat::quantile_workspace::operator== ( quantile_workspace const &  v) const
inline

Two quantile_workspace are identically equal if their elements are identical.

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

Definition at line 472 of file rstat.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

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

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

Definition at line 504 of file rstat.hpp.

References ccgsl_pointer.

◆ operator>=()

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

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

Definition at line 526 of file rstat.hpp.

References ccgsl_pointer.

◆ reset()

int gsl::rstat::quantile_workspace::reset ( )
inline

C++ version of gsl_rstat_quantile_reset().

Returns
Error code on failure

Definition at line 586 of file rstat.hpp.

References get().

◆ swap()

void gsl::rstat::quantile_workspace::swap ( quantile_workspace v)
inline

Swap two quantile_workspace objects.

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

Parameters
vThe quantile_workspace to swap with this.

Definition at line 540 of file rstat.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::rstat::quantile_workspace::unique ( ) const
inline

Find if this is the only object sharing the gsl_rstat_quantile_workspace.

Returns
true or falses according as this is the only quantile_workspace object sharing the gsl_rstat_quantile_workspace.

Definition at line 565 of file rstat.hpp.

References count.

◆ use_count()

size_t gsl::rstat::quantile_workspace::use_count ( ) const
inline

Find how many quantile_workspace objects share this pointer.

Returns
the number of quantile_workspace objects that share this pointer.

Definition at line 570 of file rstat.hpp.

References count.

Member Data Documentation

◆ ccgsl_pointer

gsl_rstat_quantile_workspace* gsl::rstat::quantile_workspace::ccgsl_pointer
private

◆ count

size_t* gsl::rstat::quantile_workspace::count
private

The shared reference count.

Definition at line 552 of file rstat.hpp.

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


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