MADNESS 0.10.1
|
#include <tensoriter.h>
Public Member Functions | |
TensorIterator (const Tensor< T > *t0, const Tensor< Q > *t1=0, const Tensor< R > *t2=0, long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) | |
Constructor for general iterator to compose operations over up to three tensors. | |
bool | operator!= (const TensorIterator< T, Q, R > &a) const |
T & | operator* () const |
TensorIterator< T, Q, R > & | operator++ () |
TensorIterator< T, Q, R > * | operator-> () |
bool | operator== (const TensorIterator< T, Q, R > &a) const |
void | reset () |
Reset the iterator back to the start ... | |
void | reuse (const Tensor< T > *t0, const Tensor< Q > *t1=0, const Tensor< R > *t2=0) |
Reuse this iterator to iterate over other Tensors. | |
Public Attributes | |
T * | _p0 |
Q * | _p1 |
R * | _p2 |
long | _s0 |
long | _s1 |
long | _s2 |
long | dim [TENSOR_MAXDIM] |
long | dimj |
long | ind [TENSOR_MAXDIM] |
long | ndim |
long | stride0 [TENSOR_MAXDIM] |
long | stride1 [TENSOR_MAXDIM] |
long | stride2 [TENSOR_MAXDIM] |
Private Attributes | |
T * | _p0_save |
Q * | _p1_save |
R * | _p2_save |
Optimized iterator for tensors supporting unary, binary and ternary operations.
|
inline |
References madness::TensorIterator< T, Q, R >::_p0, and a.
|
inline |
References madness::TensorIterator< T, Q, R >::_p0.
TensorIterator< T, Q, R > & madness::TensorIterator< T, Q, R >::operator++ | ( | ) |
References d.
|
inline |
|
inline |
References madness::TensorIterator< T, Q, R >::_p0, and a.
Reset the iterator back to the start ...
References TENSOR_MAXDIM.
Referenced by madness::inner_result(), and madness::outer_result().
void madness::TensorIterator< T, Q, R >::reuse | ( | const Tensor< T > * | t0, |
const Tensor< Q > * | t1 = 0 , |
||
const Tensor< R > * | t2 = 0 |
||
) |
Reuse this iterator to iterate over other Tensors.
The point of this method is to optimize away the construction of a TensorIterator when applying the same operation repeatedly to multiple tensors with identical shapes & strides. We trust the caller to ensure all shapes & strides match between the new tensors and the ones used in the original constructor.
References madness::Tensor< T >::ptr(), and TENSOR_MAXDIM.
|
private |
|
private |
|
private |
Referenced by madness::inner_result(), and madness::outer_result().
long madness::TensorIterator< T, Q, R >::dim[TENSOR_MAXDIM] |
Referenced by madness::outer_result().
long madness::TensorIterator< T, Q, R >::ind[TENSOR_MAXDIM] |
long madness::TensorIterator< T, Q, R >::stride0[TENSOR_MAXDIM] |
long madness::TensorIterator< T, Q, R >::stride1[TENSOR_MAXDIM] |
long madness::TensorIterator< T, Q, R >::stride2[TENSOR_MAXDIM] |