Public Types | Public Member Functions | Static Public Member Functions | List of all members
imath::CDouble Class Reference

Simple wrapper of real value represented as double type. More...

#include <CDouble.h>

Inheritance diagram for imath::CDouble:
imath::TVector< 1 >

Public Types

typedef TVector< 1 > BaseClass
 
- Public Types inherited from imath::TVector< 1 >
typedef double ElementType
 
typedef double Elements [Size]
 

Public Member Functions

 CDouble (double value=0.0)
 
 CDouble (const BaseClass &value)
 
CDouble GetRounded (int precision=2) const
 Get rounded value. More...
 
bool IsRoundedEqual (const CDouble &value, int precision=2) const
 Check if two values are equal after rounding. More...
 
CDouble GetRoundedDown (int precision=2) const
 Get rounded down value with specified precision. More...
 
bool IsRoundedDownEqual (const CDouble &value, int precision=2) const
 Check if two values are equal after rounding down. More...
 
CDouble GetRoundedUp (int precision=2) const
 Get rounded down value with specified precision. More...
 
bool IsRoundedUpEqual (const CDouble &value, int precision=2) const
 Check if two values are equal after rounding down. More...
 
bool IsSimiliar (const CDouble &value, double tolerance=I_BIG_EPSILON) const
 Check if two values are similiar with specified tolerance. More...
 
 operator double () const
 
bool operator== (const CDouble &value) const
 
bool operator!= (const CDouble &value) const
 
bool operator< (const CDouble &value) const
 
bool operator> (const CDouble &value) const
 
bool operator<= (const CDouble &value) const
 
bool operator>= (const CDouble &value) const
 
CDouble operator+ (const CDouble &value) const
 
CDouble operator- (const CDouble &value) const
 
CDouble operator* (const CDouble &value) const
 
CDouble operator/ (const CDouble &value) const
 
const CDoubleoperator= (const CDouble &value)
 
const CDoubleoperator+= (const CDouble &value)
 
const CDoubleoperator-= (const CDouble &value)
 
const CDoubleoperator*= (const CDouble &value)
 
const CDoubleoperator/= (const CDouble &value)
 
- Public Member Functions inherited from imath::TVector< 1 >
 TVector ()
 Create an uninitialized point. More...
 
 TVector (const TVector< Size, double > &vector)
 Copy constructor. More...
 
const double & GetElement (int i) const
 Get element at specified i. More...
 
double & GetElementRef (int i)
 Get reference to element at specified i. More...
 
void SetElement (int i, const double &value)
 Set element at specified i. More...
 
void SetAllElements (const double &value)
 Set some value to all elements. More...
 
void Reset ()
 Set all coordinates to zero. More...
 
void Clear ()
 Set all coordinates to zero. More...
 
const TVector< Size, double >
::Elements
GetElements () const
 Get read-only access to internal element container. More...
 
TVector< Size, double >::ElementsGetElementsRef ()
 Get access to internal element container. More...
 
void Translate (const TVector< Size, double > &vector)
 Translate the point. More...
 
TVector< Size, double > GetTranslated (const TVector< Size, double > &vector)
 Get translated point. More...
 
void GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result)
 /overloaded More...
 
void ScaledCumulate (const TVector< Size, double > &vector, doublescale)
 Add second vector scaled by specified factor. More...
 
bool IsNull (doubletolerance=I_BIG_EPSILON) const
 Check if this vector is null. More...
 
double GetDotProduct (const TVector< Size, double > &vector) const
 Return dot product of two vectors. More...
 
double GetLength2 () const
 Return euclidian length square. More...
 
double GetLength () const
 Return euclidian length. More...
 
double GetDistance2 (const TVector< Size, double > &vector) const
 Return distance square between two vectors. More...
 
double GetDistance (const TVector< Size, double > &vector) const
 Return distance between two vectors. More...
 
double GetElementsSum () const
 Get simple sum of all elements. More...
 
bool Normalize (doublelength=1.0)
 Normalize vector to specified length. More...
 
bool GetNormalized (TVector< Size, double > &result, doublelength=1.0) const
 Return normalized vector with the same direction and specified length. More...
 
void GetMinimal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with minimal elements values. More...
 
void GetMaximal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with maximal elements values. More...
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive. More...
 
bool operator== (const TVector< Size, double > &vector) const
 
bool operator!= (const TVector< Size, double > &vector) const
 
bool operator< (const TVector< Size, double > &vector) const
 
bool operator> (const TVector< Size, double > &vector) const
 
bool operator<= (const TVector< Size, double > &vector) const
 
bool operator>= (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator- () const
 
TVector< Size, double > operator- (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator+ (const TVector< Size, double > &vector) const
 
TVector< Size, double > operator* (doublescalar) const
 
TVector< Size, double > operator/ (doublescalar) const
 
TVector< Size, double > & operator+= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator-= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator*= (doublescalar)
 
TVector< Size, double > & operator/= (doublescalar)
 
const double & operator[] (int i) const
 
double & operator[] (int i)
 

Static Public Member Functions

static double GetRounded (double value, int precision=2)
 
static bool IsRoundedEqual (double value1, double value2, int precision=2)
 
static double GetRoundedDown (double value, int precision=2)
 
static bool IsRoundedDownEqual (double value1, double value2, int precision=2)
 
static double GetRoundedUp (double value, int precision=2)
 
static bool IsRoundedUpEqual (double value1, double value2, int precision=2)
 
static bool IsSimiliar (double value1, double value2, double tolerance=I_BIG_EPSILON)
 
- Static Public Member Functions inherited from imath::TVector< 1 >
static int GetElementsCount ()
 Get number of elements. More...
 
static bool SetElementsCount (int count)
 Set number of elements. More...
 
static const TVector< Size,
double > & 
GetZero ()
 Get vector with all coordinates set to 0. More...
 

Additional Inherited Members

- Protected Attributes inherited from imath::TVector< 1 >
Elements m_elements
 

Detailed Description

Simple wrapper of real value represented as double type.

Definition at line 21 of file CDouble.h.

Member Typedef Documentation

Definition at line 24 of file CDouble.h.

Constructor & Destructor Documentation

imath::CDouble::CDouble ( double  value = 0.0)
inline

Definition at line 99 of file CDouble.h.

References imath::TVector< 1 >::SetElement().

imath::CDouble::CDouble ( const BaseClass value)
inline

Definition at line 105 of file CDouble.h.

Member Function Documentation

CDouble imath::CDouble::GetRounded ( int  precision = 2) const
inline

Get rounded value.

Definition at line 117 of file CDouble.h.

References imath::TVector< 1 >::GetElement().

double imath::CDouble::GetRounded ( double  value,
int  precision = 2 
)
inlinestatic

Definition at line 261 of file CDouble.h.

CDouble imath::CDouble::GetRoundedDown ( int  precision = 2) const
inline

Get rounded down value with specified precision.

Definition at line 129 of file CDouble.h.

double imath::CDouble::GetRoundedDown ( double  value,
int  precision = 2 
)
inlinestatic

Definition at line 277 of file CDouble.h.

CDouble imath::CDouble::GetRoundedUp ( int  precision = 2) const
inline

Get rounded down value with specified precision.

Definition at line 141 of file CDouble.h.

double imath::CDouble::GetRoundedUp ( double  value,
int  precision = 2 
)
inlinestatic

Definition at line 293 of file CDouble.h.

bool imath::CDouble::IsRoundedDownEqual ( const CDouble value,
int  precision = 2 
) const
inline

Check if two values are equal after rounding down.

Definition at line 135 of file CDouble.h.

bool imath::CDouble::IsRoundedDownEqual ( double  value1,
double  value2,
int  precision = 2 
)
inlinestatic

Definition at line 285 of file CDouble.h.

bool imath::CDouble::IsRoundedEqual ( const CDouble value,
int  precision = 2 
) const
inline

Check if two values are equal after rounding.

Definition at line 123 of file CDouble.h.

bool imath::CDouble::IsRoundedEqual ( double  value1,
double  value2,
int  precision = 2 
)
inlinestatic

Definition at line 269 of file CDouble.h.

bool imath::CDouble::IsRoundedUpEqual ( const CDouble value,
int  precision = 2 
) const
inline

Check if two values are equal after rounding down.

Definition at line 147 of file CDouble.h.

bool imath::CDouble::IsRoundedUpEqual ( double  value1,
double  value2,
int  precision = 2 
)
inlinestatic

Definition at line 301 of file CDouble.h.

bool imath::CDouble::IsSimiliar ( const CDouble value,
double  tolerance = I_BIG_EPSILON 
) const
inline

Check if two values are similiar with specified tolerance.

Definition at line 153 of file CDouble.h.

bool imath::CDouble::IsSimiliar ( double  value1,
double  value2,
double  tolerance = I_BIG_EPSILON 
)
inlinestatic

Definition at line 309 of file CDouble.h.

imath::CDouble::operator double ( ) const
inline

Definition at line 111 of file CDouble.h.

bool imath::CDouble::operator!= ( const CDouble value) const
inline
CDouble imath::CDouble::operator* ( const CDouble value) const
inline
const CDouble & imath::CDouble::operator*= ( const CDouble value)
inline
CDouble imath::CDouble::operator+ ( const CDouble value) const
inline
const CDouble & imath::CDouble::operator+= ( const CDouble value)
inline
CDouble imath::CDouble::operator- ( const CDouble value) const
inline
const CDouble & imath::CDouble::operator-= ( const CDouble value)
inline
CDouble imath::CDouble::operator/ ( const CDouble value) const
inline
const CDouble & imath::CDouble::operator/= ( const CDouble value)
inline
bool imath::CDouble::operator< ( const CDouble value) const
inline
bool imath::CDouble::operator<= ( const CDouble value) const
inline
const CDouble & imath::CDouble::operator= ( const CDouble value)
inline
bool imath::CDouble::operator== ( const CDouble value) const
inline
bool imath::CDouble::operator> ( const CDouble value) const
inline
bool imath::CDouble::operator>= ( const CDouble value) const
inline

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

© 2007-2017 Witold Gantzke and Kirill Lepskiy