C++QEDCore  v2 Milestone 10
a framework for simulating open quantum dynamics – core
quantumdata::ldo::DiagonalIterator< RANK, V > Class Template Reference

Iterator for slices of a LazyDensityOperator that are diagonal in the dummy indices. More...

#include <LazyDensityOperatorSliceIterator.h>

+ Inheritance diagram for quantumdata::ldo::DiagonalIterator< RANK, V >:
+ Collaboration diagram for quantumdata::ldo::DiagonalIterator< RANK, V >:

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
DiagonalIteratoroperator++ ()
 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.
 

Detailed Description

template<int RANK, typename V>
class quantumdata::ldo::DiagonalIterator< RANK, V >

Iterator for slices of a LazyDensityOperator that are diagonal in the dummy indices.

Cf. rationale

Template Parameters
RANKarity of the full (unsliced) Hilbert space
Vcompile-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.

Member Typedef Documentation

template<int RANK, typename V>
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.

Constructor & Destructor Documentation

template<int RANK, typename V>
template<bool IS_END>
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.

Template Parameters
IS_ENDgoverns the end-ness

The documentation for this class was generated from the following file: