4 #ifndef CPPQEDCORE_QUANTUMDATA_LAZYDENSITYOPERATORSLICEITERATOR_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMDATA_LAZYDENSITYOPERATORSLICEITERATOR_H_INCLUDED
7 #include "LazyDensityOperatorFwd.h"
9 #include <boost/operators.hpp>
10 #include <boost/shared_ptr.hpp>
12 #include <boost/mpl/size.hpp>
15 namespace mpl=boost::mpl;
54 #define INPUT_IteratorHelper boost::input_iterator_helper<DiagonalIterator<RANK,V>,const LazyDensityOperator<mpl::size<V>::value> >
69 template<
int RANK,
typename V>
71 :
public INPUT_IteratorHelper
74 typedef INPUT_IteratorHelper Base;
76 #undef INPUT_IteratorHelper
78 typedef typename Base::value_type LazyDensityOperatorRes;
91 DiagonalIterator&
operator++() {impl_->doIncrement();
return *
this;}
93 const LazyDensityOperatorRes&
operator*()
const {
return impl_->dereference();}
95 bool operator==(
const DiagonalIterator& other)
const {
return impl_->isEqualTo(*other.impl_);}
98 static const bool IS_SPECIAL=(RANK==mpl::size<V>::value);
100 class DI_ImplSpecial;
109 typedef boost::shared_ptr<
typename mpl::eval_if_c<
IS_SPECIAL,
110 mpl::identity<DI_ImplSpecial>,
111 mpl::identity<DI_Impl >
125 #endif // CPPQEDCORE_QUANTUMDATA_LAZYDENSITYOPERATORSLICEITERATOR_H_INCLUDED
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.
Comprises classes representing the state of composite quantum systems and providing various interface...
Iterator for slices of a LazyDensityOperator that are diagonal in the dummy indices.
const LazyDensityOperatorRes & operator*() const
”
static const bool IS_SPECIAL
Signifies whether the special implementation is needed.
Common interface for calculating quantum averages.
bool operator==(const DiagonalIterator &other) const
”
DiagonalIterator(const LazyDensityOperator< RANK > &ldo, mpl::bool_< IS_END >)
Constructor.
DiagonalIterator & operator++()
Immediately delegated to the implementation.