24#include<gsl/gsl_rstat.h>
43 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
94#ifdef __GXX_EXPERIMENTAL_CXX0X__
100 std::swap(
count, v.count );
101 v.ccgsl_pointer =
nullptr;
109 workspace( std::move( v ) ).swap( *
this );
219#ifdef __GXX_EXPERIMENTAL_CXX0X__
229 size_t n()
const {
return gsl_rstat_n(
get() ); }
235 int add(
double const x ){
return gsl_rstat_add( x,
get() ); }
240 double min()
const {
return gsl_rstat_min(
get() ); }
246 max()
const {
return gsl_rstat_max(
get() ); }
251 double mean()
const {
return gsl_rstat_mean(
get() ); }
261 double sd()
const {
return gsl_rstat_sd(
get() ); }
266 double rms()
const {
return gsl_rstat_rms(
get() ); }
271 double sd_mean()
const {
return gsl_rstat_sd_mean(
get() ); }
276 double median()
const {
return gsl_rstat_median(
get() ); }
281 double skew()
const {
return gsl_rstat_skew(
get() ); }
393 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
444#ifdef __GXX_EXPERIMENTAL_CXX0X__
451 std::swap(
count, v.count );
452 v.ccgsl_pointer =
nullptr;
576#ifdef __GXX_EXPERIMENTAL_CXX0X__
587 return gsl_rstat_quantile_reset(
get() ); }
593 int add(
double const x ){
594 return gsl_rstat_quantile_add( x,
get() ); }
600 return gsl_rstat_quantile_get(
get() ); }
612 return gsl_rstat_quantile_reset( w.
get() ); }
620 return gsl_rstat_quantile_add( x, w.
get() ); }
627 return gsl_rstat_quantile_get( w.
get() ); }
Workspace for quantile running statistics.
int add(double const x)
C++ version of gsl_rstat_quantile_add().
quantile_workspace()
The default constructor is only really useful for assigning to.
int reset()
C++ version of gsl_rstat_quantile_reset().
quantile_workspace(quantile_workspace &&v)
Move constructor.
gsl_rstat_quantile_workspace * ccgsl_pointer
The shared pointer.
bool operator<(quantile_workspace const &v) const
A container needs to define an ordering for sorting.
gsl_rstat_quantile_workspace * get() const
Get the gsl_rstat_quantile_workspace.
quantile_workspace(double const p)
The default constructor creates a new quantile_workspace.
size_t * count
The shared reference count.
~quantile_workspace()
The destructor only deletes the pointers if count reaches zero.
void swap(quantile_workspace &v)
Swap two quantile_workspace objects.
bool unique() const
Find if this is the only object sharing the gsl_rstat_quantile_workspace.
bool operator<=(quantile_workspace const &v) const
A container needs to define an ordering for sorting.
size_t use_count() const
Find how many quantile_workspace objects share this pointer.
bool operator==(quantile_workspace const &v) const
Two quantile_workspace are identically equal if their elements are identical.
bool empty() const
Find if the quantile_workspace is empty.
quantile_workspace & operator=(quantile_workspace const &v)
The assignment operator.
quantile_workspace & operator=(quantile_workspace &&v)
Move operator.
bool operator>(quantile_workspace const &v) const
A container needs to define an ordering for sorting.
quantile_workspace(gsl_rstat_quantile_workspace *v)
Could construct from a gsl_rstat_quantile_workspace*.
double get_value()
C++ version of gsl_rstat_quantile_get().
bool operator!=(quantile_workspace const &v) const
Two quantile_workspace are different if their elements are not identical.
bool operator>=(quantile_workspace const &v) const
A container needs to define an ordering for sorting.
quantile_workspace(quantile_workspace const &v)
The copy constructor.
Workspace for running statistics.
bool operator<(workspace const &v) const
A container needs to define an ordering for sorting.
gsl_rstat_workspace * ccgsl_pointer
The shared pointer.
bool operator!=(workspace const &v) const
Two workspace are different if their elements are not identical.
workspace & operator=(workspace const &v)
The assignment operator.
int add(double const x)
C++ version of gsl_rstat_add().
bool operator==(workspace const &v) const
Two workspace are identically equal if their elements are identical.
workspace(workspace &&v)
Move constructor.
bool operator>(workspace const &v) const
A container needs to define an ordering for sorting.
bool empty() const
Find if the workspace is empty.
bool unique() const
Find if this is the only object sharing the gsl_rstat_workspace.
bool operator>=(workspace const &v) const
A container needs to define an ordering for sorting.
workspace(workspace const &v)
The copy constructor.
bool operator<=(workspace const &v) const
A container needs to define an ordering for sorting.
workspace()
The default constructor creates a new workspace.
double sd() const
C++ version of gsl_rstat_sd().
double max() const
C++ version of gsl_rstat_max().
int reset()
C++ version of gsl_rstat_reset().
double variance() const
C++ version of gsl_rstat_variance().
double mean() const
C++ version of gsl_rstat_mean().
workspace & operator=(workspace &&v)
Move operator.
~workspace()
The destructor only deletes the pointers if count reaches zero.
double rms() const
C++ version of gsl_rstat_rms().
workspace(gsl_rstat_workspace *v)
Could construct from a gsl_rstat_workspace*.
double kurtosis() const
C++ version of gsl_rstat_kurtosis().
double median() const
C++ version of gsl_rstat_median().
size_t * count
The shared reference count.
double skew() const
C++ version of gsl_rstat_skew().
gsl_rstat_workspace * get() const
Get the gsl_rstat_workspace.
size_t n() const
C++ version of gsl_rstat_n().
void swap(workspace &v)
Swap two workspace objects.
double sd_mean() const
C++ version of gsl_rstat_sd_mean().
double min() const
C++ version of gsl_rstat_min().
size_t use_count() const
Find how many workspace objects share this pointer.
int add(double const x, quantile_workspace &w)
C++ version of gsl_rstat_quantile_add().
double get(quantile_workspace &w)
C++ version of gsl_rstat_quantile_get().
int reset(quantile_workspace &w)
C++ version of gsl_rstat_quantile_reset().
double sd_mean(workspace const &w)
C++ version of gsl_rstat_sd_mean().
double max(workspace const &w)
C++ version of gsl_rstat_max().
double variance(workspace const &w)
C++ version of gsl_rstat_variance().
double kurtosis(workspace const &w)
C++ version of gsl_rstat_kurtosis().
double min(workspace const &w)
C++ version of gsl_rstat_min().
double sd(workspace const &w)
C++ version of gsl_rstat_sd().
double mean(workspace const &w)
C++ version of gsl_rstat_mean().
int reset(workspace &w)
C++ version of gsl_rstat_reset().
int add(double const x, workspace &w)
C++ version of gsl_rstat_add().
double rms(workspace const &w)
C++ version of gsl_rstat_rms().
double skew(workspace const &w)
C++ version of gsl_rstat_skew().
double median(workspace &w)
C++ version of gsl_rstat_median().
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
The gsl package creates an interface to the GNU Scientific Library for C++.