|
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 TensorIterator(), _p0, and a.
|
inline |
References _p0.
| TensorIterator< T, Q, R > & madness::TensorIterator< T, Q, R >::operator++ | ( | ) |
|
inline |
References TensorIterator().
|
inline |
References TensorIterator(), _p0, and a.
| void madness::TensorIterator< T, Q, R >::reset | ( | ) |
Reset the iterator back to the start ...
References _p0, _p0_save, _p1, _p1_save, _p2, _p2_save, ind, and 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 _p0, _p0_save, _p1, _p1_save, _p2, _p2_save, ind, madness::Tensor< T >::ptr(), and TENSOR_MAXDIM.
| T* madness::TensorIterator< T, Q, R >::_p0 |
Referenced by TensorIterator(), madness::inner_result(), operator!=(), operator*(), operator++(), operator==(), madness::outer_result(), reset(), and reuse().
|
private |
Referenced by TensorIterator(), reset(), and reuse().
Referenced by TensorIterator(), operator++(), reset(), and reuse().
Referenced by TensorIterator(), reset(), and reuse().
Referenced by TensorIterator(), operator++(), reset(), and reuse().
Referenced by TensorIterator(), reset(), and reuse().
| long madness::TensorIterator< T, Q, R >::_s0 |
Referenced by TensorIterator(), madness::inner_result(), and madness::outer_result().
| long madness::TensorIterator< T, Q, R >::_s1 |
Referenced by TensorIterator().
| long madness::TensorIterator< T, Q, R >::_s2 |
Referenced by TensorIterator().
| long madness::TensorIterator< T, Q, R >::dim[TENSOR_MAXDIM] |
Referenced by TensorIterator(), and operator++().
| long madness::TensorIterator< T, Q, R >::dimj |
Referenced by TensorIterator(), and madness::outer_result().
| long madness::TensorIterator< T, Q, R >::ind[TENSOR_MAXDIM] |
Referenced by TensorIterator(), operator++(), reset(), and reuse().
| long madness::TensorIterator< T, Q, R >::ndim |
Referenced by TensorIterator(), and operator++().
| long madness::TensorIterator< T, Q, R >::stride0[TENSOR_MAXDIM] |
Referenced by TensorIterator(), and operator++().
| long madness::TensorIterator< T, Q, R >::stride1[TENSOR_MAXDIM] |
Referenced by TensorIterator(), and operator++().
| long madness::TensorIterator< T, Q, R >::stride2[TENSOR_MAXDIM] |
Referenced by TensorIterator(), and operator++().