BSplinebasis
|
Represents the Spline's Support. More...
#include <Support.h>
Public Types | |
using | AbsoluteIndex = size_t |
Represents an index relative to the global Grid. | |
using | RelativeIndex = size_t |
Represents an index relative to the Support. | |
using | const_iterator = typename Grid< T >::const_iterator |
The iterator type. | |
Public Member Functions | |
Support (const Grid< T > &grid, AbsoluteIndex startIndex, AbsoluteIndex endIndex) | |
Constructs a Support relative to the global Grid grid. | |
Support (const Support &s) noexcept=default | |
Default copy constructor. | |
Support & | operator= (const Support &s) noexcept=default |
Default copy assignment operator. | |
~Support ()=default | |
Default destructor. | |
Support (Support &&s) noexcept | |
Move constructor. | |
Support & | operator= (Support &&s) noexcept |
Move assignment operator. | |
size_t | size () const |
Returns the number of grid points contained in this Support. | |
bool | empty () const |
Returns whether this Support is empty. | |
bool | containsIntervals () const |
Returns false if this Support is empty or point-like. | |
std::optional< RelativeIndex > | relativeFromAbsolute (AbsoluteIndex index) const |
Converts an AbsoluteIndex into a RelativeIndex. | |
std::optional< RelativeIndex > | intervalIndexFromAbsolute (AbsoluteIndex index) const |
Converts an AbsoluteIndex into a RelativeIndex. | |
AbsoluteIndex | absoluteFromRelative (RelativeIndex index) const |
Converts a RelativeIndex into an AbsoluteIndex. | |
size_t | numberOfIntervals () const |
Returns the number of intervals represented by this Support. | |
const Grid< T > & | getGrid () const |
Returns the global Grid. | |
AbsoluteIndex | getStartIndex () const |
Returns the _startIndex. | |
AbsoluteIndex | getEndIndex () const |
Returns the _endIndex. | |
const T & | operator[] (RelativeIndex index) const |
Returns the indexed element. | |
const T & | at (RelativeIndex index) const |
Returns the indexed element. | |
const T & | front () const |
Returns the begin of this Support. | |
const T & | back () const |
Returns the end of this Support. | |
const_iterator | begin () const |
Returns the begin iterator of the Support. | |
const_iterator | end () const |
Returns the end iterator of the Support. | |
bool | hasSameGrid (const Support &s) const |
Checks whether two Supports are defined on the same Grids. | |
bool | operator== (const Support &s) const |
Logically compares to Supports. | |
bool | operator!= (const Support &s) const |
Logically compares to Supports. | |
Support | calcUnion (const Support &s) const |
Calculates the union of the two Supports. | |
Support | calcIntersection (const Support &s) const |
Calculates the intersection of the two Supports. | |
Static Public Member Functions | |
static Support< T > | createEmpty (const Grid< T > &grid) |
Constructs an empty Support relative to the global Grid grid. | |
static Support< T > | createWholeGrid (const Grid< T > &grid) |
Constructs a Support representing the complete global grid grid. | |
Represents the Spline's Support.
Represents the support of a spline as a set of intervals, represented by the the corresponding grid points. It is essentially a view onto the global Grid.
|
inline |
|
defaultnoexcept |
Default copy constructor.
s | The Support to copy. |
|
inline |
Converts a RelativeIndex into an AbsoluteIndex.
Returns the index relative to the global Grid from an inde relative to this Support.
index | The AbsoluteIndex referring to an interval on the global Grid. |
BSplineException | If the relative index is out of bounds for this Support. |
|
inline |
Returns the indexed element.
Allows access to the grid points contained in the Support. Checks bounds and throws exception in case of out-of-bounds access.
index | Index of the element. |
BSplineException | If the access is out of bounds for this Support. |
|
inline |
Returns the begin iterator of the Support.
Calculates the intersection of the two Supports.
Calculates the intersection of the two Supports.
s | The Support to calculate the intersection with. |
BSplineException | If the two Supports are defined on (logically) different Grids. |
Calculates the union of the two Supports.
Calculates the union of this Support with the Support s. This is not strictly the set-theoretical union (if the two Supports do not overlap), but a Support representing one contiguous bit of the number line containing both Supports.
s | The Support to calculate the union with. |
BSplineException | If the two Supports are defined on (logically) different Grids. |
|
inline |
|
inlinestatic |
Constructs a Support representing the complete global grid grid.
grid | The global grid. |
|
inline |
|
inline |
Returns the end iterator of the Support.
|
inline |
Returns the _endIndex.
|
inline |
Returns the _startIndex.
|
inline |
Converts an AbsoluteIndex into a RelativeIndex.
Returns the index relative to this Support from an index relative to the global Grid. If the global index does not correspond to an interval contained in this Support, std::nullopt is returned.
index | The AbsoluteIndex referring to an interval on the global Grid. |
|
inline |
Logically compares to Supports.
Compares two Supports for inequality. For two Supports two be equal, they have to be defined on the same Grid, must represent the same subset of the number line.
s | Support to compare against. |
Default copy assignment operator.
s | The Support to copy. |
|
inlinenoexcept |
Logically compares to Supports.
Compares two Supports for equality. For two Supports two be equal, they have to be defined on the same Grid, must represent the same subset of the number line.
s | Support to compare against. |
|
inline |
Returns the indexed element.
Allows access to the grid points contained in the Support. Performs no bounds checks.
index | Index of the element. |
|
inline |
Converts an AbsoluteIndex into a RelativeIndex.
Returns the index relative to this Support from an index relative to the global Grid. If the global index does not correspond to a grid point contained in this Support, std::nullopt is returned.
index | The AbsoluteIndex referring to an interval on the global Grid. |
|
inline |