LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
22 #ifndef LSST_AFW_MATH_POLYNOMIALS_PackedIndex_h_INCLUDED
23 #define LSST_AFW_MATH_POLYNOMIALS_PackedIndex_h_INCLUDED
25 namespace lsst {
namespace geom {
namespace polynomials {
86 return !(*
this ==
other);
108 index.
ny = index.
nx + 1;
130 index.
nx = index.
ny + 1;
163 template <PackingOrder packing>
176 return order*(order + 1)/2;
186 return computeOffset(nx + ny) + Traits::computeInnerIndex(nx, ny);
211 Traits::increment(_index);
224 return _index ==
other._index;
229 return !(*
this ==
other);
235 _index(
computeOffset(order + 1), Traits::getEndX(order), Traits::getEndY(order))
247 template <PackingOrder packing>
296 constexpr
bool empty() const noexcept {
return size() == 0u; }
300 return _begin ==
other._begin && _end ==
other._end;
305 return !(*
this ==
other);
315 #endif // !LSST_AFW_MATH_POLYNOMIALS_PackedIndex_h_INCLUDED
@ XY
A pair of indices is mapped to the flattened position , which yields the (nx, ny) ordering.
static constexpr std::size_t computeSize(std::size_t order) noexcept
Return the flattened size of an expansion with the given maximum order (inclusive).
std::ptrdiff_t difference_type
constexpr iterator cbegin() const noexcept
Return an iterator to the start of the range.
constexpr Index2d() noexcept
Construct an index with zero entries.
constexpr std::size_t size() const noexcept
Return the number of elements in the flattened expansion.
constexpr bool operator==(PackedIndexRange const &other) const noexcept
Equality comparison.
constexpr Index2d(std::size_t flat_, std::size_t nx_, std::size_t ny_) noexcept
Construct with the provided values.
static constexpr PackedIndexIterator makeEnd(std::size_t order) noexcept
Construct an iterator one past the end of an expansion with the given order.
static void increment(Index2d &index)
constexpr iterator begin() const noexcept
Return an iterator to the start of the range.
PackingOrder
Enum defining the packing orders used to order 2-d polynomial coefficients.
constexpr bool operator!=(PackedIndexRange const &other) const noexcept
Inequality comparison.
typename iterator::reference reference
std::size_t ny
Index into the 1-d functoin for ny.
constexpr bool empty() const noexcept
Return true if the number of elements in the flattened expansion is zero.
typename iterator::value_type value_type
PackedIndexIterator & operator++() noexcept
Move to the next element in the packed array and return the iterator.
static std::size_t computeInnerIndex(std::size_t nx, std::size_t ny)
static std::size_t getEndX(std::size_t order)
An iterator for traversing "packed" triangular 2-d series expansions, in which two 1-d expansions are...
std::size_t nx
Index into the 1-d function for nx.
static std::size_t getEndX(std::size_t order)
A custom tuple that relates the indices of two 1-d functions for x and y to the flattened index for t...
ItemVariant const * other
static constexpr std::size_t computeIndex(std::size_t nx, std::size_t ny) noexcept
Return the flattened index for the element with the given x and y orders.
PackedIndexIterator operator++(int) noexcept
Move to the next element in the packed array and return a copy of the iterator before the move.
Index2d const & reference
static constexpr std::size_t computeIndex(std::size_t nx, std::size_t ny) noexcept
Return the flattened index for the element with the given x and y orders.
constexpr bool operator!=(Index2d const &other) const noexcept
Inequality comparison.
A base class for image defects.
static constexpr std::size_t computeSize(std::size_t order) noexcept
Return the flattened size of an expansion with the given maximum order (inclusive).
A specialized iterator range class for PackedIndexIterator, providing size calculation,...
constexpr reference operator*() const noexcept
Dereference the iterator, yielding a Index2d const reference.
constexpr bool operator!=(PackedIndexIterator const &other) const noexcept
Inequality comparison.
constexpr PackedIndexIterator(std::size_t nx, std::size_t ny) noexcept
Construct an iterator pointing to the element with the given x and y orders.
constexpr bool operator==(Index2d const &other) const noexcept
Equality comparison.
constexpr PackedIndexRange(iterator first, iterator last) noexcept
Construct from begin and end iterators.
static std::size_t getEndY(std::size_t order)
std::size_t flat
Index into the flattened 2-d function.
static void increment(Index2d &index)
static std::size_t getEndY(std::size_t order)
constexpr pointer operator->() const noexcept
Dereference the iterator, yielding a Index2d const pointer.
@ YX
A pair of indices is mapped to the flattened position , which yields the (nx, ny) ordering.
constexpr bool operator==(PackedIndexIterator const &other) const noexcept
Equality comparison.
typename iterator::pointer pointer
static std::size_t computeInnerIndex(std::size_t nx, std::size_t ny)
constexpr iterator cend() const noexcept
Return an iterator to one past the end of the range.
static constexpr std::size_t computeOffset(std::size_t order) noexcept
Return the flattened offset to the start of the given order.
static constexpr std::size_t computeOffset(std::size_t order) noexcept
Return the flattened offset to the start of the given order.
PackedIndexIterator< packing > iterator
typename iterator::difference_type difference_type
constexpr PackedIndexIterator() noexcept
Construct an iterator at the beginning of an expansion of any order.
constexpr iterator end() const noexcept
Return an iterator to one past the end of the range.