27 #ifndef MPOTENSOR_DETAIL_H
28 #define MPOTENSOR_DETAIL_H
30 template<
class Matrix,
class SymmGroup>
33 namespace MPOTensor_detail
35 template <
class Matrix,
class SymmGroup>
38 typedef typename Matrix::value_type value_type;
47 template <
class Matrix,
class SymmGroup>
54 template <
class Matrix,
class SymmGroup>
57 typedef typename Matrix::value_type value_type;
66 template <
class Matrix,
class SymmGroup,
typename Scale>
73 template <
class ConstIterator>
76 typedef ConstIterator internal_iterator;
80 typedef typename std::iterator_traits<internal_iterator>::value_type
value_type;
90 throw std::runtime_error(
"direct MPOTensor access via row iterators currently not implemented\n");
95 internal_iterator it_;
98 template <
class ConstIterator>
99 class row_proxy :
public std::pair<ConstIterator, ConstIterator>
101 typedef ConstIterator internal_iterator;
102 typedef std::pair<internal_iterator, internal_iterator> base;
106 row_proxy(internal_iterator b, internal_iterator e) : base(b, e) { }
112 using namespace boost::tuples;
114 template<
class Tuple>
117 bool operator() (Tuple
const & i, Tuple
const & j)
const
119 if (get<0>(i) < get<0>(j))
121 else if (get<0>(i) > get<0>(j))
124 return get<1>(i) < get<1>(j);
128 template<
class Tuple>
131 bool operator() (Tuple
const & i, Tuple
const & j)
const
133 if (get<1>(i) < get<1>(j))
135 else if (get<1>(i) > get<1>(j))
138 return get<0>(i) < get<0>(j);
value_type operator*() const
IteratorWrapper< ConstIterator > self_type
const_term_descriptor< Matrix, SymmGroup > make_const_term_descriptor(block_matrix< Matrix, SymmGroup > const &op_, Scale s_)
IteratorWrapper< ConstIterator > const_iterator
term_descriptor< Matrix, SymmGroup > make_term_descriptor(typename term_descriptor< Matrix, SymmGroup >::op_t &op_, typename Matrix::value_type &s_)
const_iterator end() const
row_proxy(internal_iterator b, internal_iterator e)
IteratorWrapper(internal_iterator i)
const_iterator begin() const
bool operator!=(self_type const &rhs)
const_term_descriptor(op_t const &op_, value_type s_)
term_descriptor(op_t &op_, value_type &s_)
std::iterator_traits< internal_iterator >::value_type value_type