Go to the documentation of this file.
20 #ifndef TILEDARRAY_RANGE_ITERATOR_H__INCLUDED
21 #define TILEDARRAY_RANGE_ITERATOR_H__INCLUDED
30 template <
typename,
typename>
37 template <
typename T,
typename Container>
42 template <
typename T,
typename Container>
61 template <
typename T,
typename Container>
77 : container_(other.container_), current_(other.current_) {}
84 : container_(c), current_(v, v + c->
rank()) {}
91 current_ = other.current_;
92 container_ = other.container_;
97 const Container*
container()
const {
return container_; }
104 TA_ASSERT(container_->includes(current_));
113 TA_ASSERT(container_->includes(current_));
114 container_->increment(current_);
123 TA_ASSERT(container_->includes(current_));
125 container_->increment(current_);
133 TA_ASSERT(container_->includes(current_));
138 TA_ASSERT(container_->includes(current_));
139 container_->advance(current_, n);
143 TA_ASSERT(container_ == other.container_);
144 TA_ASSERT(container_->includes(current_));
145 return container_->distance_to(current_, other.current_);
149 const Container* container_;
150 typename Container::index_type
153 template <
typename U,
typename C>
160 reference value()
const {
return current_; }
174 template <
typename T,
typename Container>
177 return (left_it.value() == right_it.value()) &&
190 template <
typename T,
typename Container>
195 return !(left_it == right_it);
202 template <
typename T,
typename Container>
210 template <
typename T,
typename Container>
219 #endif // TILEDARRAY_RANGE_ITERATOR_H__INCLUDED
Coordinate index iterate.
const value_type & reference
Iterator reference type.
pointer operator->() const
Pointer operator.
std::input_iterator_tag iterator_category
TiledArray::detail::RangeIterator< T, Container >::difference_type distance(const TiledArray::detail::RangeIterator< T, Container > &, const TiledArray::detail::RangeIterator< T, Container > &)
const value_type * pointer
Iterator pointer type.
RangeIterator_ & operator=(const RangeIterator_ &other)
Copy constructor.
auto rank(const DistArray< Tile, Policy > &a)
void advance(difference_type n)
#define TA_ASSERT(EXPR,...)
difference_type distance_to(const RangeIterator_ &other) const
RangeIterator_ operator++(int)
Increment operator.
void advance(TiledArray::detail::RangeIterator< T, Container > &, typename TiledArray::detail::RangeIterator< T, Container >::difference_type)
const Container * container() const
bool operator==(const TileReference< Impl > &a, const TileReference< Impl > &b)
comparison operator for TileReference objects
std::ptrdiff_t difference_type
Iterator category tag.
reference operator*() const
Dereference operator.
RangeIterator_ & operator++()
Increment operator.
RangeIterator< T, Container > RangeIterator_
This class type.
RangeIterator(const T *v, const Container *c)
Construct an index iterator.
Container::index_type value_type
Iterator value type.
RangeIterator(const RangeIterator_ &other)
Copy constructor.
friend bool operator==(const RangeIterator< U, C > &left_it, const RangeIterator< U, C > &right_it)
bool operator!=(const TileReference< Impl > &a, const TileReference< Impl > &b)
inequality operator for TileReference objects