36 constexpr explicit Index(
const MathSize value) noexcept
69 return value_ == rhs.value_;
78 return !(*
this == rhs);
84 [[nodiscard]]
constexpr MathSize
asValue() const noexcept
95 return value_ < rhs.value_;
104 return value_ > rhs.value_;
113 return value_ <= rhs.value_;
122 return value_ >= rhs.value_;
167 :
public Index<LogValue>
174static constexpr LogValue LOG_0_70{-0.35667494393873245};
175static constexpr LogValue LOG_0_75{-0.2876820724517809};
176static constexpr LogValue LOG_0_80{-0.2231435513142097};
177static constexpr LogValue LOG_0_85{-0.16251892949777494};
178static constexpr LogValue LOG_0_90{-0.10536051565782628};
179static constexpr LogValue LOG_1_00{0.0};
182static constexpr LogValue LOG_0_70_CALC{
log(0.7)};
183static constexpr LogValue LOG_0_75_CALC{
log(0.75)};
184static constexpr LogValue LOG_0_80_CALC{
log(0.8)};
185static constexpr LogValue LOG_0_85_CALC{
log(0.85)};
186static constexpr LogValue LOG_0_90_CALC{
log(0.9)};
187static constexpr LogValue LOG_1_00_CALC{
log(1.0)};
188static_assert(abs((LOG_0_70 - LOG_0_70_CALC).asValue()) < numeric_limits<MathSize>::epsilon());
189static_assert(abs((LOG_0_75 - LOG_0_75_CALC).asValue()) < numeric_limits<MathSize>::epsilon());
190static_assert(abs((LOG_0_80 - LOG_0_80_CALC).asValue()) < numeric_limits<MathSize>::epsilon());
191static_assert(abs((LOG_0_90 - LOG_0_90_CALC).asValue()) < numeric_limits<MathSize>::epsilon());
192static_assert(abs((LOG_1_00 - LOG_1_00_CALC).asValue()) < numeric_limits<MathSize>::epsilon());
A wrapper around a MathSize to ensure correct types are used.
Definition Index.h:15
constexpr Index< T > operator-(const Index< T > rhs) const noexcept
Subtraction operator.
Definition Index.h:138
constexpr Index< T > operator+(const Index< T > rhs) const noexcept
Addition operator.
Definition Index.h:129
constexpr MathSize asValue() const noexcept
Returns value as a MathSize.
Definition Index.h:84
constexpr Index< T > & operator-=(const Index< T > rhs) noexcept
Subtraction assignment operator.
Definition Index.h:157
constexpr bool operator<(const Index< T > rhs) const noexcept
Less than operator.
Definition Index.h:93
Index< T > & operator=(Index< T > &&rhs) noexcept=default
Move assignment.
constexpr bool operator>=(const Index< T > rhs) const noexcept
Greater than or equal to operator.
Definition Index.h:120
constexpr Index(Index< T > &&rhs) noexcept=default
Move constructor.
constexpr bool operator<=(const Index< T > rhs) const noexcept
Less than or equal to operator.
Definition Index.h:111
constexpr Index< T > & operator+=(const Index< T > rhs) noexcept
Addition assignment operator.
Definition Index.h:147
constexpr bool operator==(const Index< T > &rhs) const noexcept
Equality operator.
Definition Index.h:67
constexpr bool operator!=(const Index< T > &rhs) const noexcept
Not equals operator.
Definition Index.h:76
constexpr Index(const Index< T > &rhs) noexcept=default
Copy constructor.
constexpr Index(const MathSize value) noexcept
Construct with given value.
Definition Index.h:36
Index< T > & operator=(const Index< T > &rhs) noexcept=default
Copy assignment.
~Index()=default
Destructor.
constexpr bool operator>(const Index< T > rhs) const noexcept
Greater than operator.
Definition Index.h:102
constexpr Index() noexcept
Construct with a value of 0.
Definition Index.h:28
MathSize value_
Value represented by this.
Definition Index.h:19
A result of calling log(x) for some value of x, pre-calculated at compile time.
Definition Index.h:168