92 #include <type_traits> 100 template<
class T>
class MinMax;
139 inline MinMax(
const T& minVal,
const T& maxVal);
157 inline explicit MinMax(
const T& val);
195 inline T span()
const;
198 inline scalar
mag()
const;
201 inline bool empty()
const;
204 inline bool good()
const;
210 inline void reset(
const T& val);
213 inline void reset(
const T& minVal,
const T& maxVal);
232 inline int compare(
const T& val)
const;
235 inline bool contains(
const T& val)
const;
239 inline T clamp(
const T& val)
const;
255 template<
class... Args>
290 T clip(
const T& val)
const {
return this->
clamp(val); }
301 struct is_contiguous<MinMax<
T>> : std::false_type {};
321 is.readEnd(
"min.max");
329 inline Ostream& operator<<(Ostream& os, const MinMax<T>&
range)
bool intersects(const MinMax< T > &b) const
Test if the ranges intersect (exclusive check)
MinMax< scalar > scalarMinMax
A scalar min/max range.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
A min/max value pair with additional methods. In addition to conveniently storing values...
A traits class, which is primarily used for primitives and vector-space.
Begin list [isseparator].
const T & min() const noexcept
The min value.
bool good() const
Range is non-inverted.
T clip(const T &val) const
Old method name. Same as clamp (2023-01)
static MinMax< T > zero_one()
A 0-1 range corresponding to the pTraits zero, one.
void reset()
Reset to an inverted (invalid) range.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
bool empty() const
Range is empty if it is inverted.
An ordered pair of two objects of type <T> with first() and second() elements.
T clamp(const T &val) const
Return value clamped component-wise.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Istream & operator>>(Istream &, directionInfo &)
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
T value_type
The value type the MinMax represents.
bool valid() const
Range is non-inverted. Same as good (2022-10)
T centre() const
The min/max average value.
MinMax< label > labelMinMax
A label min/max range.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool overlaps(const MinMax< T > &b) const
Test if ranges overlap/touch (inclusive check)
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.
OBJstream os(runTime.globalPath()/outputName)
bool operator()(const T &val) const
Identical to contains(), for use as a predicate.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
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.
Global functions and operators related to the MinMax class. Included by MinMax.H. ...
MinMax< T > & operator*=(scalar s)
Multiply range by scalar factor.
const T & max() const noexcept
The max value.
T span() const
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.
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 for invalid range.
pTraits< T >::cmptType cmptType
Component type.
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< T > & operator/=(scalar s)
Divide range by scalar factor.
bool contains(const T &val) const
True if the value is within the range (inclusive check)
void clear()
Same as reset() - reset to an inverted (invalid) range.
MinMax()
Default construct: an inverted range.