ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::movstat::workspace Class Reference

Workspace for moving window statistics. More...

#include <movstat.hpp>

Collaboration diagram for gsl::movstat::workspace:
Collaboration graph

Public Member Functions

 workspace ()
 The default constructor is only really useful for assigning to. More...
 
 workspace (size_t const K)
 The default constructor creates a new workspace with window length K. More...
 
 workspace (size_t const H, size_t const J)
 Creates a new workspace with H samples before current and J after current sample. More...
 
 workspace (gsl_movstat_workspace *v)
 Could construct from a gsl_movstat_workspace*. More...
 
 workspace (workspace const &v)
 The copy constructor. More...
 
workspaceoperator= (workspace const &v)
 The assignment operator. More...
 
 ~workspace ()
 The destructor only deletes the pointers if count reaches zero. More...
 
 workspace (workspace &&v)
 Move constructor. More...
 
workspaceoperator= (workspace &&v)
 Move operator. More...
 
bool operator== (workspace const &v) const
 Two workspace are identically equal if their elements are identical. More...
 
bool operator!= (workspace const &v) const
 Two workspace are different if their elements are not identical. More...
 
bool operator< (workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (workspace const &v) const
 A container needs to define an ordering for sorting. More...
 
bool empty () const
 Find if the workspace is empty. More...
 
void swap (workspace &v)
 Swap two workspace objects. More...
 
gsl_movstat_workspace * get () const
 Get the gsl_movstat_workspace. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_movstat_workspace. More...
 
size_t use_count () const
 Find how many workspace objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
int apply (end_t const endtype, movstat::function const &F, vector const &x, vector &y)
 C++ version of gsl_movstat_apply(). More...
 
int mean (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_mean(). More...
 
int variance (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_variance(). More...
 
int sd (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_sd(). More...
 
int median (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_median(). More...
 
int min (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_min(). More...
 
int max (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_max(). More...
 
int minmax (end_t const endtype, vector const &x, vector &y_min, vector &y_max)
 C++ version of gsl_movstat_minmax(). More...
 
int mad0 (end_t const endtype, vector const &x, vector &xmedian, vector &xmad)
 C++ version of gsl_movstat_mad0(). More...
 
int mad (end_t const endtype, vector const &x, vector &xmedian, vector &xmad)
 C++ version of gsl_movstat_mad(). More...
 
int qqr (end_t const endtype, vector const &x, double const q, vector &xqqr)
 C++ version of gsl_movstat_qqr(). More...
 
int Sn (end_t const endtype, vector const &x, vector &xscale)
 C++ version of gsl_movstat_Sn(). More...
 
int Qn (end_t const endtype, vector const &x, vector &xscale)
 C++ version of gsl_movstat_Qn(). More...
 
int sum (end_t const endtype, vector const &x, vector &y)
 C++ version of gsl_movstat_sum(). More...
 

Private Attributes

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

Detailed Description

Workspace for moving window statistics.

Definition at line 40 of file movstat.hpp.

Constructor & Destructor Documentation

◆ workspace() [1/6]

gsl::movstat::workspace::workspace ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 45 of file movstat.hpp.

References ccgsl_pointer, and count.

Referenced by operator=().

◆ workspace() [2/6]

gsl::movstat::workspace::workspace ( size_t const  K)
inlineexplicit

The default constructor creates a new workspace with window length K.

Parameters
KThe window length

Definition at line 53 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ workspace() [3/6]

gsl::movstat::workspace::workspace ( size_t const  H,
size_t const  J 
)
inline

Creates a new workspace with H samples before current and J after current sample.

Parameters
HSamples before current
JSamples after current

Definition at line 68 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ workspace() [4/6]

gsl::movstat::workspace::workspace ( gsl_movstat_workspace *  v)
inlineexplicit

Could construct from a gsl_movstat_workspace*.

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

Parameters
vThe workspace

Definition at line 104 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ workspace() [5/6]

gsl::movstat::workspace::workspace ( workspace const &  v)
inline

The copy constructor.

This creates a new reference to the workspace.

Parameters
vThe workspace to copy.

Definition at line 115 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ ~workspace()

gsl::movstat::workspace::~workspace ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 135 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ workspace() [6/6]

gsl::movstat::workspace::workspace ( workspace &&  v)
inline

Move constructor.

Parameters
vThe workspace to move.

Definition at line 147 of file movstat.hpp.

References count.

Member Function Documentation

◆ apply()

int gsl::movstat::workspace::apply ( end_t const  endtype,
movstat::function const &  F,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_apply().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
FA function
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 311 of file movstat.hpp.

References gsl::sf::ellint::F(), gsl::vector::get(), and get().

◆ empty()

bool gsl::movstat::workspace::empty ( ) const
inline

Find if the workspace is empty.

Returns
true if has size zero; otherwise false

Definition at line 224 of file movstat.hpp.

References ccgsl_pointer.

◆ get()

◆ mad()

int gsl::movstat::workspace::mad ( end_t const  endtype,
vector const &  x,
vector xmedian,
vector xmad 
)
inline

C++ version of gsl_movstat_mad().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
xmedianinput vector
xmadoutput vector
Returns
Error code on failures

Definition at line 398 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ mad0()

int gsl::movstat::workspace::mad0 ( end_t const  endtype,
vector const &  x,
vector xmedian,
vector xmad 
)
inline

C++ version of gsl_movstat_mad0().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
xmedianinput vector
xmadoutput vector
Returns
Error code on failures

Definition at line 387 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ max()

int gsl::movstat::workspace::max ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_max().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 366 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ mean()

int gsl::movstat::workspace::mean ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_mean().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 321 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ median()

int gsl::movstat::workspace::median ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_median().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 348 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ min()

int gsl::movstat::workspace::min ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_min().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 357 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ minmax()

int gsl::movstat::workspace::minmax ( end_t const  endtype,
vector const &  x,
vector y_min,
vector y_max 
)
inline

C++ version of gsl_movstat_minmax().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
y_minoutput vector for minimum
y_maxoutput vector for maximum
Returns
Error code on failures

Definition at line 376 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ operator bool()

gsl::movstat::workspace::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

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

Definition at line 270 of file movstat.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::movstat::workspace::operator!= ( workspace const &  v) const
inline

Two workspace are different if their elements are not identical.

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

Definition at line 177 of file movstat.hpp.

References operator==().

◆ operator<()

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

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

Definition at line 189 of file movstat.hpp.

References ccgsl_pointer.

◆ operator<=()

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

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

Definition at line 209 of file movstat.hpp.

References ccgsl_pointer.

◆ operator=() [1/2]

workspace & gsl::movstat::workspace::operator= ( workspace &&  v)
inline

Move operator.

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

Definition at line 156 of file movstat.hpp.

References workspace().

◆ operator=() [2/2]

workspace & gsl::movstat::workspace::operator= ( workspace const &  v)
inline

The assignment operator.

This copies elementwise.

Parameters
vThe workspace to copy

Definition at line 122 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ operator==()

bool gsl::movstat::workspace::operator== ( workspace const &  v) const
inline

Two workspace are identically equal if their elements are identical.

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

Definition at line 169 of file movstat.hpp.

References ccgsl_pointer.

Referenced by operator!=().

◆ operator>()

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

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

Definition at line 199 of file movstat.hpp.

References ccgsl_pointer.

◆ operator>=()

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

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

Definition at line 219 of file movstat.hpp.

References ccgsl_pointer.

◆ Qn()

int gsl::movstat::workspace::Qn ( end_t const  endtype,
vector const &  x,
vector xscale 
)
inline

C++ version of gsl_movstat_Qn().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
xscaleoutput vector
Returns
Error code on failures

Definition at line 428 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ qqr()

int gsl::movstat::workspace::qqr ( end_t const  endtype,
vector const &  x,
double const  q,
vector xqqr 
)
inline

C++ version of gsl_movstat_qqr().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
qquantile parameter in (0,0.5]
xqqroutput vector
Returns
Error code on failures

Definition at line 409 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ sd()

int gsl::movstat::workspace::sd ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_sd().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 339 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ Sn()

int gsl::movstat::workspace::Sn ( end_t const  endtype,
vector const &  x,
vector xscale 
)
inline

C++ version of gsl_movstat_Sn().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
xscaleoutput vector
Returns
Error code on failures

Definition at line 419 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ sum()

int gsl::movstat::workspace::sum ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_sum().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 437 of file movstat.hpp.

References gsl::vector::get(), and get().

◆ swap()

void gsl::movstat::workspace::swap ( workspace v)
inline

Swap two workspace objects.

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

Parameters
vThe workspace to swap with this.

Definition at line 231 of file movstat.hpp.

References ccgsl_pointer, and count.

◆ unique()

bool gsl::movstat::workspace::unique ( ) const
inline

Find if this is the only object sharing the gsl_movstat_workspace.

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

Definition at line 256 of file movstat.hpp.

References count.

◆ use_count()

size_t gsl::movstat::workspace::use_count ( ) const
inline

Find how many workspace objects share this pointer.

Returns
the number of workspace objects that share this pointer.

Definition at line 261 of file movstat.hpp.

References count.

◆ variance()

int gsl::movstat::workspace::variance ( end_t const  endtype,
vector const &  x,
vector y 
)
inline

C++ version of gsl_movstat_variance().

Parameters
endtypePADZERO, PADVALUE or TRUNCATE
xinput vector
youtput vector
Returns
Error code on failures

Definition at line 330 of file movstat.hpp.

References gsl::vector::get(), and get().

Member Data Documentation

◆ ccgsl_pointer

gsl_movstat_workspace* gsl::movstat::workspace::ccgsl_pointer
private

The shared pointer.

Definition at line 239 of file movstat.hpp.

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

◆ count

size_t* gsl::movstat::workspace::count
private

The shared reference count.

Definition at line 243 of file movstat.hpp.

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


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