|
| SliceTensor (const Tensor< T > &t, const Slice s[]) |
|
| SliceTensor (const Tensor< T > &t, const std::array< Slice, TENSOR_MAXDIM > s) |
|
virtual | ~SliceTensor () |
|
template<class Q > |
SliceTensor< T > & | operator= (const SliceTensor< Q > &t) |
|
SliceTensor< T > & | operator= (const SliceTensor< T > &t) |
|
SliceTensor< T > & | operator= (const T &t) |
|
template<class Q > |
SliceTensor< T > & | operator= (const Tensor< Q > &t) |
|
SliceTensor< T > & | operator= (const Tensor< T > &t) |
|
| Tensor () |
| Default constructor does not allocate any data and sets ndim=-1, size=0, _p=0, and id. More...
|
|
| Tensor (const std::vector< long > &d, bool dozero=true) |
| Create and optionally zero new n-d tensor. This is the most general constructor. More...
|
|
| Tensor (const Tensor< T > &t) |
| Copy constructor is shallow (same as assignment) More...
|
|
| Tensor (long d0) |
| Create and zero new 1-d tensor. More...
|
|
| Tensor (long d0, long d1) |
| Create and zero new 2-d tensor. More...
|
|
| Tensor (long d0, long d1, long d2) |
| Create and zero new 3-d tensor. More...
|
|
| Tensor (long d0, long d1, long d2, long d3) |
| Create and zero new 4-d tensor. More...
|
|
| Tensor (long d0, long d1, long d2, long d3, long d4) |
| Create and zero new 5-d tensor. More...
|
|
| Tensor (long d0, long d1, long d2, long d3, long d4, long d5) |
| Create and zero new 6-d tensor. More...
|
|
| Tensor (long nd, const long d[], bool dozero=true) |
| Politically incorrect general constructor. More...
|
|
virtual | ~Tensor () |
|
scalar_type | absmax (long *ind=0) const |
| Return the absolute maximum value (and if ind is non-null, its index) in the Tensor. More...
|
|
scalar_type | absmin (long *ind=0) const |
| Return the absolute minimum value (and if ind is non-null, its index) in the Tensor. More...
|
|
BaseTensor * | base () |
| Returns a pointer to the base class. More...
|
|
const BaseTensor * | base () const |
| Returns a pointer to the base class. More...
|
|
template<class Q > |
TensorIterator< T, Q > | binary_iterator (const Tensor< Q > &q, long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) const |
| Return iterator over two tensors. More...
|
|
void | clear () |
| Frees all memory and resests to state of default constructor. More...
|
|
template<class Q > |
bool | conforms (const Tensor< Q > &t) const |
| Test if *this and t conform. More...
|
|
Tensor< T > & | conj () |
| Inplace complex conjugate. More...
|
|
Tensor< T > | cycledim (long nshift, long start, long end) |
| Returns new view/tensor cycling the sub-dimensions (start,...,end) with shift steps. More...
|
|
const Tensor< T > | cycledim (long nshift, long start, long end) const |
| Returns new view/tensor cycling the sub-dimensions (start,...,end) with shift steps. More...
|
|
Tensor< T > & | emul (const Tensor< T > &t) |
| Inplace multiply by corresponding elements of argument Tensor. More...
|
|
const TensorIterator< T > & | end () const |
| End point for forward iteration. More...
|
|
Tensor< T > & | fill (T x) |
| Inplace fill with a scalar (legacy name) More...
|
|
Tensor< T > & | fillindex () |
| Inplace fill with the index of each element. More...
|
|
Tensor< T > & | fillrandom () |
| Inplace fill with random values ( [0,1] for floats, [0,MAXSIZE] for integers) More...
|
|
Tensor< T > | flat () |
| Returns new view/tensor rehshaping to flat (1-d) tensor. More...
|
|
const Tensor< T > | flat () const |
| Returns new view/tensor rehshaping to flat (1-d) tensor. More...
|
|
Tensor< T > | fusedim (long i) |
| Returns new view/tensor fusing contiguous dimensions i and i+1 . More...
|
|
const Tensor< T > | fusedim (long i) const |
| Returns new view/tensor fusing contiguous dimensions i and i+1 . More...
|
|
Tensor< T > & | gaxpy (T alpha, const Tensor< T > &t, T beta) |
| Inplace generalized saxpy ... this = this*alpha + other*beta. More...
|
|
bool | has_data () const |
|
Tensor< T > | mapdim (const std::vector< long > &map) |
| Returns new view/tensor permuting the dimensions. More...
|
|
const Tensor< T > | mapdim (const std::vector< long > &map) const |
| Returns new view/tensor permuting the dimensions. More...
|
|
float_complex | max (long *ind) const |
|
double_complex | max (long *ind) const |
|
float_complex | max (long *ind) const |
|
double_complex | max (long *ind) const |
|
T | max (long *ind=0) const |
| Return the maximum value (and if ind is non-null, its index) in the Tensor. More...
|
|
float_complex | min (long *ind) const |
|
double_complex | min (long *ind) const |
|
float_complex | min (long *ind) const |
|
double_complex | min (long *ind) const |
|
T | min (long *ind=0) const |
| Return the minimum value (and if ind is non-null, its index) in the Tensor. More...
|
|
float_scalar_type | normf () const |
| Returns the Frobenius norm of the tensor. More...
|
|
template<class Q > |
| operator Tensor< Q > () const |
| Type conversion makes a deep copy. More...
|
|
T & | operator() (const long ind[]) |
| Politically incorrect general indexing operation without bounds checking. More...
|
|
const T & | operator() (const long ind[]) const |
| Politically incorrect general indexing operation without bounds checking. More...
|
|
SliceTensor< T > | operator() (const Slice &s0) |
| Return a 1d SliceTensor that views the specified range of the 1d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0) const |
| Return a 1d SliceTensor that views the specified range of the 1d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1) |
| Return a 2d SliceTensor that views the specified range of the 2d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, const Slice &s1) const |
| Return a 2d constant Tensor that views the specified range of the 2d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2) |
| Return a 3d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2) const |
| Return a 3d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3) |
| Return a 1-4d SliceTensor that views the specified range of the 4d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3) const |
| Return a 1-4d constant Tensor that views the specified range of the 4d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4) |
| Return a 1-5d SliceTensor that views the specified range of the 5d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4) const |
| Return a 1-5d constant Tensor that views the specified range of the 5d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4, const Slice &s5) |
| Return a 1-6d SliceTensor that views the specified range of the 6d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4, const Slice &s5) const |
| Return a 1-6d constant Tensor that views the specified range of the 6d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, long k) |
| Return a 2d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, long k) const |
| Return a 2d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, long j) |
| Return a 1d SliceTensor that views the specified range of the 2d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, long j) const |
| Return a 1d constant Tensor that views the specified range of the 2d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, long j, const Slice &s2) |
| Return a 2d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, long j, const Slice &s2) const |
| Return a 2d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
SliceTensor< T > | operator() (const Slice &s0, long j, long k) |
| Return a 1d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (const Slice &s0, long j, long k) const |
| Return a 1d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
SliceTensor< T > | operator() (const std::array< Slice, TENSOR_MAXDIM > &s) |
| General slicing operation. More...
|
|
const Tensor< T > | operator() (const std::array< Slice, TENSOR_MAXDIM > &s) const |
| General slicing operation (const) More...
|
|
T & | operator() (const std::vector< long > ind) |
| General indexing operation with bounds checking. More...
|
|
const T & | operator() (const std::vector< long > ind) const |
| General indexing operation with bounds checking. More...
|
|
SliceTensor< T > | operator() (const std::vector< Slice > &s) |
| General slicing operation. More...
|
|
const Tensor< T > | operator() (const std::vector< Slice > &s) const |
| General slicing operation (const) More...
|
|
T & | operator() (long i) |
| 1-d indexing operation without bounds checking. More...
|
|
const T & | operator() (long i) const |
| 1-d indexing operation without bounds checking. More...
|
|
SliceTensor< T > | operator() (long i, const Slice &s1) |
| Return a 1d SliceTensor that views the specified range of the 2d Tensor. More...
|
|
const Tensor< T > | operator() (long i, const Slice &s1) const |
| Return a 1d SliceTensor that views the specified range of the 2d Tensor. More...
|
|
SliceTensor< T > | operator() (long i, const Slice &s1, const Slice &s2) |
| Return a 2d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (long i, const Slice &s1, const Slice &s2) const |
| Return a 2d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
SliceTensor< T > | operator() (long i, const Slice &s1, long k) |
| Return a 1d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (long i, const Slice &s1, long k) const |
| Return a 1d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
T & | operator() (long i, long j) |
| 2-d indexing operation without bounds checking. More...
|
|
const T & | operator() (long i, long j) const |
| 2-d indexing operation without bounds checking. More...
|
|
SliceTensor< T > | operator() (long i, long j, const Slice &s2) |
| Return a 1d SliceTensor that views the specified range of the 3d Tensor. More...
|
|
const Tensor< T > | operator() (long i, long j, const Slice &s2) const |
| Return a 1d constant Tensor that views the specified range of the 3d Tensor. More...
|
|
T & | operator() (long i, long j, long k) |
| 3-d indexing operation without bounds checking. More...
|
|
const T & | operator() (long i, long j, long k) const |
| 3-d indexing operation without bounds checking. More...
|
|
T & | operator() (long i, long j, long k, long l) |
| 4-d indexing operation without bounds checking. More...
|
|
const T & | operator() (long i, long j, long k, long l) const |
| 4-d indexing operation without bounds checking. More...
|
|
T & | operator() (long i, long j, long k, long l, long m) |
| 5-d indexing operation without bounds checking. More...
|
|
const T & | operator() (long i, long j, long k, long l, long m) const |
| 5-d indexing operation without bounds checking. More...
|
|
T & | operator() (long i, long j, long k, long l, long m, long n) |
| 6-d indexing operation without bounds checking. More...
|
|
const T & | operator() (long i, long j, long k, long l, long m, long n) const |
| 6-d indexing operation without bounds checking. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator* (const Q &x) const |
| Multiplication of tensor by a scalar of a supported type to produce a new tensor. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | operator*= (const Q &x) |
| Inplace multiplication by scalar of supported type. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator+ (const Q &x) const |
| Add a scalar of the same type to all elements of a tensor producing a new tensor. More...
|
|
template<typename Q > |
Tensor< TENSOR_RESULT_TYPE(T, Q) > | operator+ (const Tensor< Q > &t) const |
| Addition of two tensors to produce a new tensor. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | operator+= (const Q &x) |
| Inplace increment by scalar of supported type. More...
|
|
template<typename Q > |
Tensor< T > & | operator+= (const Tensor< Q > &t) |
| Inplace addition of two tensors. More...
|
|
Tensor< T > | operator- () const |
| Unary negation producing a new tensor. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator- (const Q &x) const |
| Subtract a scalar of the same type from all elements producing a new tensor. More...
|
|
template<typename Q > |
Tensor< TENSOR_RESULT_TYPE(T, Q) > | operator- (const Tensor< Q > &t) const |
| Subtraction of two tensors to produce a new tensor. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | operator-= (const Q &x) |
| Inplace decrement by scalar of supported type. More...
|
|
template<typename Q > |
Tensor< T > & | operator-= (const Tensor< Q > &t) |
| Inplace subtraction of two tensors. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator/ (const Q &x) const |
| Divide tensor by a scalar of a supported type to produce a new tensor. More...
|
|
Tensor< T > & | operator= (const Tensor< T > &t) |
| Assignment is shallow (same as copy constructor) More...
|
|
Tensor< T > & | operator= (T x) |
| Inplace fill tensor with scalar. More...
|
|
T & | operator[] (long i) |
| 1-d indexing operation using [] without bounds checking. More...
|
|
const T & | operator[] (long i) const |
| 1-d indexing operation using [] without bounds checking. More...
|
|
T | product () const |
| Return the product of all elements of the tensor. More...
|
|
T * | ptr () |
| Returns a pointer to the internal data. More...
|
|
const T * | ptr () const |
| Returns a pointer to the internal data. More...
|
|
Tensor< T > | reshape (const std::vector< long > &d) |
| Returns new view/tensor reshaping size/number of dimensions to conforming tensor. More...
|
|
const Tensor< T > | reshape (const std::vector< long > &d) const |
| Returns new view/tensor reshaping size/number of dimensions to conforming tensor. More...
|
|
Tensor< T > | reshape (int ndimnew, const long *d) |
| Returns new view/tensor reshaping size/number of dimensions to conforming tensor. More...
|
|
const Tensor< T > | reshape (int ndimnew, const long *d) const |
| Returns new view/tensor reshaping size/number of dimensions to conforming tensor. More...
|
|
Tensor< T > | reshape (long dim0) |
| Returns new view/tensor rehapings to conforming 1-d tensor with given dimension. More...
|
|
const Tensor< T > | reshape (long dim0) const |
| Returns new view/tensor rehapings to conforming 1-d tensor with given dimension. More...
|
|
Tensor< T > | reshape (long dim0, long dim1) |
| Returns new view/tensor rehaping to conforming 2-d tensor with given dimensions. More...
|
|
const Tensor< T > | reshape (long dim0, long dim1) const |
| Returns new view/tensor rehaping to conforming 2-d tensor with given dimensions. More...
|
|
Tensor< T > | reshape (long dim0, long dim1, long dim2) |
| Returns new view/tensor rehaping to conforming 3-d tensor with given dimensions. More...
|
|
const Tensor< T > | reshape (long dim0, long dim1, long dim2) const |
| Returns new view/tensor rehaping to conforming 3-d tensor with given dimensions. More...
|
|
Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3) |
| Returns new view/tensor rehaping to conforming 4-d tensor with given dimensions. More...
|
|
const Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3) const |
| Returns new view/tensor rehaping to conforming 4-d tensor with given dimensions. More...
|
|
Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4) |
| Returns new view/tensor rehaping to conforming 5-d tensor with given dimensions. More...
|
|
const Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4) const |
| Returns new view/tensor rehaping to conforming 5-d tensor with given dimensions. More...
|
|
Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4, long dim5) |
| Returns new view/tensor rehaping to conforming 6-d tensor with given dimensions. More...
|
|
const Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4, long dim5) const |
| Returns new view/tensor rehaping to conforming 6-d tensor with given dimensions. More...
|
|
template<typename Q > |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | scale (Q x) |
| Inplace multiplication by scalar of supported type (legacy name) More...
|
|
Tensor< T > & | screen (double x) |
| Inplace set elements of *this less than x in absolute magnitude to zero. More...
|
|
Tensor< T > | splitdim (long i, long dimi0, long dimi1) |
| Returns new view/tensor splitting dimension i as dimi0*dimi1 to produce conforming d+1 dimension tensor. More...
|
|
const Tensor< T > | splitdim (long i, long dimi0, long dimi1) const |
| Returns new view/tensor splitting dimension i as dimi0*dimi1 to produce conforming d+1 dimension tensor. More...
|
|
T | sum () const |
| Returns the sum of all elements of the tensor. More...
|
|
T | sumsq () const |
| Returns the sum of the squares of the elements. More...
|
|
Tensor< T > | swapdim (long idim, long jdim) |
| Returns new view/tensor swaping dimensions i and j . More...
|
|
const Tensor< T > | swapdim (long idim, long jdim) const |
| Returns new view/tensor swaping dimensions i and j . More...
|
|
template<class Q > |
| TENSOR_RESULT_TYPE (T, Q) trace_conj(const Tensor< Q > &t) const |
| Return the trace of two tensors with complex conjugate of the leftmost (i.e., this) More...
|
|
template<class Q , class R > |
TensorIterator< T, Q, R > | ternary_iterator (const Tensor< Q > &q, const Tensor< R > &r, long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) const |
| Return iterator over three tensors. More...
|
|
T | trace (const Tensor< T > &t) const |
| Return the trace of two tensors (no complex conjugate invoked) More...
|
|
TensorIterator< T > | unary_iterator (long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) const |
| Return iterator over single tensor. More...
|
|
template<typename opT > |
Tensor< T > & | unaryop (opT &op) |
| Inplace apply a unary function to each element of the tensor. More...
|
|
| BaseTensor () |
|
virtual | ~BaseTensor () |
|
bool | conforms (const BaseTensor *t) const |
| Returns true if this and *t are the same shape and size. More...
|
|
long | dim (int i) const |
| Returns the size of dimension i . More...
|
|
const long * | dims () const |
| Returns the array of tensor dimensions. More...
|
|
long | id () const |
| Returns the typeid of the tensor (c.f., TensorTypeData<T> ) More...
|
|
bool | iscontiguous () const |
| Returns true if the tensor refers to contiguous memory locations. More...
|
|
long | ndim () const |
| Returns the number of dimensions in the tensor. More...
|
|
long | size () const |
| Returns the number of elements in the tensor. More...
|
|
long | stride (int i) const |
| Returns the stride associated with dimension i . More...
|
|
const long * | strides () const |
| Returns the array of tensor strides. More...
|
|