WSF
wsf::multiresolution::FidelityRange Struct Reference

A range of fidelity values defined by a lower bound and upper bound. More...

#include <FidelityRange.hpp>

Public Member Functions

constexpr FidelityRange ()=default
 Constructs a FidelityRange with the default range of [0, 1].
constexpr FidelityRange (const double lowerBound, const double upperBound)
 Constructs a FidelityRange with the range lowerBound to upperBound.
bool Contains (const double aValue) const
bool IsDisjoint (const FidelityRange &rhs) const
bool Overlaps (const FidelityRange &rhs) const

Public Attributes

double mLowerBound = 0.0
double mUpperBound = 1.0

Detailed Description

A range of fidelity values defined by a lower bound and upper bound.

Precondition
It is required that the lower and upper bounds are in ascending order, even if not currently enforced.

Constructor & Destructor Documentation

◆ FidelityRange() [1/2]

wsf::multiresolution::FidelityRange::FidelityRange ( )
constexprdefault

Constructs a FidelityRange with the default range of [0, 1].

Note
This can be removed in C++14.

Referenced by IsDisjoint(), and Overlaps().

◆ FidelityRange() [2/2]

wsf::multiresolution::FidelityRange::FidelityRange ( const double lowerBound,
const double upperBound )
inlineconstexpr

Constructs a FidelityRange with the range lowerBound to upperBound.

Precondition
lowerBound must be less than upperBound.
Note
This is defined so that in-class initializers can be used. This can be removed in C++14.

References mLowerBound, and mUpperBound.

Member Function Documentation

◆ Contains()

bool wsf::multiresolution::FidelityRange::Contains ( const double aValue) const
inline
Returns
true if aValue falls within the lower and upper bounds, inclusive of the lower bound and exclusive of the upper bound.
Note
Special handling is used for the case when aValue and the upper bound are both 1. Returns true in this case.

References mLowerBound, and mUpperBound.

◆ IsDisjoint()

bool wsf::multiresolution::FidelityRange::IsDisjoint ( const FidelityRange & rhs) const
inline
Returns
true if rhs does not overlap with this object. The two ranges are considered disjoint if one has a lower bound equal to the other's upper bound.

References FidelityRange(), mLowerBound, and mUpperBound.

Referenced by Overlaps().

◆ Overlaps()

bool wsf::multiresolution::FidelityRange::Overlaps ( const FidelityRange & rhs) const
inline
Returns
true if the ranges defined in rhs and this object overlap. The two ranges do not overlap if one has a lower bound equal to the other's upper bound.

References FidelityRange(), and IsDisjoint().

Member Data Documentation

◆ mLowerBound

double wsf::multiresolution::FidelityRange::mLowerBound = 0.0

◆ mUpperBound

double wsf::multiresolution::FidelityRange::mUpperBound = 1.0

The documentation for this struct was generated from the following file:
Copyrights Multiple, All Rights Reserved