133 return (0.5 *
min()) + (0.5 *
max());
195 return (a.
min() <
b.max() &&
b.min() < a.
max());
203 return (a.
min() <=
b.max() &&
b.min() <= a.
max());
216 else if (val <
min())
229 return good() && !(val <
min() ||
max() < val);
269 for (
const T& val : vals)
278template<
class... Args>
290 ((*
this += std::forward<Args>(values)), ...);
A min/max value pair with additional methods. In addition to conveniently storing values,...
bool operator()(const T &val) const
Identical to contains(), for use as a predicate.
MinMax< T > & operator&=(const MinMax< T > &b)
Restrict min/max range to union with other range.
bool contains(const T &val) const
True if the value is within the range (inclusive check).
bool empty() const
Range is empty if it is inverted.
T clamp(const T &val) const
Return value clamped component-wise.
MinMax< T > & operator/=(scalar s)
Divide range by scalar factor.
const T & max() const noexcept
The max value.
MinMax< T > & operator*=(scalar s)
Multiply range by scalar factor.
scalar mag() const
The magnitude of the min to max span. Zero for invalid range.
static MinMax< T > le(const T &maxVal)
A semi-infinite range from type min to maxVal.
const T & min() const noexcept
The min value.
bool overlaps(const MinMax< T > &b) const
Test if ranges overlap/touch (inclusive check).
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.
bool good() const
Range is non-inverted.
void reset()
Reset to an inverted (invalid) range.
MinMax< T > & operator+=(const MinMax< T > &b)
Extend min/max range to include other range.
T span() const
The min to max span. Zero for invalid range.
int compare(const T &val) const
Compares the min/max range with the specified value.
MinMax()
Default construct: an inverted range.
bool intersects(const MinMax< T > &b) const
Test if the ranges intersect (exclusive check).
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...
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A traits class, which is primarily used for primitives and vector-space.
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
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))
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)