#include <Tensor.hpp>
|
| Tensor () |
|
| Tensor (const std::vector< unsigned > dims) |
|
| Tensor (const std::vector< unsigned > dims, const std::vector< T > data) |
|
| Tensor (const std::vector< unsigned > dims, const T &defaultValue) |
|
| Tensor (const Tensor< T > &other) |
|
T & | operator() (const int i) const |
|
T & | operator() (const int row, const int col) const |
|
T & | operator() (const int row, const int col, const int offset) const |
|
Tensor< T > & | operator= (const Tensor< T > &rhs) |
|
const unsigned | getSize () const |
|
const std::vector< unsigned > | getDims () const |
|
Creates a n-dimensional Tensor.
- Parameters
-
[in] | dims | list that defines the dimensions of this Tensor |
template<typename T>
Tensor< T >::Tensor |
( |
const std::vector< unsigned > |
dims, |
|
|
const std::vector< T > |
data |
|
) |
| |
Creates a tensor from an existing array.
- Parameters
-
[in] | dims | list that defines the dimensions of this Tensor |
[in] | data | pointer to existing array |
template<typename T>
Tensor< T >::Tensor |
( |
const std::vector< unsigned > |
dims, |
|
|
const T & |
defaultValue |
|
) |
| |
Creates a n-dimensional Tensor and sets entries to a default Value.
- Parameters
-
[in] | dims | list that defines the dimensions of this Tensor |
[in] | defaultValue | default value for all entries |
Creates a deep copy of a given Tensor.
- Parameters
-
template<typename T >
const std::vector< unsigned > Tensor< T >::getDims |
( |
| ) |
const |
List of dimension of this Tensor.
- Returns
- std::vector<unsigned> list of dimensions
template<typename T >
const unsigned Tensor< T >::getSize |
( |
| ) |
const |
Total number of elements that can be stored in this tensor.
- Returns
- unsigned size of the internal data structure.
template<typename T >
T & Tensor< T >::operator() |
( |
const int |
i | ) |
const |
|
inline |
One dimensional array access (list index)
- Parameters
-
- Returns
- T& data at given index
template<typename T >
T & Tensor< T >::operator() |
( |
const int |
row, |
|
|
const int |
col |
|
) |
| const |
|
inline |
Two dimensional array access (matrix)
- Parameters
-
- Returns
- T& data at given position
template<typename T >
T & Tensor< T >::operator() |
( |
const int |
row, |
|
|
const int |
col, |
|
|
const int |
offset |
|
) |
| const |
|
inline |
Three dimensional array access (3D matrix)
- Parameters
-
[in] | row | |
[in] | col | |
[in] | offset | |
- Returns
- T& data at given position
This operator does NOT copy data but points to the assigned object's data.
- Note
- Tensor does not check integrity of internal data which could lead logic errors when multiple instances point to the same data
- Parameters
-
rhs | object used to assign to this instance |
- Returns
- Tensor<T>& this instance
The documentation for this class was generated from the following files: