Vector.
More...
#include <base/math/Vector.h>
Inherits Object.
template<class TYPE>
class Vector< TYPE >
Vector.
Vector implementation.
- Version
- 1.10
◆ Vector() [1/4]
Initializes vector of the specified size. The elements are not initialized.
- Parameters
-
size | The number of elements in the vector. Must be non zero. |
◆ Vector() [2/4]
template<class TYPE >
Vector< TYPE >::Vector |
( |
const TYPE |
elements[], |
|
|
unsigned int |
size |
|
) |
| |
Initializes vector from the specified array.
- Parameters
-
elements | The desired elements. |
size | The number of elements in the array. |
◆ Vector() [3/4]
Initializes vector from initializer list.
◆ Vector() [4/4]
Initializes vector from other vector.
- Parameters
-
copy | The vector to be copied. |
◆ add()
Adds the specified vector to this vector.
- Parameters
-
value | The vector to be added. |
◆ clear()
Sets this vector to the zero vector.
◆ divide()
Divides this vector with the specified value.
- Parameters
-
◆ dotdot()
template<class TYPE >
TYPE Vector< TYPE >::dotdot |
( |
| ) |
const |
|
noexcept |
Returns the dot product of this vector with itself.
◆ getAt()
template<class TYPE >
const TYPE& Vector< TYPE >::getAt |
( |
unsigned int |
index | ) |
const |
Returns the element at the specified index.
- Parameters
-
index | The index of the desired element. |
◆ getBeginIterator() [1/2]
Returns the first element of the allocator as a non-modifying array.
◆ getBeginIterator() [2/2]
Returns the first element of the allocator as a modifying array.
◆ getElements() [1/2]
template<class TYPE >
TYPE* Vector< TYPE >::getElements |
( |
| ) |
|
|
inlineprotected |
Returns the elements of the vector for modification.
◆ getElements() [2/2]
template<class TYPE >
const TYPE* Vector< TYPE >::getElements |
( |
| ) |
const |
|
inlineprotectednoexcept |
Returns the elements of the vector for read-only.
◆ getEndIterator() [1/2]
Returns the end of the allocator as a non-modifying array.
◆ getEndIterator() [2/2]
Returns the end of the allocator as a modifying array.
◆ getEnumerator()
Returns a modifying enumerator of the array.
◆ getReadEnumerator()
Returns a non-modifying enumerator of the array.
◆ getReadOnlyElements()
template<class TYPE >
const TYPE* Vector< TYPE >::getReadOnlyElements |
( |
| ) |
const |
|
inlineprotectednoexcept |
Returns the elements of the vector for read-only.
◆ getSize()
template<class TYPE >
unsigned int Vector< TYPE >::getSize |
( |
| ) |
const |
|
inlinenoexcept |
Gets the size of the vector.
◆ minus()
◆ multiply()
Multiplies this vector with the specified value.
- Parameters
-
◆ negate() [1/2]
◆ negate() [2/2]
Negates the specified vector and stores the result in this vector.
◆ norm()
template<class TYPE >
TYPE Vector< TYPE >::norm |
( |
| ) |
const |
|
noexcept |
Returns the L2-norm of the vector.
◆ operator*=()
Multiplies this vector with the specified value.
- Parameters
-
◆ operator+()
◆ operator+=()
Adds the specified vector from this vector.
- Parameters
-
value | The value to be added. |
◆ operator-()
◆ operator-=()
Subtracts the specified vector from this vector.
- Parameters
-
value | The value to be subtracted. |
◆ operator/=()
Divides this vector with the specified value.
- Parameters
-
◆ operator=()
Assigns vector to this vector.
- Parameters
-
eq | The vector containing the desired elements. |
◆ operator==()
template<class TYPE >
bool Vector< TYPE >::operator== |
( |
const Vector< TYPE > & |
vector | ) |
const |
Returns true if the vectors are equal.
- Parameters
-
◆ operator[]()
Returns the element at the specified index.
- Parameters
-
index | The index of the desired element. |
◆ plus()
◆ setAt()
template<class TYPE >
void Vector< TYPE >::setAt |
( |
unsigned int |
index, |
|
|
const TYPE & |
value |
|
) |
| |
Sets the element at the specified index.
- Parameters
-
index | The index of the desired element. |
value | The desired value. |
◆ setSize()
template<class TYPE >
void Vector< TYPE >::setSize |
( |
unsigned int |
size | ) |
|
|
inlineprotected |
Sets the size of the vector. Only invocated by constructors.
◆ subtract()
Subtracts the specified vector from this vector.
- Parameters
-
vector | The vector to be subtracted. |
◆ operator<<()
Writes a string representation of a vector object to a format stream.
◆ elements
The elements of the vector stored in an array. The array is guarantied to be non-empty when the vector object has been initialized.