ICF 3.0.5.47
Technical documentation of ICF Libraries
imath::CDouble Class Reference

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

#include <CDouble.h>

Inheritance diagram for imath::CDouble:
Collaboration diagram for imath::CDouble:

Public Types

typedef TVector< 1 > BaseClass
 
- Public Types inherited from imath::TVector< 1 >
typedef double ElementType
 
typedef std::array< double, Size > Elements
 

Public Member Functions

 CDouble (double value=0.0)
 
 CDouble (const BaseClass &value)
 
CDouble GetRounded (int precision=2) const
 Get rounded value.
 
bool IsRoundedEqual (const CDouble &value, int precision=2) const
 Check if two values are equal after rounding.
 
CDouble GetRoundedDown (int precision=2) const
 Get rounded down value with specified precision.
 
bool IsRoundedDownEqual (const CDouble &value, int precision=2) const
 Check if two values are equal after rounding down.
 
CDouble GetRoundedUp (int precision=2) const
 Get rounded down value with specified precision.
 
bool IsRoundedUpEqual (const CDouble &value, int precision=2) const
 Check if two values are equal after rounding down.
 
bool IsSimiliar (const CDouble &value, double tolerance=I_BIG_EPSILON) const
 Check if two values are similiar with specified tolerance.
 
 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.
 
 TVector (const TVector< Size, double > &vector)
 Copy constructor.
 
 TVector (TVector< Size, double > &&vector) noexcept
 Move constructor.
 
const double & GetElement (int i) const
 Get element at specified i.
 
double & GetElementRef (int i)
 Get reference to element at specified i.
 
void SetElement (int i, const double &value)
 Set element at specified i.
 
void SetAllElements (const double &value)
 Set some value to all elements.
 
void Reset ()
 Set all coordinates to zero.
 
void Clear ()
 Set all coordinates to zero.
 
const TVector< Size, double >::ElementsGetElements () const
 Get read-only access to internal element container.
 
TVector< Size, double >::ElementsGetElementsRef ()
 Get access to internal element container.
 
void Translate (const TVector< Size, double > &vector)
 Translate the point.
 
TVector< Size, double > GetTranslated (const TVector< Size, double > &vector)
 Get translated point.
 
void GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result)
 /overloaded
 
void ScaledCumulate (const TVector< Size, double > &vector, double scale)
 Add second vector scaled by specified factor.
 
bool IsNull (double tolerance=I_BIG_EPSILON) const
 Check if this vector is null.
 
double GetDotProduct (const TVector< Size, double > &vector) const
 Return dot product of two vectors.
 
double GetLength2 () const
 Return euclidian length square.
 
double GetLength () const
 Return euclidian length.
 
double GetDistance2 (const TVector< Size, double > &vector) const
 Return distance square between two vectors.
 
double GetDistance (const TVector< Size, double > &vector) const
 Return distance between two vectors.
 
double GetElementsSum () const
 Get simple sum of all elements.
 
bool Normalize (double length=1.0)
 Normalize vector to specified length.
 
bool GetNormalized (TVector< Size, double > &result, double length=1.0) const
 Return normalized vector with the same direction and specified length.
 
void GetMinimal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with minimal elements values.
 
void GetMaximal (const TVector< Size, double > &vector, TVector< Size, double > &result) const
 Get vector with maximal elements values.
 
bool Serialize (iser::IArchive &archive)
 Serialize this vector to specified archive.
 
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* (double scalar) const
 
TVector< Size, double > operator/ (double scalar) const
 
TVector< Size, double > & operator= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator= (TVector< Size, double > &&vector)
 
TVector< Size, double > & operator+= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator-= (const TVector< Size, double > &vector)
 
TVector< Size, double > & operator*= (double scalar)
 
TVector< Size, double > & operator/= (double scalar)
 
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.
 
static bool SetElementsCount (int count)
 Set number of elements.
 
static const TVector< Size, double > & GetZero ()
 Get vector with all coordinates set to 0.
 

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 26 of file CDouble.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 29 of file CDouble.h.

Constructor & Destructor Documentation

◆ CDouble() [1/2]

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

Definition at line 104 of file CDouble.h.

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

◆ CDouble() [2/2]

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

Definition at line 110 of file CDouble.h.

Member Function Documentation

◆ GetRounded() [1/2]

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

Definition at line 266 of file CDouble.h.

◆ GetRounded() [2/2]

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

Get rounded value.

Definition at line 122 of file CDouble.h.

References imath::TVector< 1 >::GetElement(), and GetRounded().

Referenced by GetRounded().

◆ GetRoundedDown() [1/2]

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

Definition at line 282 of file CDouble.h.

◆ GetRoundedDown() [2/2]

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

Get rounded down value with specified precision.

Definition at line 134 of file CDouble.h.

References GetRoundedDown().

Referenced by GetRoundedDown().

◆ GetRoundedUp() [1/2]

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

Definition at line 298 of file CDouble.h.

◆ GetRoundedUp() [2/2]

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

Get rounded down value with specified precision.

Definition at line 146 of file CDouble.h.

References GetRoundedUp().

Referenced by GetRoundedUp().

◆ IsRoundedDownEqual() [1/2]

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

Check if two values are equal after rounding down.

Definition at line 140 of file CDouble.h.

References IsRoundedDownEqual().

Referenced by IsRoundedDownEqual().

◆ IsRoundedDownEqual() [2/2]

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

Definition at line 290 of file CDouble.h.

◆ IsRoundedEqual() [1/2]

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

Check if two values are equal after rounding.

Definition at line 128 of file CDouble.h.

References IsRoundedEqual().

Referenced by IsRoundedEqual().

◆ IsRoundedEqual() [2/2]

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

Definition at line 274 of file CDouble.h.

◆ IsRoundedUpEqual() [1/2]

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

Check if two values are equal after rounding down.

Definition at line 152 of file CDouble.h.

References IsRoundedUpEqual().

Referenced by IsRoundedUpEqual().

◆ IsRoundedUpEqual() [2/2]

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

Definition at line 306 of file CDouble.h.

◆ IsSimiliar() [1/2]

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 158 of file CDouble.h.

References IsSimiliar().

Referenced by IsSimiliar().

◆ IsSimiliar() [2/2]

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

Definition at line 314 of file CDouble.h.

◆ operator double()

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

Definition at line 116 of file CDouble.h.

◆ operator!=()

bool imath::CDouble::operator!= ( const CDouble & value) const
inline

◆ operator*()

CDouble imath::CDouble::operator* ( const CDouble & value) const
inline

◆ operator*=()

const CDouble & imath::CDouble::operator*= ( const CDouble & value)
inline

◆ operator+()

CDouble imath::CDouble::operator+ ( const CDouble & value) const
inline

◆ operator+=()

const CDouble & imath::CDouble::operator+= ( const CDouble & value)
inline

◆ operator-()

CDouble imath::CDouble::operator- ( const CDouble & value) const
inline

◆ operator-=()

const CDouble & imath::CDouble::operator-= ( const CDouble & value)
inline

◆ operator/()

CDouble imath::CDouble::operator/ ( const CDouble & value) const
inline

◆ operator/=()

const CDouble & imath::CDouble::operator/= ( const CDouble & value)
inline

◆ operator<()

bool imath::CDouble::operator< ( const CDouble & value) const
inline

◆ operator<=()

bool imath::CDouble::operator<= ( const CDouble & value) const
inline

◆ operator=()

const CDouble & imath::CDouble::operator= ( const CDouble & value)
inline

◆ operator==()

bool imath::CDouble::operator== ( const CDouble & value) const
inline

◆ operator>()

bool imath::CDouble::operator> ( const CDouble & value) const
inline

◆ operator>=()

bool imath::CDouble::operator>= ( const CDouble & value) const
inline

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

© Witold Gantzke and Kirill Lepskiy