Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Exponent Class Reference

#include <Exponent.hpp>

Public Types

typedef double(Exponent::* constMemberPtr )(double) const
 
typedef double(Exponent::* constMemberPtr )(double) const
 

Public Member Functions

 Exponent ()
 
 Exponent (double exponent)
 
double raise (double value) const
 
void set_exponent (double exponent)
 
Exponentoperator= (double d)
 
 operator double () const
 
double pow0 (double x) const
 
double pow1 (double x) const
 
double squareRoot (double x) const
 
double cubeRoot (double x) const
 
double powTwoThirds (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
 
 Exponent ()
 
 Exponent (double exponent)
 
double raise (double value) const
 
void set_exponent (double exponent)
 
Exponentoperator= (double d)
 
 operator double () const
 
double pow0 (double x) const
 
double pow1 (double x) const
 
double squareRoot (double x) const
 
double cubeRoot (double x) const
 
double powTwoThirds (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)
 
static constMemberPtr get_func_ptr (double exponent)
 

Private Attributes

double mExponent
 
constMemberPtr funcPointer
 

Detailed Description

Definition at line 43 of file includeLinks/Exponent.hpp.

Member Typedef Documentation

typedef double(Exponent::* constMemberPtr)(double) const

Definition at line 47 of file includeLinks/Exponent.hpp.

typedef double(Exponent::* constMemberPtr)(double) const

Definition at line 47 of file src/Misc/Exponent.hpp.

Constructor & Destructor Documentation

Exponent ( )
inline

Definition at line 50 of file includeLinks/Exponent.hpp.

50  : funcPointer( 0 )
51  {}
Exponent ( double  exponent)
inline

Definition at line 53 of file includeLinks/Exponent.hpp.

54  : mExponent(exponent),
55  funcPointer( get_func_ptr( exponent ) )
56  {}
static constMemberPtr get_func_ptr(double exponent)
Exponent ( )
inline

Definition at line 50 of file src/Misc/Exponent.hpp.

50  : funcPointer( 0 )
51  {}
Exponent ( double  exponent)
inline

Definition at line 53 of file src/Misc/Exponent.hpp.

54  : mExponent(exponent),
55  funcPointer( get_func_ptr( exponent ) )
56  {}
static constMemberPtr get_func_ptr(double exponent)

Member Function Documentation

double cubeRoot ( double  x) const

Definition at line 85 of file Misc/Exponent.cpp.

References Mesquite::cbrt().

Referenced by Exponent::get_func_ptr().

85 { return Mesquite::cbrt( x ); }
void int int REAL * x
Definition: read.cpp:74
double cbrt(double d)
Definition: Mesquite.hpp:182

Here is the call graph for this function:

Here is the caller graph for this function:

double cubeRoot ( double  x) const
Exponent::constMemberPtr get_func_ptr ( double  exponent)
static

Definition at line 42 of file Misc/Exponent.cpp.

References Exponent::cubeRoot(), Exponent::inverse(), Exponent::invSquare(), Exponent::invSquareRoot(), Exponent::pow0(), Exponent::pow1(), Exponent::pow2(), Exponent::powNegativeInt(), Exponent::powPositiveInt(), Exponent::powThreeHalves(), Exponent::powTwoThirds(), Exponent::squareRoot(), and Exponent::std_pow().

Referenced by Exponent::set_exponent().

43 {
44  if (exponent == 0.0)
45  return &Exponent::pow0;
46  else if (exponent == 1.0)
47  return &Exponent::pow1;
48  else if (exponent == 0.5)
49  return &Exponent::squareRoot;
50  else if (exponent == 1./3.)
51  return &Exponent::cubeRoot;
52  else if (exponent == 2./3.)
53  return &Exponent::powTwoThirds;
54  else if (exponent == 2.0)
55  return &Exponent::pow2;
56  else if (exponent == -1.0)
57  return &Exponent::inverse;
58  else if (exponent == -0.5)
60  else if (exponent == 1.5)
62  else if (exponent == -2.0)
63  return &Exponent::invSquare;
64  else if (msq_stdc::floor(exponent) == exponent)
65  {
66  if (exponent > 0.0)
68  else
70  }
71  else
72  return &Exponent::std_pow;
73 }
double pow1(double x) const
double powNegativeInt(double x) const
double pow0(double x) const
double std_pow(double x) const
double invSquareRoot(double x) const
double invSquare(double x) const
double powThreeHalves(double x) const
double powTwoThirds(double x) const
double cubeRoot(double x) const
double powPositiveInt(double x) const
double pow2(double x) const
double squareRoot(double x) const
double inverse(double x) const

Here is the call graph for this function:

Here is the caller graph for this function:

static constMemberPtr get_func_ptr ( double  exponent)
static
double inverse ( double  x) const
double inverse ( double  x) const

Definition at line 88 of file Misc/Exponent.cpp.

References x.

Referenced by Exponent::get_func_ptr().

88 { return 1.0 / x; }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double invSquare ( double  x) const
double invSquare ( double  x) const

Definition at line 91 of file Misc/Exponent.cpp.

References x.

Referenced by Exponent::get_func_ptr().

91 { return 1.0 / (x*x); }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double invSquareRoot ( double  x) const
double invSquareRoot ( double  x) const

Definition at line 89 of file Misc/Exponent.cpp.

References sqrt().

Referenced by Exponent::get_func_ptr().

89 { return 1.0 / msq_stdc::sqrt(x); }
double sqrt(double d)
Definition: double.h:73
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

operator double ( ) const
inline

Definition at line 66 of file includeLinks/Exponent.hpp.

References Exponent::mExponent.

67  { return mExponent; }
operator double ( ) const
inline

Definition at line 66 of file src/Misc/Exponent.hpp.

References Exponent::mExponent.

67  { return mExponent; }
Exponent& operator= ( double  d)
inline

Definition at line 63 of file includeLinks/Exponent.hpp.

References Exponent::set_exponent().

64  { set_exponent(d); return *this; }
const NT & d
void set_exponent(double exponent)

Here is the call graph for this function:

Exponent& operator= ( double  d)
inline

Definition at line 63 of file src/Misc/Exponent.hpp.

References Exponent::set_exponent().

64  { set_exponent(d); return *this; }
const NT & d
void set_exponent(double exponent)

Here is the call graph for this function:

double pow0 ( double  x) const
double pow0 ( double  x) const

Definition at line 81 of file Misc/Exponent.cpp.

Referenced by Exponent::get_func_ptr().

81 { return 1.0; }

Here is the caller graph for this function:

double pow1 ( double  x) const
double pow1 ( double  x) const

Definition at line 82 of file Misc/Exponent.cpp.

References x.

Referenced by Exponent::get_func_ptr().

82 { return x; }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double pow2 ( double  x) const
double pow2 ( double  x) const

Definition at line 83 of file Misc/Exponent.cpp.

References x.

Referenced by Exponent::get_func_ptr().

83 { return x * x; }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double powNegativeInt ( double  x) const
double powNegativeInt ( double  x) const

Definition at line 101 of file Misc/Exponent.cpp.

References i, Exponent::mExponent, and x.

Referenced by Exponent::get_func_ptr().

102 {
103  double result = x;
104  for (int i = (-(int)mExponent) - 1; i > 0; --i)
105  result *= x;
106  return 1.0/result;
107 }
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double powPositiveInt ( double  x) const

Definition at line 93 of file Misc/Exponent.cpp.

References i, Exponent::mExponent, and x.

Referenced by Exponent::get_func_ptr().

94 {
95  double result = x;
96  for (int i = (int)mExponent - 1; i > 0; --i)
97  result *= x;
98  return result;
99 }
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double powPositiveInt ( double  x) const
double powThreeHalves ( double  x) const

Definition at line 90 of file Misc/Exponent.cpp.

References sqrt().

Referenced by Exponent::get_func_ptr().

90 { return x*x*x / msq_stdc::sqrt(x); }
double sqrt(double d)
Definition: double.h:73
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

double powThreeHalves ( double  x) const
double powTwoThirds ( double  x) const

Definition at line 86 of file Misc/Exponent.cpp.

References Mesquite::cbrt_sqr().

Referenced by Exponent::get_func_ptr().

86 { return Mesquite::cbrt_sqr(x); }
double cbrt_sqr(double d)
Definition: Mesquite.hpp:191
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

double powTwoThirds ( double  x) const
double raise ( double  value) const
inline

Definition at line 58 of file src/Misc/Exponent.hpp.

References Exponent::funcPointer.

59  { return (this->*funcPointer)( value ); }
double raise ( double  value) const
inline

Definition at line 58 of file includeLinks/Exponent.hpp.

References Exponent::funcPointer.

Referenced by Mesquite::pow().

59  { return (this->*funcPointer)( value ); }

Here is the caller graph for this function:

void set_exponent ( double  exponent)

Definition at line 75 of file Misc/Exponent.cpp.

References Exponent::funcPointer, Exponent::get_func_ptr(), and Exponent::mExponent.

Referenced by Exponent::operator=().

76 {
77  mExponent = exponent;
78  funcPointer = get_func_ptr( exponent );
79 }
static constMemberPtr get_func_ptr(double exponent)

Here is the call graph for this function:

Here is the caller graph for this function:

void set_exponent ( double  exponent)
double squareRoot ( double  x) const

Definition at line 84 of file Misc/Exponent.cpp.

References sqrt().

Referenced by Exponent::get_func_ptr().

84 { return msq_stdc::sqrt( x ); }
double sqrt(double d)
Definition: double.h:73
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

double squareRoot ( double  x) const
double std_pow ( double  x) const
double std_pow ( double  x) const

Definition at line 87 of file Misc/Exponent.cpp.

References Exponent::mExponent, and Mesquite::pow().

Referenced by Exponent::get_func_ptr().

87 { return msq_stdc::pow( x, mExponent ); }
void int int REAL * x
Definition: read.cpp:74
double pow(double value, const Exponent &exp)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

constMemberPtr funcPointer
private

Definition at line 86 of file includeLinks/Exponent.hpp.

Referenced by Exponent::raise(), and Exponent::set_exponent().


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