SpECTRE  2021.08.02
Spectral::Swsh::CoefficientsMetadata::CoefficientsIndexIterator Class Reference

An iterator for easily traversing a libsharp-compatible spin-weighted spherical harmonic modal representation. The operator*() returns a LibsharpCoefficientInfo, which contains two offsets, transform_of_real_part_offset and transform_of_imag_part_offset, and the l_max, l and m associated with the values at those offsets. More...

#include <SwshCoefficients.hpp>

Public Member Functions

 CoefficientsIndexIterator (const size_t l_max, const size_t start_l=0, const size_t start_m=0) noexcept
 
LibsharpCoefficientInfo operator* () const noexcept
 
CoefficientsIndexIteratoroperator++ () noexcept
 advance the iterator by one position (prefix)
 
const CoefficientsIndexIterator operator++ (int) noexcept
 advance the iterator by one position (postfix)
 
CoefficientsIndexIteratoroperator-- () noexcept
 retreat the iterator by one position (prefix)
 
const CoefficientsIndexIterator operator-- (int) noexcept
 retreat the iterator by one position (postfix)
 
bool operator== (const CoefficientsIndexIterator &rhs) const noexcept
 (In)Equivalence checks the object as well as the l and m current position.
 
bool operator!= (const CoefficientsIndexIterator &rhs) const noexcept
 (In)Equivalence checks the object as well as the l and m current position.
 

Detailed Description

An iterator for easily traversing a libsharp-compatible spin-weighted spherical harmonic modal representation. The operator*() returns a LibsharpCoefficientInfo, which contains two offsets, transform_of_real_part_offset and transform_of_imag_part_offset, and the l_max, l and m associated with the values at those offsets.

Note
this currently assumes, as do many of the utilities in this file, that the libsharp representation is chosen to be the triangular coefficient representation. If alternative representations are desired, alterations will be needed.