MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <Exponent.hpp>
Public Types | |
typedef double(Exponent::* | constMemberPtr )(double) const |
Public Member Functions | |
Exponent () | |
Exponent (double exponent) | |
double | raise (double p_value) const |
void | set_exponent (double exponent) |
Exponent & | operator= (double d) |
double | value () const |
double | pow0 (double x) const |
double | pow1 (double x) const |
double | squareRoot (double x) const |
double | cubeRoot (double x) const |
double | invCubeRoot (double x) const |
double | powTwoThirds (double x) const |
double | invTwoThirds (double x) const |
double | pow2 (double x) const |
double | powPositiveInt (double x) const |
double | std_pow (double x) const |
double | inverse (double x) const |
double | invSquareRoot (double x) const |
double | powThreeHalves (double x) const |
double | invSquare (double x) const |
double | powNegativeInt (double x) const |
Static Public Member Functions | |
static constMemberPtr | get_func_ptr (double exponent) |
Private Attributes | |
double | mExponent |
constMemberPtr | funcPointer |
Definition at line 44 of file Exponent.hpp.
typedef double( Exponent::* MBMesquite::Exponent::constMemberPtr)(double) const |
Definition at line 47 of file Exponent.hpp.
MBMesquite::Exponent::Exponent | ( | ) | [inline] |
Definition at line 50 of file Exponent.hpp.
: funcPointer( 0 ) {}
MBMesquite::Exponent::Exponent | ( | double | exponent | ) | [inline, explicit] |
Definition at line 52 of file Exponent.hpp.
: mExponent( exponent ), funcPointer( get_func_ptr( exponent ) ) {}
double MBMesquite::Exponent::cubeRoot | ( | double | x | ) | const |
Definition at line 100 of file Exponent.cpp.
References MBMesquite::cbrt().
Referenced by get_func_ptr().
{ return MBMesquite::cbrt( x ); }
Exponent::constMemberPtr MBMesquite::Exponent::get_func_ptr | ( | double | exponent | ) | [static] |
Definition at line 41 of file Exponent.cpp.
References cubeRoot(), invCubeRoot(), inverse(), invSquare(), invSquareRoot(), invTwoThirds(), pow0(), pow1(), pow2(), powNegativeInt(), powPositiveInt(), powThreeHalves(), powTwoThirds(), squareRoot(), and std_pow().
Referenced by set_exponent().
{ if( exponent == 0.0 ) return &Exponent::pow0; else if( exponent == 1.0 ) return &Exponent::pow1; else if( exponent == 0.5 ) return &Exponent::squareRoot; else if( exponent == 1. / 3. ) return &Exponent::cubeRoot; else if( exponent == -1. / 3. ) return &Exponent::invCubeRoot; else if( exponent == 2. / 3. ) return &Exponent::powTwoThirds; else if( exponent == -2. / 3. ) return &Exponent::invTwoThirds; else if( exponent == 2.0 ) return &Exponent::pow2; else if( exponent == -1.0 ) return &Exponent::inverse; else if( exponent == -0.5 ) return &Exponent::invSquareRoot; else if( exponent == 1.5 ) return &Exponent::powThreeHalves; else if( exponent == -2.0 ) return &Exponent::invSquare; else if( std::floor( exponent ) == exponent ) { if( exponent > 0.0 ) return &Exponent::powPositiveInt; else return &Exponent::powNegativeInt; } else return &Exponent::std_pow; }
double MBMesquite::Exponent::invCubeRoot | ( | double | x | ) | const |
Definition at line 104 of file Exponent.cpp.
References MBMesquite::cbrt().
Referenced by get_func_ptr().
{ return 1.0 / MBMesquite::cbrt( x ); }
double MBMesquite::Exponent::inverse | ( | double | x | ) | const |
double MBMesquite::Exponent::invSquare | ( | double | x | ) | const |
Definition at line 132 of file Exponent.cpp.
Referenced by get_func_ptr().
{
return 1.0 / ( x * x );
}
double MBMesquite::Exponent::invSquareRoot | ( | double | x | ) | const |
Definition at line 124 of file Exponent.cpp.
Referenced by get_func_ptr().
{
return 1.0 / std::sqrt( x );
}
double MBMesquite::Exponent::invTwoThirds | ( | double | x | ) | const |
Definition at line 112 of file Exponent.cpp.
References MBMesquite::cbrt_sqr().
Referenced by get_func_ptr().
{ return 1.0 / MBMesquite::cbrt_sqr( x ); }
Exponent& MBMesquite::Exponent::operator= | ( | double | d | ) | [inline] |
Definition at line 61 of file Exponent.hpp.
References set_exponent().
{ set_exponent( d ); return *this; }
double MBMesquite::Exponent::pow0 | ( | double | x | ) | const |
double MBMesquite::Exponent::pow1 | ( | double | x | ) | const |
double MBMesquite::Exponent::pow2 | ( | double | x | ) | const |
double MBMesquite::Exponent::powNegativeInt | ( | double | x | ) | const |
Definition at line 145 of file Exponent.cpp.
References mExponent.
Referenced by get_func_ptr().
{ double result = x; for( int i = ( -(int)mExponent ) - 1; i > 0; --i ) result *= x; return 1.0 / result; }
double MBMesquite::Exponent::powPositiveInt | ( | double | x | ) | const |
Definition at line 137 of file Exponent.cpp.
References mExponent.
Referenced by get_func_ptr().
{ double result = x; for( int i = (int)mExponent - 1; i > 0; --i ) result *= x; return result; }
double MBMesquite::Exponent::powThreeHalves | ( | double | x | ) | const |
Definition at line 128 of file Exponent.cpp.
Referenced by get_func_ptr().
{
return x * x * x / std::sqrt( x );
}
double MBMesquite::Exponent::powTwoThirds | ( | double | x | ) | const |
Definition at line 108 of file Exponent.cpp.
References MBMesquite::cbrt_sqr().
Referenced by get_func_ptr().
{ return MBMesquite::cbrt_sqr( x ); }
double MBMesquite::Exponent::raise | ( | double | p_value | ) | const [inline] |
Definition at line 54 of file Exponent.hpp.
References funcPointer.
Referenced by MBMesquite::PMeanPMetric::average(), MBMesquite::PMeanPMetric::average_with_gradient(), MBMesquite::PMeanPMetric::average_with_Hessian(), MBMesquite::PMeanPMetric::average_with_Hessian_diagonal(), MBMesquite::PMeanPMetric::average_with_indices(), MBMesquite::PatchPowerMeanP::evaluate(), MBMesquite::PowerQualityMetric::evaluate(), MBMesquite::PMeanPTemplate::evaluate(), MBMesquite::PatchPowerMeanP::evaluate_with_gradient(), MBMesquite::PowerQualityMetric::evaluate_with_gradient(), MBMesquite::PMeanPTemplate::evaluate_with_gradient(), MBMesquite::PatchPowerMeanP::evaluate_with_Hessian(), MBMesquite::PowerQualityMetric::evaluate_with_Hessian(), MBMesquite::PMeanPTemplate::evaluate_with_Hessian(), MBMesquite::PMeanPTemplate::evaluate_with_Hessian_diagonal(), MBMesquite::PowerQualityMetric::evaluate_with_indices(), MBMesquite::g_fcn_2e(), MBMesquite::g_fcn_2i(), MBMesquite::g_fcn_3e(), MBMesquite::g_fcn_3e_v3(), MBMesquite::g_fcn_3i(), MBMesquite::g_fcn_3p(), MBMesquite::g_fcn_3w(), MBMesquite::h_fcn_2e(), MBMesquite::h_fcn_2i(), MBMesquite::h_fcn_3e(), MBMesquite::h_fcn_3e_v3(), MBMesquite::h_fcn_3i(), MBMesquite::h_fcn_3p(), MBMesquite::h_fcn_3w(), MBMesquite::m_fcn_2e(), MBMesquite::m_fcn_2i(), MBMesquite::m_fcn_3e(), MBMesquite::m_fcn_3i(), MBMesquite::m_fcn_3p(), and MBMesquite::m_fcn_3w().
{ return ( this->*funcPointer )( p_value ); }
void MBMesquite::Exponent::set_exponent | ( | double | exponent | ) |
Definition at line 78 of file Exponent.cpp.
References funcPointer, get_func_ptr(), and mExponent.
Referenced by operator=().
{ mExponent = exponent; funcPointer = get_func_ptr( exponent ); }
double MBMesquite::Exponent::squareRoot | ( | double | x | ) | const |
Definition at line 96 of file Exponent.cpp.
Referenced by get_func_ptr().
{
return std::sqrt( x );
}
double MBMesquite::Exponent::std_pow | ( | double | x | ) | const |
Definition at line 116 of file Exponent.cpp.
References mExponent.
Referenced by get_func_ptr().
{ return std::pow( x, mExponent ); }
double MBMesquite::Exponent::value | ( | ) | const [inline] |
Definition at line 69 of file Exponent.hpp.
References mExponent.
Referenced by MBMesquite::PMeanPMetric::average_with_gradient(), MBMesquite::PMeanPMetric::average_with_Hessian(), MBMesquite::PMeanPMetric::average_with_Hessian_diagonal(), MBMesquite::PatchPowerMeanP::evaluate_with_gradient(), MBMesquite::PowerQualityMetric::evaluate_with_gradient(), MBMesquite::PMeanPTemplate::evaluate_with_gradient(), MBMesquite::PatchPowerMeanP::evaluate_with_Hessian(), MBMesquite::PowerQualityMetric::evaluate_with_Hessian(), MBMesquite::PMeanPTemplate::evaluate_with_Hessian(), MBMesquite::PMeanPTemplate::evaluate_with_Hessian_diagonal(), MBMesquite::g_fcn_2e(), MBMesquite::g_fcn_2i(), MBMesquite::g_fcn_3e(), MBMesquite::g_fcn_3e_v3(), MBMesquite::g_fcn_3i(), MBMesquite::g_fcn_3p(), MBMesquite::g_fcn_3w(), MBMesquite::PowerQualityMetric::get_negate_flag(), MBMesquite::IdealWeightInverseMeanRatio::get_negate_flag(), MBMesquite::PMeanPTemplate::get_power(), MBMesquite::h_fcn_2e(), MBMesquite::h_fcn_2i(), MBMesquite::h_fcn_3e(), MBMesquite::h_fcn_3e_v3(), MBMesquite::h_fcn_3i(), MBMesquite::h_fcn_3p(), and MBMesquite::h_fcn_3w().
{ return mExponent; }
Definition at line 92 of file Exponent.hpp.
Referenced by raise(), and set_exponent().
double MBMesquite::Exponent::mExponent [private] |
Definition at line 91 of file Exponent.hpp.
Referenced by powNegativeInt(), powPositiveInt(), set_exponent(), std_pow(), and value().