![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Implementation of fixed-size mathematical vector with specified type of elements. More...
#include <TVector.h>
Public Types | |
typedef Element | ElementType |
typedef std::array< Element, Size > | Elements |
Public Member Functions | |
TVector () | |
Create an uninitialized point. | |
TVector (const TVector< Size, Element > &vector) | |
Copy constructor. | |
TVector (TVector< Size, Element > &&vector) noexcept | |
Move constructor. | |
const Element & | GetElement (int i) const |
Get element at specified i. | |
Element & | GetElementRef (int i) |
Get reference to element at specified i. | |
void | SetElement (int i, const Element &value) |
Set element at specified i. | |
void | SetAllElements (const Element &value) |
Set some value to all elements. | |
void | Reset () |
Set all coordinates to zero. | |
void | Clear () |
Set all coordinates to zero. | |
const TVector< Size, Element >::Elements & | GetElements () const |
Get read-only access to internal element container. | |
TVector< Size, Element >::Elements & | GetElementsRef () |
Get access to internal element container. | |
void | Translate (const TVector< Size, Element > &vector) |
Translate the point. | |
TVector< Size, Element > | GetTranslated (const TVector< Size, Element > &vector) |
Get translated point. | |
void | GetTranslated (const TVector< Size, Element > &vector, TVector< Size, Element > &result) |
/overloaded | |
void | ScaledCumulate (const TVector< Size, Element > &vector, Element scale) |
Add second vector scaled by specified factor. | |
bool | IsNull (Element tolerance=I_BIG_EPSILON) const |
Check if this vector is null. | |
Element | GetDotProduct (const TVector< Size, Element > &vector) const |
Return dot product of two vectors. | |
Element | GetLength2 () const |
Return euclidian length square. | |
Element | GetLength () const |
Return euclidian length. | |
Element | GetDistance2 (const TVector< Size, Element > &vector) const |
Return distance square between two vectors. | |
Element | GetDistance (const TVector< Size, Element > &vector) const |
Return distance between two vectors. | |
Element | GetElementsSum () const |
Get simple sum of all elements. | |
bool | Normalize (Element length=1.0) |
Normalize vector to specified length. | |
bool | GetNormalized (TVector< Size, Element > &result, Element length=1.0) const |
Return normalized vector with the same direction and specified length. | |
void | GetMinimal (const TVector< Size, Element > &vector, TVector< Size, Element > &result) const |
Get vector with minimal elements values. | |
void | GetMaximal (const TVector< Size, Element > &vector, TVector< Size, Element > &result) const |
Get vector with maximal elements values. | |
bool | Serialize (iser::IArchive &archive) |
Serialize this vector to specified archive. | |
bool | operator== (const TVector< Size, Element > &vector) const |
bool | operator!= (const TVector< Size, Element > &vector) const |
bool | operator< (const TVector< Size, Element > &vector) const |
bool | operator> (const TVector< Size, Element > &vector) const |
bool | operator<= (const TVector< Size, Element > &vector) const |
bool | operator>= (const TVector< Size, Element > &vector) const |
TVector< Size, Element > | operator- () const |
TVector< Size, Element > | operator+ (const TVector< Size, Element > &vector) const |
TVector< Size, Element > | operator- (const TVector< Size, Element > &vector) const |
TVector< Size, Element > | operator* (Element scalar) const |
TVector< Size, Element > | operator/ (Element scalar) const |
TVector< Size, Element > & | operator= (const TVector< Size, Element > &vector) |
TVector< Size, Element > & | operator= (TVector< Size, Element > &&vector) |
TVector< Size, Element > & | operator+= (const TVector< Size, Element > &vector) |
TVector< Size, Element > & | operator-= (const TVector< Size, Element > &vector) |
TVector< Size, Element > & | operator*= (Element scalar) |
TVector< Size, Element > & | operator/= (Element scalar) |
const Element & | operator[] (int i) const |
Element & | operator[] (int i) |
Static Public Member Functions | |
static int | GetElementsCount () |
Get number of elements. | |
static bool | SetElementsCount (int count) |
Set number of elements. | |
static const TVector< Size, Element > & | GetZero () |
Get vector with all coordinates set to 0. | |
Protected Attributes | |
Elements | m_elements |
Implementation of fixed-size mathematical vector with specified type of elements.
std::array<Element, Size> imath::TVector< Size, Element >::Elements |
Element imath::TVector< Size, Element >::ElementType |
|
inline |
|
inline |
Copy constructor.
Definition at line 236 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
Return dot product of two vectors.
Definition at line 353 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Get element at specified i.
Definition at line 252 of file TVector.h.
Referenced by icmm::CLab::GetA(), icmm::CLab::GetB(), icmm::CRgb::GetBlue(), icmm::CCmy::GetC(), icmm::CCmyk::GetC(), icmm::CRgb::GetGreen(), icmm::CHsv::GetHue(), icmm::CCmyk::GetK(), icmm::CLab::GetL(), icmm::CCmy::GetM(), icmm::CCmyk::GetM(), imath::TVector< Size, Element >::GetMaximal(), imath::TVector< Size, Element >::GetMinimal(), icmm::CRgb::GetRed(), icmm::CHsv::GetSaturation(), icmm::CHsv::GetValue(), icmm::CCmy::GetY(), icmm::CCmyk::GetY(), imath::CDouble::operator!=(), imath::CDouble::operator*(), imath::CDouble::operator*=(), imath::CDouble::operator+(), imath::CDouble::operator+=(), imath::CDouble::operator-(), imath::CDouble::operator-=(), imath::CDouble::operator/(), imath::CDouble::operator/=(), imath::CDouble::operator<(), imath::CDouble::operator<=(), imath::CDouble::operator=(), imath::CDouble::operator==(), imath::CDouble::operator>(), and imath::CDouble::operator>=().
|
inline |
|
inline |
|
inlinestatic |
|
inline |
Element imath::TVector< Size, Element >::GetElementsSum | ( | ) | const |
|
inline |
|
inline |
Return euclidian length square.
Definition at line 366 of file TVector.h.
Referenced by i2d::CLine2d::GetAlphaAndCastDistance(), i2d::CLine2d::GetCastAlpha(), and ialgo::CHoughSpace2d::GetSpaceDistance2().
void imath::TVector< Size, Element >::GetMaximal | ( | const TVector< Size, Element > & | vector, |
TVector< Size, Element > & | result ) const |
Get vector with maximal elements values.
Definition at line 713 of file TVector.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< Size, Element >::SetElement().
void imath::TVector< Size, Element >::GetMinimal | ( | const TVector< Size, Element > & | vector, |
TVector< Size, Element > & | result ) const |
Get vector with minimal elements values.
Definition at line 704 of file TVector.h.
References imath::TVector< Size, Element >::GetElement(), and imath::TVector< Size, Element >::SetElement().
bool imath::TVector< Size, Element >::GetNormalized | ( | TVector< Size, Element > & | result, |
Element | length = 1.0 ) const |
Return normalized vector with the same direction and specified length.
length | new vector length. |
Definition at line 684 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
TVector< Size, Element > imath::TVector< Size, Element >::GetTranslated | ( | const TVector< Size, Element > & | vector | ) |
void imath::TVector< Size, Element >::GetTranslated | ( | const TVector< Size, Element > & | vector, |
TVector< Size, Element > & | result ) |
|
inlinestatic |
|
inline |
bool imath::TVector< Size, Element >::Normalize | ( | Element | length = 1.0 | ) |
|
inline |
|
inline |
Definition at line 580 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
|
inline |
Definition at line 554 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Definition at line 497 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Definition at line 541 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Definition at line 567 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Definition at line 508 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Definition at line 593 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
bool imath::TVector< Size, Element >::operator< | ( | const TVector< Size, Element > & | vector | ) | const |
Definition at line 415 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
bool imath::TVector< Size, Element >::operator<= | ( | const TVector< Size, Element > & | vector | ) | const |
Definition at line 447 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
Definition at line 479 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
inline |
|
inline |
Definition at line 396 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
bool imath::TVector< Size, Element >::operator> | ( | const TVector< Size, Element > & | vector | ) | const |
Definition at line 431 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
bool imath::TVector< Size, Element >::operator>= | ( | const TVector< Size, Element > & | vector | ) | const |
Definition at line 463 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
Element & imath::TVector< Size, Element >::operator[] | ( | int | i | ) |
const Element & imath::TVector< Size, Element >::operator[] | ( | int | i | ) | const |
|
inline |
|
inline |
Add second vector scaled by specified factor.
It is equal of Translate(vector * scale) but can be faster implemented.
Definition at line 337 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
bool imath::TVector< Size, Element >::Serialize | ( | iser::IArchive & | archive | ) |
Serialize this vector to specified archive.
Definition at line 722 of file TVector.h.
References iser::IArchive::Process().
|
inline |
|
inline |
Set element at specified i.
Definition at line 266 of file TVector.h.
Referenced by icmm::CCmy::CCmy(), icmm::CCmyk::CCmyk(), icmm::CHsv::CHsv(), icmm::CLab::CLab(), icmm::CRgb::CRgb(), imath::TVector< Size, Element >::GetMaximal(), imath::TVector< Size, Element >::GetMinimal(), icmm::CLab::SetA(), icmm::CLab::SetB(), icmm::CRgb::SetBlue(), icmm::CCmy::SetC(), icmm::CCmyk::SetC(), icmm::CRgb::SetGreen(), icmm::CHsv::SetHue(), icmm::CCmyk::SetK(), icmm::CLab::SetL(), icmm::CCmy::SetM(), icmm::CCmyk::SetM(), icmm::CRgb::SetRed(), icmm::CHsv::SetSaturation(), icmm::CHsv::SetValue(), icmm::CCmy::SetY(), and icmm::CCmyk::SetY().
|
inlinestatic |
|
inline |
Translate the point.
Definition at line 314 of file TVector.h.
References imath::TVector< Size, Element >::m_elements.
|
protected |
Definition at line 218 of file TVector.h.
Referenced by imath::TVector< Size, Element >::GetDotProduct(), imath::TVector< Size, Element >::GetNormalized(), imath::TVector< Size, Element >::operator*(), imath::TVector< Size, Element >::operator+(), imath::TVector< Size, Element >::operator+=(), imath::TVector< Size, Element >::operator-(), imath::TVector< Size, Element >::operator-(), imath::TVector< Size, Element >::operator-=(), imath::TVector< Size, Element >::operator/(), imath::TVector< Size, Element >::operator<(), imath::TVector< Size, Element >::operator<=(), imath::TVector< Size, Element >::operator=(), imath::TVector< Size, Element >::operator==(), imath::TVector< Size, Element >::operator>(), imath::TVector< Size, Element >::operator>=(), imath::TVector< Size, Element >::ScaledCumulate(), imath::TVector< Size, Element >::Translate(), and imath::TVector< Size, Element >::TVector().
© Witold Gantzke and Kirill Lepskiy