|
ACF $AcfVersion:0$
|
Wrapper class for double precision floating-point values with rounding utilities. More...
#include <CDouble.h>
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. | |
| 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 CDouble & | 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) |
Public Member Functions inherited from imath::TVector< 1 > | |
| TVector () | |
| Creates an uninitialized vector. | |
| TVector (const TVector< Size, double > &vector) | |
| Creates a copy of another vector. | |
| TVector (std::initializer_list< double > values) | |
| Creates a vector from an initializer list. | |
| const double & | GetElement (int i) const |
| Gets the element at the specified index (read-only). | |
| double & | GetElementRef (int i) |
| Gets a reference to the element at the specified index (read-write). | |
| void | SetElement (int i, const double &value) |
| Sets the element at the specified index. | |
| void | SetAllElements (const double &value) |
| Sets all elements to the same value. | |
| void | Reset () |
| Sets all coordinates to zero. | |
| void | Clear () |
| Sets all coordinates to zero. | |
| const TVector< Size, double >::Elements & | GetElements () const |
| Get read-only access to internal element container. | |
| TVector< Size, double >::Elements & | GetElementsRef () |
| Get access to internal element container. | |
| void | Translate (const TVector< Size, double > &vector) |
| Translates (adds) another vector to this vector. | |
| TVector< Size, double > | GetTranslated (const TVector< Size, double > &vector) |
| Returns a new vector that is the translation of this vector. | |
| void | GetTranslated (const TVector< Size, double > &vector, TVector< Size, double > &result) |
| Computes the translated vector and stores it in the result parameter. | |
| void | ScaledCumulate (const TVector< Size, double > &vector, double scale) |
| Adds a scaled vector to this vector. | |
| bool | IsNull (double tolerance=I_BIG_EPSILON) const |
| Checks if this vector is null (all elements approximately zero). | |
| double | GetDotProduct (const TVector< Size, double > &vector) const |
| Calculates the dot product with another vector. | |
| double | GetLength2 () const |
| Calculates the squared Euclidean length of the vector. | |
| double | GetLength () const |
| Calculates the Euclidean length (magnitude) of the vector. | |
| double | GetDistance2 (const TVector< Size, double > &vector) const |
| Calculates the squared distance to another vector. | |
| double | GetDistance (const TVector< Size, double > &vector) const |
| Calculates the Euclidean distance to another vector. | |
| double | GetElementsSum () const |
| Calculates the sum of all vector elements. | |
| bool | Normalize (double length=1.0) |
| Normalizes the vector to a specified length. | |
| bool | GetNormalized (TVector< Size, double > &result, double length=1.0) const |
| Returns a normalized copy of this vector with 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 > &vector)=default |
| 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-= (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 |
Wrapper class for double precision floating-point values with rounding utilities.
CDouble provides a convenient wrapper around double precision floating-point values, offering arithmetic operators and specialized rounding/comparison methods. Built on top of TVector<1>, it combines the benefits of vector operations with double-specific functionality for numerical computations requiring controlled precision.
Use CDouble when:
Use raw double when:
| typedef TVector<1> imath::CDouble::BaseClass |
|
inline |
Definition at line 173 of file CDouble.h.
References imath::TVector< 1 >::SetElement().
|
inlinestatic |
|
inline |
Get rounded value.
Definition at line 191 of file CDouble.h.
References imath::TVector< 1 >::GetElement(), and GetRounded().
Referenced by GetRounded().
|
inlinestatic |
|
inline |
Get rounded down value with specified precision.
Definition at line 203 of file CDouble.h.
References GetRoundedDown().
Referenced by GetRoundedDown().
|
inlinestatic |
|
inline |
Get rounded down value with specified precision.
Definition at line 215 of file CDouble.h.
References GetRoundedUp().
Referenced by GetRoundedUp().
|
inline |
Check if two values are equal after rounding down.
Definition at line 209 of file CDouble.h.
References IsRoundedDownEqual().
Referenced by IsRoundedDownEqual().
|
inlinestatic |
|
inline |
Check if two values are equal after rounding.
Definition at line 197 of file CDouble.h.
References IsRoundedEqual().
Referenced by IsRoundedEqual().
|
inlinestatic |
|
inline |
Check if two values are equal after rounding down.
Definition at line 221 of file CDouble.h.
References IsRoundedUpEqual().
Referenced by IsRoundedUpEqual().
|
inlinestatic |
|
inline |
Check if two values are similiar with specified tolerance.
Definition at line 227 of file CDouble.h.
References IsSimiliar().
Referenced by IsSimiliar().
|
inlinestatic |
|
inline |
Definition at line 239 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
Definition at line 281 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
Definition at line 317 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::operator[]().
Definition at line 269 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
Definition at line 301 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::operator[]().
Definition at line 275 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
Definition at line 309 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::operator[]().
Definition at line 287 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
Definition at line 325 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::operator[]().
|
inline |
Definition at line 245 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
|
inline |
Definition at line 257 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
Definition at line 293 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::operator[]().
|
inline |
Definition at line 233 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
|
inline |
Definition at line 251 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().
|
inline |
Definition at line 263 of file CDouble.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< 1 >::GetElement().