MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Accumulate various statistics for a list of discrete values. More...
#include <SimpleStats.hpp>
Public Member Functions | |
SimpleStats () | |
double | minimum () const |
minimum value | |
double | maximum () const |
maximum value | |
double | average () const |
algebraic mean of values | |
double | rms () const |
root mean squared of values | |
double | variance () const |
variance of values | |
double | standard_deviation () const |
standard deviation of values | |
void | add_value (double value) |
incorporate another value into statistics | |
void | add_squared (double value_squared) |
incorporate another value into statistics | |
void | clear () |
bool | empty () |
Private Attributes | |
double | valueSum |
double | valueSqrSum |
double | valueMin |
double | valueMax |
unsigned long | valueCount |
Accumulate various statistics for a list of discrete values.
Definition at line 41 of file SimpleStats.hpp.
Definition at line 38 of file SimpleStats.cpp.
: valueSum( 0 ), valueSqrSum( 0 ), valueMin( std::numeric_limits< double >::infinity() ), valueMax( -std::numeric_limits< double >::infinity() ), valueCount( 0 ) { }
void MBMesquite::SimpleStats::add_squared | ( | double | value_squared | ) | [inline] |
incorporate another value into statistics
Definition at line 92 of file SimpleStats.hpp.
References value(), valueCount, valueMax, valueMin, valueSqrSum, and valueSum.
Referenced by MBMesquite::MeshUtil::edge_length_distribution().
void MBMesquite::SimpleStats::add_value | ( | double | value | ) | [inline] |
incorporate another value into statistics
Definition at line 82 of file SimpleStats.hpp.
References value(), valueCount, valueMax, valueMin, valueSqrSum, and valueSum.
Referenced by MBMesquite::CompareQM::GradStat::add(), MBMesquite::CompareQM::check_value(), and MBMesquite::MeshUtil::lambda_distribution().
double MBMesquite::SimpleStats::average | ( | ) | const [inline] |
algebraic mean of values
Definition at line 61 of file SimpleStats.hpp.
References valueCount, and valueSum.
Referenced by MBMesquite::TerminationCriterion::initialize_queue(), MBMesquite::print(), MBMesquite::PaverMinEdgeLengthWrapper::run_wrapper(), MBMesquite::UntangleWrapper::run_wrapper(), TerminationCriterionTest::test_absolute_vertex_movement_edge_length(), MeshUtilTest::test_edge_length_distribution_types(), MeshUtilTest::test_edge_length_distribution_unique(), MeshUtilTest::test_lambda_distribution(), and variance().
{ return valueSum / valueCount; }
void MBMesquite::SimpleStats::clear | ( | ) |
Definition at line 44 of file SimpleStats.cpp.
References valueCount, valueMax, valueMin, valueSqrSum, and valueSum.
Referenced by MeshUtilTest::test_lambda_distribution().
{ valueSum = valueSqrSum = 0; valueMin = std::numeric_limits< double >::infinity(); valueMax = -valueMin; valueCount = 0; }
bool MBMesquite::SimpleStats::empty | ( | ) | [inline] |
Definition at line 104 of file SimpleStats.hpp.
References valueCount.
Referenced by MBMesquite::MeshUtil::edge_length_distribution(), and MBMesquite::MeshUtil::lambda_distribution().
{ return 0ul == valueCount; }
double MBMesquite::SimpleStats::maximum | ( | ) | const [inline] |
maximum value
Definition at line 56 of file SimpleStats.hpp.
References valueMax.
Referenced by MBMesquite::print(), MeshUtilTest::test_edge_length_distribution_types(), MeshUtilTest::test_edge_length_distribution_unique(), and MeshUtilTest::test_lambda_distribution().
{ return valueMax; }
double MBMesquite::SimpleStats::minimum | ( | ) | const [inline] |
minimum value
Definition at line 51 of file SimpleStats.hpp.
References valueMin.
Referenced by MBMesquite::print(), MeshUtilTest::test_edge_length_distribution_types(), MeshUtilTest::test_edge_length_distribution_unique(), and MeshUtilTest::test_lambda_distribution().
{ return valueMin; }
double MBMesquite::SimpleStats::rms | ( | ) | const [inline] |
root mean squared of values
Definition at line 66 of file SimpleStats.hpp.
References valueCount, and valueSqrSum.
Referenced by MBMesquite::print(), MeshUtilTest::test_edge_length_distribution_types(), MeshUtilTest::test_edge_length_distribution_unique(), and MeshUtilTest::test_lambda_distribution().
{ return sqrt( valueSqrSum / valueCount ); }
double MBMesquite::SimpleStats::standard_deviation | ( | ) | const [inline] |
standard deviation of values
Definition at line 76 of file SimpleStats.hpp.
References variance().
Referenced by MBMesquite::TerminationCriterion::initialize_queue(), MBMesquite::print(), MBMesquite::UntangleWrapper::run_wrapper(), TerminationCriterionTest::test_absolute_vertex_movement_edge_length(), MeshUtilTest::test_edge_length_distribution_types(), and MeshUtilTest::test_edge_length_distribution_unique().
{ return sqrt( fabs( variance() ) ); }
double MBMesquite::SimpleStats::variance | ( | ) | const [inline] |
variance of values
Definition at line 71 of file SimpleStats.hpp.
References average(), valueCount, and valueSqrSum.
Referenced by standard_deviation(), and MeshUtilTest::test_lambda_distribution().
{ return valueSqrSum / valueCount - average() * average(); }
unsigned long MBMesquite::SimpleStats::valueCount [private] |
Definition at line 45 of file SimpleStats.hpp.
Referenced by add_squared(), add_value(), average(), clear(), empty(), rms(), and variance().
double MBMesquite::SimpleStats::valueMax [private] |
Definition at line 44 of file SimpleStats.hpp.
Referenced by add_squared(), add_value(), clear(), and maximum().
double MBMesquite::SimpleStats::valueMin [private] |
Definition at line 44 of file SimpleStats.hpp.
Referenced by add_squared(), add_value(), clear(), and minimum().
double MBMesquite::SimpleStats::valueSqrSum [private] |
Definition at line 44 of file SimpleStats.hpp.
Referenced by add_squared(), add_value(), clear(), rms(), and variance().
double MBMesquite::SimpleStats::valueSum [private] |
Definition at line 44 of file SimpleStats.hpp.
Referenced by add_squared(), add_value(), average(), and clear().