![]() |
ICF 3.1.1.10
Technical documentation of ICF Libraries
|
Simple implementation of variable-size vector. More...
#include <CVarVector.h>
Public Types | |
| typedef std::vector< double > | Elements |
Public Member Functions | |
| CVarVector () | |
| Create the vector without components. | |
| CVarVector (int componentsCount, double value=0) | |
| Create vector and initialize number of components. | |
| template<typename iterator > | |
| CVarVector (iterator beginIter, iterator endIter) | |
| Constructor with iterators. | |
| CVarVector (const CVarVector &vector) | |
| Copy constructor. | |
| template<int Size> | |
| CVarVector (const TVector< Size, double > &vector) | |
| bool | IsEmpty () const |
Get true, if the element ist is empty. | |
| int | GetElementsCount () const |
| Get number of elements. | |
| bool | SetElementsCount (int count, double value=0) |
| Set number of elements. | |
| double | GetElement (int index) const |
| Get element at specified index. | |
| double & | GetElementRef (int index) |
| Get reference to element at specified index. | |
| void | SetElement (int index, double value) |
| Set element at specified index. | |
| void | SetAllElements (double value) |
| Set some value to all elements. | |
| void | Reset () |
| Set size to zero. | |
| void | Reset (int elementsCount, double value) |
| Set number of elements and set all elements to specified value. | |
| void | Clear () |
| Set all coordinates to zero. | |
| void | SetElementsFrom (const CVarVector &vector, double expansionValue=0) |
| Set elements from other vector without resizing. | |
| const Elements & | GetElements () const |
| Get read-only access to internal element container. | |
| Elements & | GetElementsRef () |
| Get access to internal element container. | |
| bool | EnsureElementsCount (int count, double value=0) |
| Ensure, that number of elements is at least the specified value. | |
| void | Translate (const CVarVector &vector) |
| Translate the point. | |
| CVarVector | GetTranslated (const CVarVector &vector) |
| Get translated point. | |
| void | GetTranslated (const CVarVector &vector, CVarVector &result) |
| /overloaded | |
| void | ScaledCumulate (const CVarVector &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 CVarVector &vector) const |
| Return dot product of two vectors. | |
| double | GetLength2 () const |
| Return euclidean length square. | |
| double | GetLength () const |
| Return euclidian length. | |
| double | GetDistance2 (const CVarVector &vector) const |
| Return distance square between two vectors. | |
| double | GetDistance (const CVarVector &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 (CVarVector &result, double length=1.0) const |
| Return normalized vector with the same direction and specified length. | |
| void | GetMinimal (const CVarVector &vector, CVarVector &result) const |
| Get vector with minimal elements values. | |
| void | GetMaximal (const CVarVector &vector, CVarVector &result) const |
| Get vector with maximal elements values. | |
| bool | Serialize (iser::IArchive &archive) |
| Serialize this vector to specified archive. | |
| bool | operator== (const CVarVector &vector) const |
| bool | operator!= (const CVarVector &vector) const |
| bool | operator< (const CVarVector &vector) const |
| bool | operator> (const CVarVector &vector) const |
| bool | operator<= (const CVarVector &vector) const |
| bool | operator>= (const CVarVector &vector) const |
| CVarVector | operator- () const |
| CVarVector | operator+ (const CVarVector &vector) const |
| CVarVector | operator- (const CVarVector &vector) const |
| CVarVector | operator* (double scalar) const |
| CVarVector | operator/ (double scalar) const |
| CVarVector & | operator+= (const CVarVector &vector) |
| CVarVector & | operator-= (const CVarVector &vector) |
| CVarVector & | operator*= (double scalar) |
| CVarVector & | operator/= (double scalar) |
| CVarVector & | operator= (const CVarVector &vector) |
| double | operator[] (int i) const |
| double & | operator[] (int i) |
Simple implementation of variable-size vector.
Definition at line 35 of file CVarVector.h.
| std::vector<double> imath::CVarVector::Elements |
Definition at line 38 of file CVarVector.h.
|
inline |
Create the vector without components.
Definition at line 252 of file CVarVector.h.
|
inlineexplicit |
Create vector and initialize number of components.
Definition at line 257 of file CVarVector.h.
|
inline |
Constructor with iterators.
Definition at line 270 of file CVarVector.h.
|
inline |
Copy constructor.
Definition at line 263 of file CVarVector.h.
| imath::CVarVector::CVarVector | ( | const TVector< Size, double > & | vector | ) |
Definition at line 674 of file CVarVector.h.
|
inline |
Set all coordinates to zero.
Definition at line 339 of file CVarVector.h.
References GetElementsCount().
| bool imath::CVarVector::EnsureElementsCount | ( | int | count, |
| double | value = 0 ) |
Ensure, that number of elements is at least the specified value.
It resize the vector if the new size is bigger than the current one.
|
inline |
Return distance between two vectors.
Definition at line 443 of file CVarVector.h.
References GetDistance2().
Referenced by icmm::CVarColor::IsSimilar().
|
inline |
Return distance square between two vectors.
Definition at line 437 of file CVarVector.h.
Referenced by GetDistance().
|
inline |
Return dot product of two vectors.
Definition at line 410 of file CVarVector.h.
References GetElementsCount().
Referenced by GetLength2().
|
inline |
Get element at specified index.
Definition at line 306 of file CVarVector.h.
References operator[]().
Referenced by icmm::CVarColor::IsNormalized(), icmm::CVarColor::operator*(), and icmm::CVarColor::operator/().
|
inline |
Get reference to element at specified index.
Definition at line 312 of file CVarVector.h.
References operator[]().
|
inline |
Get read-only access to internal element container.
Definition at line 358 of file CVarVector.h.
|
inline |
Get number of elements.
Definition at line 284 of file CVarVector.h.
Referenced by Clear(), GetDotProduct(), icmm::CVarColor::IsNormalized(), icmm::CVarColor::operator*(), operator*=(), operator+=(), operator-(), operator-=(), icmm::CVarColor::operator/(), operator/=(), operator=(), operator[](), operator[](), ScaledCumulate(), SetAllElements(), icmm::TComposedColor< Size >::TComposedColor(), and Translate().
|
inline |
Get access to internal element container.
Definition at line 364 of file CVarVector.h.
| double imath::CVarVector::GetElementsSum | ( | ) | const |
Get simple sum of all elements.
|
inline |
|
inline |
Return euclidean length square.
Definition at line 425 of file CVarVector.h.
References GetDotProduct().
Referenced by GetLength(), and IsNull().
| void imath::CVarVector::GetMaximal | ( | const CVarVector & | vector, |
| CVarVector & | result ) const |
Get vector with maximal elements values.
| void imath::CVarVector::GetMinimal | ( | const CVarVector & | vector, |
| CVarVector & | result ) const |
Get vector with minimal elements values.
| bool imath::CVarVector::GetNormalized | ( | CVarVector & | result, |
| double | length = 1.0 ) const |
Return normalized vector with the same direction and specified length.
| length | new vector length. |
|
inline |
Get translated point.
Definition at line 381 of file CVarVector.h.
|
inline |
/overloaded
Definition at line 387 of file CVarVector.h.
|
inline |
Get true, if the element ist is empty.
Definition at line 278 of file CVarVector.h.
|
inline |
| bool imath::CVarVector::Normalize | ( | double | length = 1.0 | ) |
Normalize vector to specified length.
| length | new vector length. |
|
inline |
Definition at line 468 of file CVarVector.h.
References operator==().
|
inline |
Definition at line 633 of file CVarVector.h.
|
inline |
Definition at line 568 of file CVarVector.h.
References GetElementsCount().
Referenced by icmm::CVarColor::operator*=().
|
inline |
Definition at line 613 of file CVarVector.h.
|
inline |
Definition at line 542 of file CVarVector.h.
References GetElementsCount().
|
inline |
Definition at line 599 of file CVarVector.h.
References GetElementsCount().
|
inline |
Definition at line 623 of file CVarVector.h.
|
inline |
Definition at line 555 of file CVarVector.h.
References GetElementsCount().
|
inline |
Definition at line 643 of file CVarVector.h.
|
inline |
Definition at line 579 of file CVarVector.h.
References GetElementsCount().
Referenced by icmm::CVarColor::operator/=().
|
inline |
Definition at line 474 of file CVarVector.h.
|
inline |
Definition at line 508 of file CVarVector.h.
|
inline |
Definition at line 590 of file CVarVector.h.
References GetElementsCount(), SetElementsCount(), and SetElementsFrom().
|
inline |
Definition at line 451 of file CVarVector.h.
Referenced by operator!=().
|
inline |
Definition at line 491 of file CVarVector.h.
|
inline |
Definition at line 525 of file CVarVector.h.
|
inline |
Definition at line 662 of file CVarVector.h.
References GetElementsCount().
|
inline |
Definition at line 653 of file CVarVector.h.
References GetElementsCount().
Referenced by GetElement(), GetElementRef(), and SetElement().
|
inline |
Set size to zero.
Definition at line 333 of file CVarVector.h.
|
inline |
Set number of elements and set all elements to specified value.
Definition at line 348 of file CVarVector.h.
|
inline |
Add second vector scaled by specified factor.
It is equal of Translate(vector * scale) but can be faster implemented.
Definition at line 393 of file CVarVector.h.
References GetElementsCount().
| bool imath::CVarVector::Serialize | ( | iser::IArchive & | archive | ) |
Serialize this vector to specified archive.
|
inline |
Set some value to all elements.
Definition at line 324 of file CVarVector.h.
References GetElementsCount().
|
inline |
Set element at specified index.
Definition at line 318 of file CVarVector.h.
References operator[]().
Referenced by icmm::CVarColor::operator*(), and icmm::CVarColor::operator/().
|
inline |
Set number of elements.
Definition at line 290 of file CVarVector.h.
Referenced by operator=().
| void imath::CVarVector::SetElementsFrom | ( | const CVarVector & | vector, |
| double | expansionValue = 0 ) |
Set elements from other vector without resizing.
| vector | source of element values will be copied. |
| expansionValue | if actual vector has more elements than vector, rest will be replaced with this value. |
Referenced by operator=().
|
inline |
© Witold Gantzke and Kirill Lepskiy