#include <Tensor.h>
Collaboration diagram for PLearn::TTensor< T >:
Public Types | |
typedef TTensorElementIterator< T > | iterator |
typedef TTensorSubTensorIterator< T > | subTensorIterator |
Public Member Functions | |
TTensor () | |
TTensor (IVec len) | |
TTensor (const IVec &len, const T &init_value) | |
int | resize (const IVec &len) |
don't call this from a subTensor !! | |
int | ndims () const |
IVec | width () const |
IVec | sizes () const |
int | size (int k) const |
int | totalElements () const |
int | linearIndex (const IVec &pos) const |
int | linearIndex (const vector< int > &pos) const |
TTensor< T > | subTensor (const IVec &from, const IVec &len) |
TTensor< T > | DEPRECATEDsubTensor (const IVec &from, const IVec &len, bool throw_useless_dimensions=true) |
TTensor< T > | operator[] (int i) |
void | selectDimensions (const IVec &dim) |
T & | operator() (const IVec &pos) const |
T & | operator() (const vector< int > &pos) const |
void | fill (const T &val) |
T * | data () const |
IVec | lastElementPos () const |
iterator | begin () |
returns an iterator over elements | |
iterator | end () |
subTensorIterator | getSubTensorIterator (const IVec &v) |
returns an iterator over subTensors | |
Protected Attributes | |
int | offset_ |
IVec | stride_ |
IVec | width_ |
PP< Storage< T > > | storage |
Friends | |
class | TTensorElementIterator< T > |
class | TTensorSubTensorIterator< T > |
|
|
|
|
|
|
|
|
|
|
|
returns an iterator over elements
Definition at line 382 of file Tensor.h. References PLearn::IVec, and PLearn::TTensor< T >::ndims(). |
|
Definition at line 363 of file Tensor.h. References PLearn::TTensor< T >::offset_, PLERROR, and PLearn::TTensor< T >::storage. |
|
|
Definition at line 389 of file Tensor.h. References PLearn::TTensor< T >::lastElementPos(). |
|
Definition at line 356 of file Tensor.h. References PLearn::TTensor< T >::fill(), PLearn::TTensor< T >::totalElements(), and val. Referenced by PLearn::TTensor< T >::fill(). |
|
returns an iterator over subTensors
Definition at line 395 of file Tensor.h. References PLearn::TTensor< T >::getSubTensorIterator(). Referenced by PLearn::TTensor< T >::getSubTensorIterator(). |
|
Definition at line 372 of file Tensor.h. References PLearn::TTensor< T >::ndims(), PLearn::TinyVector< T, N, TTrait >::resize(), and PLearn::TTensor< T >::width_. Referenced by PLearn::TTensor< T >::end(). |
|
Definition at line 262 of file Tensor.h. References PLearn::TTensor< T >::ndims(), and PLearn::TTensor< T >::stride_. |
|
Definition at line 254 of file Tensor.h. References PLearn::TTensor< T >::linearIndex(), PLearn::TTensor< T >::ndims(), and PLearn::TTensor< T >::stride_. Referenced by PLearn::TTensor< T >::linearIndex(). |
|
|
Definition at line 354 of file Tensor.h. References PLearn::TTensor< T >::operator()(). |
|
Definition at line 353 of file Tensor.h. References PLearn::TTensor< T >::operator()(). Referenced by PLearn::TTensor< T >::operator()(). |
|
Definition at line 327 of file Tensor.h. References k, PLearn::TTensor< T >::ndims(), PLearn::TTensor< T >::operator[](), and PLearn::TinyVector< T, N, TTrait >::push_back(). Referenced by PLearn::TTensor< T >::operator[](). |
|
don't call this from a subTensor !!
Definition at line 224 of file Tensor.h. References PLearn::TTensor< T >::ndims(), PLearn::TTensor< T >::offset_, PLearn::TinyVector< T, N, TTrait >::resize(), PLearn::TTensor< T >::storage, PLearn::TTensor< T >::stride_, PLearn::TTensor< T >::totalElements(), and PLearn::TTensor< T >::width_. |
|
|
Definition at line 242 of file Tensor.h. References k, PLearn::TTensor< T >::size(), and PLearn::TTensor< T >::width_. Referenced by PLearn::TTensor< T >::size(). |
|
Definition at line 241 of file Tensor.h. References PLearn::TTensor< T >::width_. |
|
Definition at line 274 of file Tensor.h. References PLearn::TinyVector< T, N, TTrait >::empty(), PLearn::TTensor< T >::ndims(), PLearn::TTensor< T >::offset_, PLERROR, PLearn::TinyVector< T, N, TTrait >::push_back(), PLearn::TTensor< T >::selectDimensions(), PLearn::TTensor< T >::subTensor(), and PLearn::TTensor< T >::width_. Referenced by PLearn::TTensor< T >::subTensor(). |
|
Definition at line 244 of file Tensor.h. References PLearn::TTensor< T >::ndims(), and PLearn::TTensor< T >::width_. Referenced by PLearn::TTensor< T >::fill(), and PLearn::TTensor< T >::resize(). |
|
Definition at line 240 of file Tensor.h. References PLearn::TTensor< T >::width_. |
|
|
|
|
|
the displacement to do with respect to storage->data Definition at line 183 of file Tensor.h. Referenced by PLearn::TTensor< T >::data(), PLearn::TTensor< T >::DEPRECATEDsubTensor(), PLearn::TTensor< T >::resize(), and PLearn::TTensor< T >::subTensor(). |
|
where the data is really kept Definition at line 186 of file Tensor.h. Referenced by PLearn::TTensor< T >::data(), and PLearn::TTensor< T >::resize(). |
|
the linear memory displacement, for each dimension, to the next element in the same dimension Definition at line 184 of file Tensor.h. Referenced by PLearn::TTensor< T >::linearIndex(), PLearn::TTensor< T >::resize(), and PLearn::TTensor< T >::selectDimensions(). |
|
the actual widths of each dimensions of the tensor Definition at line 185 of file Tensor.h. Referenced by PLearn::TTensor< T >::DEPRECATEDsubTensor(), PLearn::TTensor< T >::lastElementPos(), PLearn::TTensor< T >::ndims(), PLearn::TTensor< T >::resize(), PLearn::TTensor< T >::selectDimensions(), PLearn::TTensor< T >::size(), PLearn::TTensor< T >::sizes(), PLearn::TTensor< T >::subTensor(), PLearn::TTensor< T >::totalElements(), and PLearn::TTensor< T >::width(). |