28 CPScalar(
double val,
const std::string &unitSpec)
126 return !(*
this == rhs);
189 operator bool()
const
196 return static_cast<int>(
static_cast<double>(*this));
199 operator float()
const
201 return static_cast<float>(
static_cast<double>(*this));
204 operator double()
const
220 throw "PScalar value can't be cast to numeric unless already dimensionless!";
237 return CPScalar(*this).ConvertTo(unitSpec);
347inline std::ostream & operator<<(std::ostream &output,
const CPScalar &self)
432bool operator<(
const CPScalar &lhs,
const T &rhs)
438bool operator<(
const T &lhs,
const CPScalar &rhs)
445bool operator<=(
const CPScalar &lhs,
const T &rhs)
451bool operator<=(
const T &lhs,
const CPScalar &rhs)
458bool operator>(
const CPScalar &lhs,
const T &rhs)
464bool operator>(
const T &lhs,
const CPScalar &rhs)
471bool operator>=(
const CPScalar &lhs,
const T &rhs)
477bool operator>=(
const T &lhs,
const CPScalar &rhs)
484bool operator==(
const CPScalar &lhs,
const T &rhs)
490bool operator==(
const T &lhs,
const CPScalar &rhs)
497bool operator!=(
const CPScalar &lhs,
const T &rhs)
503bool operator!=(
const T &lhs,
const CPScalar &rhs)
Definition: CompoundUnit.h:40
bool IsDecibel() const
Definition: CompoundUnit.cpp:261
CCompoundUnit & Raise(CCompoundUnitElement::ExponentType)
Definition: CompoundUnit.cpp:594
const CUnitDimension * GetDimension() const
Definition: CompoundUnit.cpp:235
bool IsDimensionless() const
Definition: CompoundUnit.h:202
CPScalar operator/(const CPScalar &rhs) const
Definition: PScalar.h:86
CPScalar & operator+=(const CPScalar &rhs)
Definition: PScalar.h:96
CPScalar()
Definition: PScalar.h:21
CPScalar & operator*=(const CPScalar &rhs)
Definition: PScalar.h:67
CPScalar & operator/=(const CPScalar &rhs)
Definition: PScalar.h:74
std::ostream & PrintSelf(std::ostream &output) const
Definition: PScalar.h:296
CPScalar(const std::string &unitSpec)
Definition: PScalar.h:43
CPScalar & ConvertTo(const CCompoundUnit &newUnit)
Definition: PScalar.h:281
double m_dValue
Definition: PScalar.h:323
bool operator==(const CPScalar &rhs) const
Definition: PScalar.h:114
bool operator!=(const CPScalar &rhs) const
Definition: PScalar.h:124
double GetValue() const
Definition: PScalar.h:225
bool operator<=(const CPScalar &rhs) const
Definition: PScalar.h:147
CPScalar(double val)
Definition: PScalar.h:35
bool IsDimensionless() const
Definition: PScalar.h:306
CPScalar(double val, const std::string &unitSpec)
Definition: PScalar.h:28
CPScalar & operator=(const CPScalar &rhs)
Definition: PScalar.h:57
bool IsDecible() const
Definition: PScalar.h:312
CCompoundUnit m_CCU
Definition: PScalar.h:324
bool IsSameType(const CPScalar &target) const
Definition: PScalar.h:301
CPScalar operator*(const CPScalar &rhs) const
Definition: PScalar.h:81
CPScalar operator+() const
Definition: PScalar.h:172
CPScalar & operator-=(const CPScalar &rhs)
Definition: PScalar.h:104
CPScalar & Negate(void)
Definition: PScalar.h:177
CPScalar & Abs()
Definition: PScalar.h:263
bool operator>(const CPScalar &rhs) const
Definition: PScalar.h:140
bool operator>=(const CPScalar &rhs) const
Definition: PScalar.h:154
CPScalar operator-(const CPScalar &rhs) const
Definition: PScalar.h:167
bool operator<(const CPScalar &rhs) const
Definition: PScalar.h:133
CPScalar & SQRoot()
Definition: PScalar.h:252
CPScalar operator-() const
Definition: PScalar.h:183
CPScalar & ConvertTo(const CPScalar &target)
Definition: PScalar.h:291
CPScalar & Raise(double pwr)
Definition: PScalar.h:243
CPScalar operator()(const std::string &unitSpec) const
Definition: PScalar.h:235
CPScalar & ConvertTo(const std::string &unitSpec)
Definition: PScalar.h:270
CPScalar(const CPScalar &src)
Definition: PScalar.h:50
CPScalar operator+(const CPScalar &rhs) const
Definition: PScalar.h:162
Definition: UnitConversionEngine.h:24
static CUnitConversionEngine & GetEngine(void)
Definition: UnitConversionEngine.h:41
double ConvertValueInterval(const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const
Definition: UnitConversionEngine.cpp:474
double ConvertValue(const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const
Definition: UnitConversionEngine.cpp:369