109 return this->first();
116 return this->first();
123 return this->second();
130 return this->second();
138 return (0.5 *
min()) + (0.5 *
max());
199 return (a.
min() <
b.max() &&
b.min() < a.
max());
207 return (a.
min() <=
b.max() &&
b.min() <= a.
max());
220 else if (val <
min())
233 return good() && !(val <
min() ||
max() < val);
246 else if (
max() < val)
266 else if (
max() < val)
298 for (
const T& val : vals)
311 return contains(val);
bool intersects(const MinMax< T > &b) const
Test if the ranges intersect (exclusive check)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A min/max value pair with additional methods. In addition to conveniently storing values...
A traits class, which is primarily used for primitives.
const T & clip(const T &val) const
If out of range, return the respective min/max limits, otherwise return the value itself...
bool good() const
Range is non-inverted.
static MinMax< T > zero_one()
A 0-1 range corresponding to the pTraits zero, one.
void reset()
Reset to an inverted (invalid) range.
const T & min() const noexcept
The min value (first)
bool empty() const
Range is empty if it is inverted.
An ordered pair of two objects of type <T> with first() and second() elements.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
bool inplaceClip(T &val) const
Inplace clip value by the min/max limits.
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.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
MinMax< T > & operator/=(const scalar &s)
Divide range by scalar factor.
bool overlaps(const MinMax< T > &b) const
Test if ranges overlap/touch (inclusive check)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
MinMax< T > & operator &=(const MinMax< T > &b)
Restrict min/max range to union with other range.
MinMax< T > & add(const MinMax &other)
Extend the range to include the other min/max range.
bool operator()(const T &val) const
Identical to contains(), for use as a predicate.
int compare(const T &val) const
Compares the min/max range with the specified value.
MinMax< T > & operator+=(const MinMax< T > &b)
Extend min/max range to include other range.
const T & max() const noexcept
The max value (second)
T span() const
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.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
scalar mag() const
The magnitude of the min to max span. Zero if the range is invalid.
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))
bool contains(const T &val) const
True if the value is within the range (inclusive check)
MinMax()
Construct inverted range.
MinMax< T > & operator*=(const scalar &s)
Multiply range by scalar factor.
static constexpr const zero Zero
Global zero (0)