13#ifndef __IndexRange_H__
14#define __IndexRange_H__
67template <
int num_dimensions>
76 typedef typename base_type::const_iterator const_iterator;
126 mutable is_regular_type is_regular_range;
135 inline IndexRange(
const int min,
const int max);
139 inline IndexRange(
const int length);
142 inline int get_min_index()
const;
143 inline int get_max_index()
const;
144 inline int get_length()
const;
148 inline bool operator==(
const IndexRange<1>& range2)
const;
156 inline void resize(
const int min_index,
const int max_index);
This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate obj...
inline definitions for the IndexRange class
defines the stir::VectorWithOffset class
class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordi...
Definition BasicCoordinate.h:57
void resize(const int min_index, const int max_index)
resets to new index range
Definition IndexRange.inl:199
bool is_regular() const
checks if the range is 'regular' (always true for the 1d case)
Definition IndexRange.inl:180
size_t size_all() const
return the total number of elements in this range
Definition IndexRange.inl:168
bool get_regular_range(BasicCoordinate< 1, int > &min, BasicCoordinate< 1, int > &max) const
fills in min and max, and returns true
Definition IndexRange.inl:187
size_t size_all() const
return the total number of elements in this range
Definition IndexRange.inl:71
IndexRange(const BasicCoordinate< num_dimensions, int > &min, const BasicCoordinate< num_dimensions, int > &max)
Construct a regular range given by all minimum indices and all maximum indices.
Definition IndexRange.inl:51
IndexRange(const VectorWithOffset< IndexRange< num_dimensions - 1 > > &range)
Make an IndexRange from the base type.
bool is_regular() const
checks if the range is 'regular'
Definition IndexRange.inl:100
bool get_regular_range(BasicCoordinate< num_dimensions, int > &min, BasicCoordinate< num_dimensions, int > &max) const
find regular range, returns false if the range is not regular
Definition IndexRange.cxx:29
IndexRange(const IndexRange< num_dimensions > &range)
Copy constructor.
Definition IndexRange.inl:39
bool operator==(const IndexRange< num_dimensions > &) const
comparison operator
Definition IndexRange.inl:85
IndexRange()
Empty range.
Definition IndexRange.inl:33
IndexRange(const BasicCoordinate< num_dimensions, int > &sizes)
Construct a regular range given by sizes (minimum indices will be 0)
Definition IndexRange.inl:61
base_type::iterator iterator
typedefs such that we do not need to have typename wherever we use iterators
Definition IndexRange.h:75