BSplinebasis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
bspline::support::Support< T > Class Template Referencefinal

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.
 
Supportoperator= (const Support &s) noexcept=default
 Default copy assignment operator.
 
 ~Support ()=default
 Default destructor.
 
 Support (Support &&s) noexcept
 Move constructor.
 
Supportoperator= (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< RelativeIndexrelativeFromAbsolute (AbsoluteIndex index) const
 Converts an AbsoluteIndex into a RelativeIndex.
 
std::optional< RelativeIndexintervalIndexFromAbsolute (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 Toperator[] (RelativeIndex index) const
 Returns the indexed element.
 
const Tat (RelativeIndex index) const
 Returns the indexed element.
 
const Tfront () const
 Returns the begin of this Support.
 
const Tback () 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< TcreateEmpty (const Grid< T > &grid)
 Constructs an empty Support relative to the global Grid grid.
 
static Support< TcreateWholeGrid (const Grid< T > &grid)
 Constructs a Support representing the complete global grid grid.
 

Detailed Description

template<typename T>
class bspline::support::Support< T >

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.

Template Parameters
TDatatype of the Grid and Spline.

Member Typedef Documentation

◆ AbsoluteIndex

template<typename T >
using bspline::support::Support< T >::AbsoluteIndex = size_t

Represents an index relative to the global Grid.

Represents an interval relative to the global Grid represented by _grid.

◆ RelativeIndex

template<typename T >
using bspline::support::Support< T >::RelativeIndex = size_t

Represents an index relative to the Support.

Represents an interval relative to the intervals contained in this Support.

Constructor & Destructor Documentation

◆ Support() [1/3]

template<typename T >
bspline::support::Support< T >::Support ( const Grid< T > &  grid,
AbsoluteIndex  startIndex,
AbsoluteIndex  endIndex 
)
inline

Constructs a Support relative to the global Grid grid.

Parameters
gridThe global Grid.
startIndexThe index of the first grid point which is part of the Support.
endIndexThe index of the element behind the last grid point which is part of the Support.

◆ Support() [2/3]

template<typename T >
bspline::support::Support< T >::Support ( const Support< T > &  s)
defaultnoexcept

Default copy constructor.

Parameters
sThe Support to copy.

◆ Support() [3/3]

template<typename T >
bspline::support::Support< T >::Support ( Support< T > &&  s)
inlinenoexcept

Move constructor.

Move constructor. Leaves the moved-from object as an empty Support relative to the same Grid.

Parameters
sThe Support to move.

Member Function Documentation

◆ absoluteFromRelative()

template<typename T >
AbsoluteIndex bspline::support::Support< T >::absoluteFromRelative ( RelativeIndex  index) const
inline

Converts a RelativeIndex into an AbsoluteIndex.

Returns the index relative to the global Grid from an inde relative to this Support.

Parameters
indexThe AbsoluteIndex referring to an interval on the global Grid.
Exceptions
BSplineExceptionIf the relative index is out of bounds for this Support.
Returns
The absolute index corresponding to the relative index.

◆ at()

template<typename T >
const T & bspline::support::Support< T >::at ( RelativeIndex  index) const
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.

Parameters
indexIndex of the element.
Exceptions
BSplineExceptionIf the access is out of bounds for this Support.
Returns
A reference to the element represented by index. Bounds are not checked.

◆ back()

template<typename T >
const T & bspline::support::Support< T >::back ( ) const
inline

Returns the end of this Support.

Returns a reference to the last grid point that is part of the Support.

Exceptions
BSplineExceptionIf this Support is empty.
Returns
A reference to the last grid point contained in this Support.

◆ begin()

template<typename T >
const_iterator bspline::support::Support< T >::begin ( ) const
inline

Returns the begin iterator of the Support.

Returns
An iterator to the first element.

◆ calcIntersection()

template<typename T >
Support bspline::support::Support< T >::calcIntersection ( const Support< T > &  s) const
inline

Calculates the intersection of the two Supports.

Calculates the intersection of the two Supports.

Parameters
sThe Support to calculate the intersection with.
Exceptions
BSplineExceptionIf the two Supports are defined on (logically) different Grids.
Returns
The Support representing the intersection of the two Supports.

◆ calcUnion()

template<typename T >
Support bspline::support::Support< T >::calcUnion ( const Support< T > &  s) const
inline

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.

Parameters
sThe Support to calculate the union with.
Exceptions
BSplineExceptionIf the two Supports are defined on (logically) different Grids.
Returns
The Support representing the union of the two Supports.

◆ containsIntervals()

template<typename T >
bool bspline::support::Support< T >::containsIntervals ( ) const
inline

Returns false if this Support is empty or point-like.

Checks whether the Support contains any intervals. The number of intervals is the number of grid points minus one (size() - 1).

Returns
false if the Support is empty or point-like, true otherwise.

◆ createEmpty()

template<typename T >
static Support< T > bspline::support::Support< T >::createEmpty ( const Grid< T > &  grid)
inlinestatic

Constructs an empty Support relative to the global Grid grid.

Parameters
gridThe global Grid.

◆ createWholeGrid()

template<typename T >
static Support< T > bspline::support::Support< T >::createWholeGrid ( const Grid< T > &  grid)
inlinestatic

Constructs a Support representing the complete global grid grid.

Parameters
gridThe global grid.

◆ empty()

template<typename T >
bool bspline::support::Support< T >::empty ( ) const
inline

Returns whether this Support is empty.

Checks whether the number of grid points contained in the Support is zero.

Returns
True if this Support contains no grid points, false otherwise.

◆ end()

template<typename T >
const_iterator bspline::support::Support< T >::end ( ) const
inline

Returns the end iterator of the Support.

Returns
An iterator pointing behind the last element.

◆ front()

template<typename T >
const T & bspline::support::Support< T >::front ( ) const
inline

Returns the begin of this Support.

Returns a reference to the first grid point that is part of the Support.

Exceptions
BSplineExceptionIf this Support is empty.
Returns
A reference to the first grid point contained in this Support.

◆ getEndIndex()

template<typename T >
AbsoluteIndex bspline::support::Support< T >::getEndIndex ( ) const
inline

Returns the _endIndex.

Returns
The end index.

◆ getGrid()

template<typename T >
const Grid< T > & bspline::support::Support< T >::getGrid ( ) const
inline

Returns the global Grid.

Returns
A reference to the global Grid.

◆ getStartIndex()

template<typename T >
AbsoluteIndex bspline::support::Support< T >::getStartIndex ( ) const
inline

Returns the _startIndex.

Returns
The start index.

◆ hasSameGrid()

template<typename T >
bool bspline::support::Support< T >::hasSameGrid ( const Support< T > &  s) const
inline

Checks whether two Supports are defined on the same Grids.

Checks whether the global Grids, the two Supports are defined on, are logically equivalent.

Parameters
sSupport to check against.
Returns
True if the Support s is defined on a logically equivalent Grid, false otherwise.

◆ intervalIndexFromAbsolute()

template<typename T >
std::optional< RelativeIndex > bspline::support::Support< T >::intervalIndexFromAbsolute ( AbsoluteIndex  index) const
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.

Parameters
indexThe AbsoluteIndex referring to an interval on the global Grid.
Returns
The relative index if the corresponding interval is part of this Support, std::nullopt else.

◆ numberOfIntervals()

template<typename T >
size_t bspline::support::Support< T >::numberOfIntervals ( ) const
inline

Returns the number of intervals represented by this Support.

Returns
The number of intervals contained in this Support.

◆ operator!=()

template<typename T >
bool bspline::support::Support< T >::operator!= ( const Support< T > &  s) const
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.

Parameters
sSupport to compare against.
Returns
False it the two Supports are logically equivalent, true otherwise.

◆ operator=() [1/2]

template<typename T >
Support & bspline::support::Support< T >::operator= ( const Support< T > &  s)
defaultnoexcept

Default copy assignment operator.

Parameters
sThe Support to copy.

◆ operator=() [2/2]

template<typename T >
Support & bspline::support::Support< T >::operator= ( Support< T > &&  s)
inlinenoexcept

Move assignment operator.

Move assignment operator. Leaves the moved-from object as an empty Support relative to the same Grid.

Parameters
sThe Support to move.

◆ operator==()

template<typename T >
bool bspline::support::Support< T >::operator== ( const Support< T > &  s) const
inline

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.

Parameters
sSupport to compare against.
Returns
True it the two Supports are logically equivalent, false otherwise.

◆ operator[]()

template<typename T >
const T & bspline::support::Support< T >::operator[] ( RelativeIndex  index) const
inline

Returns the indexed element.

Allows access to the grid points contained in the Support. Performs no bounds checks.

Parameters
indexIndex of the element.
Returns
A reference to the element represented by index. Bounds are not checked.

◆ relativeFromAbsolute()

template<typename T >
std::optional< RelativeIndex > bspline::support::Support< T >::relativeFromAbsolute ( AbsoluteIndex  index) const
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.

Parameters
indexThe AbsoluteIndex referring to an interval on the global Grid.
Returns
The relative index if the corresponding grid point is part of this Support, std::nullopt else.

◆ size()

template<typename T >
size_t bspline::support::Support< T >::size ( ) const
inline

Returns the number of grid points contained in this Support.

Returns
The number of grid points contained in this Support.

The documentation for this class was generated from the following file: