Iterator for slices of a LazyDensityOperator that are diagonal in the dummy indices. More...
#include <LazyDensityOperatorSliceIterator.h>
Public Types | |
typedef boost::shared_ptr< typename mpl::eval_if_c< IS_SPECIAL, mpl::identity< DI_ImplSpecial >, mpl::identity< DI_Impl > >::type > | Impl |
Base class for non-special implementations. More... | |
Public Member Functions | |
template<bool IS_END> | |
DiagonalIterator (const LazyDensityOperator< RANK > &ldo, mpl::bool_< IS_END >) | |
Constructor. More... | |
Necessary members of an input iterator | |
DiagonalIterator & | operator++ () |
Immediately delegated to the implementation. | |
const LazyDensityOperatorRes & | operator* () const |
” | |
bool | operator== (const DiagonalIterator &other) const |
” | |
Static Public Attributes | |
static const bool | IS_SPECIAL =(RANK==mpl::size<V>::value) |
Signifies whether the special implementation is needed. | |
Iterator for slices of a LazyDensityOperator that are diagonal in the dummy indices.
Cf. rationale
RANK | arity of the full (unsliced) Hilbert space |
V | compile-time vector holding the retained index positions (cf. Specifying subsystems) |
It's inherently a const iterator since LazyDensityOperator is immutable. Models an InputIterator, implemented with the help of input_iterator_helper
from Boost.Operator.
Definition at line 70 of file LazyDensityOperatorSliceIterator.h.
typedef boost::shared_ptr<typename mpl::eval_if_c<IS_SPECIAL, mpl::identity<DI_ImplSpecial>, mpl::identity<DI_Impl > >::type > quantumdata::ldo::DiagonalIterator< RANK, V >::Impl |
Base class for non-special implementations.
Pointer to implementation We are using the classical inheritance-based pointer-to-implementation technique, together with some compile-time dispatching. eval_if
from Boost.MPL here guarantees that DI_ImplSpecial
gets instantiated only in the special case
Definition at line 101 of file LazyDensityOperatorSliceIterator.h.
quantumdata::ldo::DiagonalIterator< RANK, V >::DiagonalIterator | ( | const LazyDensityOperator< RANK > & | ldo, |
mpl::bool_< IS_END > | |||
) |
Constructor.
Similarly to blitzplusplus::basi::Iterator, it can be initialised either to the beginning or to the end of the sequence.
IS_END | governs the end-ness |