105#include <type_traits>
113template<
class T>
class MinMax;
147 inline MinMax(
const T& minVal,
const T& maxVal);
159 inline explicit MinMax(
const T& val);
197 inline
T span() const;
200 inline scalar
mag() const;
203 inline
bool empty() const;
206 inline
bool valid() const;
226 inline
int compare(const
T& val) const;
229 inline
bool contains(const
T& val) const;
234 inline const
T&
clip(const
T& val) const;
256 inline
bool operator()(const
T& val) const;
263 inline
MinMax<
T>& operator+=(const
T& val);
269 inline
MinMax<
T>& operator*=(const scalar&
s);
272 inline
MinMax<
T>& operator/=(const scalar&
s);
Global functions and operators related to the MinMax class. Included by MinMax.H.
A min/max value pair with additional methods. In addition to conveniently storing values,...
T value_type
The value type the MinMax represents.
bool valid() const
Range is valid if it is not inverted.
bool contains(const T &val) const
True if the value is within the range.
bool empty() const
Range is empty if it is inverted.
const T & clip(const T &val) const
bool inplaceClip(T &val) const
Inplace clip value by the min/max limits.
const T & max() const noexcept
The max value (second)
scalar mag() const
The magnitude of the min to max span. Zero if the range is invalid.
static MinMax< T > le(const T &maxVal)
A semi-infinite range from type min to maxVal.
const T & min() const noexcept
The min value (first)
bool overlaps(const MinMax< T > &b) const
Test if the ranges overlap.
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
T centre() const
The min/max average value.
void clear()
Reset to an invalid, inverted range.
pTraits< T >::cmptType cmptType
Component type.
T span() const
The min to max span. Zero if the range is invalid.
bool intersect(const MinMax< T > &b)
Intersect (union) with the second range.
int compare(const T &val) const
Compares the min/max range with the specified value.
MinMax()
Construct inverted range.
MinMax< T > & add(const MinMax &other)
Extend the range to include the other min/max range.
static MinMax< T > zero_one()
A 0-1 range corresponding to the pTraits zero, one.
An ordered pair of two objects of type <T> with first() and second() elements.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
MinMax< label > labelMinMax
A label min/max range.
MinMax< scalar > scalarMinMax
A scalar min/max range.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.