35#ifndef Foam_MinMaxOps_H
36#define Foam_MinMaxOps_H
61 return range.clamp(val);
131inline MinMax<T>
minMax(
const MinMax<T>&
x,
const MinMax<T>&
y)
145template<
class Form,
class Cmpt, direction nCmpt>
157 for (
const T& val : vals)
179template<
class T1,
class T2>
187template<
class T1,
class T2>
294inline MinMax<T>
operator*(
const MinMax<T>&
x, scalar
s)
296 return MinMax<T>(
x.min()*
s,
x.max()*
s);
310template<
class T,
class U>
311inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
314 return (
range.compare(val) < 0);
317template<
class T,
class U>
318inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
321 return (
range.compare(val) <= 0);
324template<
class T,
class U>
325inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
328 return (
range.compare(val) > 0);
331template<
class T,
class U>
332inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
335 return (
range.compare(val) >= 0);
339template<
class T,
class U>
340inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
343 return (
range.compare(val) > 0);
346template<
class T,
class U>
347inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
350 return (
range.compare(val) >= 0);
353template<
class T,
class U>
354inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
357 return (
range.compare(val) < 0);
360template<
class T,
class U>
361inline std::enable_if_t<std::is_convertible_v<U, T>,
bool>
364 return (
range.compare(val) <= 0);
A min/max value pair with additional methods. In addition to conveniently storing values,...
MinMax< T > & add(const MinMax &other)
Extend the range to include the other 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...
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
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))
dimensioned< scalarMinMax > minMaxMag(const DimensionedField< Type, GeoMesh > &f1, const label comm)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
T clip(const T &val, const MinMax< T > &range)
Return the value after clamping by the min/max limiter.
bool operator<=(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A same or older than B.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
bool operator>=(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A same or newer than B.
MinMax< scalar > scalarMinMax
A scalar min/max range.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
MinMax< label > minMax(const labelHashSet &set)
Find the min/max values of labelHashSet.
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.
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool operator>(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A newer than B.
Unary function for applying component-wise clamping.
clampOp(Foam::zero_one)
Construct as 0-1 min/max range.
T operator()(const T &val) const
clampOp(const MinMax< T > &range)
Construct from min/max range. No validity checks.
clampOp(const T &min, const T &max)
Construct from min/max limits. No validity checks.