WSF
FidelityRange.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright (C) 2021 Stellar Science; U.S. Government has Unlimited Rights.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef FIDELITY_RANGE_HPP
13#define FIDELITY_RANGE_HPP
14
15#include <cassert>
16
17class UtInput;
18
19namespace wsf
20{
21namespace multiresolution
22{
26{
29 constexpr FidelityRange() = default;
33 constexpr FidelityRange(const double lowerBound, const double upperBound)
34 : mLowerBound(lowerBound)
35 , mUpperBound(upperBound)
36 {
37 }
38
43 bool Contains(const double aValue) const
44 {
45 return (aValue >= mLowerBound && aValue < mUpperBound) || (aValue == 1.0 && mUpperBound == 1.0);
46 }
47
49 bool IsDisjoint(const FidelityRange& rhs) const
50 {
51 return (rhs.mLowerBound < mLowerBound && rhs.mUpperBound <= mLowerBound) ||
53 }
54
56 bool Overlaps(const FidelityRange& rhs) const { return !IsDisjoint(rhs); }
57
58 double mLowerBound = 0.0;
59 double mUpperBound = 1.0;
60};
61
65FidelityRange ProcessFidelityRange(UtInput& aInput);
66
67} // namespace multiresolution
68} // namespace wsf
69
70#endif
Definition ComponentNameHelper.cpp:17
FidelityRange ProcessFidelityRange(UtInput &aInput)
Reads a fidelity range, which is two values in [0, 1], that are sorted in increasing order.
Definition FidelityRange.cpp:20
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
A range of fidelity values defined by a lower bound and upper bound.
Definition FidelityRange.hpp:26
constexpr FidelityRange(const double lowerBound, const double upperBound)
Constructs a FidelityRange with the range lowerBound to upperBound.
Definition FidelityRange.hpp:33
constexpr FidelityRange()=default
Constructs a FidelityRange with the default range of [0, 1].
double mUpperBound
Definition FidelityRange.hpp:59
bool IsDisjoint(const FidelityRange &rhs) const
Definition FidelityRange.hpp:49
bool Overlaps(const FidelityRange &rhs) const
Definition FidelityRange.hpp:56
double mLowerBound
Definition FidelityRange.hpp:58
bool Contains(const double aValue) const
Definition FidelityRange.hpp:43
Copyrights Multiple, All Rights Reserved