Detailed Description
template<typename T>
class PVector< T >
Dense numeric vector (templated) used for linear algebra; specialised versions are PIntVector, PFloatVector and PDoubleVector; NOT thread-safe.
It can be used with int32, float and double data types.
#include <PVector.h>
Constructor & Destructor Documentation
◆ PVector() [1/2]
|
explicit |
Constructs vector with N elements set to 0 if array parameter is nullptr.
◆ PVector() [2/2]
Constructs a shared copy of other.
- See also
- Clone()
◆ ~PVector()
Member Function Documentation
◆ Clone()
◆ Fill()
void PVector< T >::Fill | ( | T | t | ) |
Sets all elements to the specified value.
◆ Get()
T PVector< T >::Get | ( | const papillon::int32 | index | ) | const |
Returns the element at the specified index.
Returns an unspecified value if index is outside the valid range (0 .. Size()-1).
◆ GetDataPtr() [1/2]
T* PVector< T >::GetDataPtr | ( | ) |
UNSAFE: Returns a pointer to the internal buffer of this vector.
◆ GetDataPtr() [2/2]
const T* PVector< T >::GetDataPtr | ( | ) | const |
UNSAFE: Returns a pointer to the internal buffer of this vector.
◆ operator=()
Performs a shared copy of other to this object.
- See also
- Clone()
◆ Reset()
void PVector< T >::Reset | ( | ) |
Changes size to empty.
◆ Resize()
void PVector< T >::Resize | ( | papillon::int32 | n | ) |
Changes size while keeping elements.
◆ Set()
void PVector< T >::Set | ( | const papillon::int32 | index, |
T | value | ||
) |
Sets the element at the specified index.
Do nothing if the index is outside the valid range (0 .. Size()-1).
◆ Size()
papillon::int32 PVector< T >::Size | ( | ) | const |
Returns the number of elements in this vector.