47 return operation(opNames[op.
first()], op.
second(), tol);
53 const std::pair<word, scalar>& op,
57 return operation(opNames[op.first], op.second, tol);
69 return (this->
find(value,
pos) >= 0);
75 return this->matchAny(value);
81 for (
const unary& test : *
this)
95 for (
const unary& test : *
this)
103 return (!this->empty());
114 label i = 0,
count = 0;
115 for (
const unary& test : *
this)
136 const label len =
input.size();
141 for (label i=0; i < len; ++i)
159 return this->
found(value);
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as ListOps::find_if.
bool match(const UList< wordRe > &patterns, const std::string &text)
Return true if text matches one of the regular expressions.
void resize(const label len)
Adjust allocated size of list.
bool match(const scalar value) const
Match any condition in the list.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
bool matchAny(const scalar value) const
Match any condition in the list.
bool found(const scalar value, label pos=0) const
True if the value matches any in the list.
dimensionedScalar pos(const dimensionedScalar &ds)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
A class for handling words, derived from Foam::string.
static Istream & input(Istream &is, IntRange< T > &range)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
labelList matching(const scalar value) const
Extract list indices for all matches.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
bool matchAll(const scalar value) const
Match all conditions in the list.
const T2 & second() const noexcept
Access the second element.
bool operator()(const scalar value) const
Identical to found(), match(), for use as a predicate.
std::function< bool(Foam::scalar)> unary
The unary function type for testing a scalar.
static unary operation(const opType op, const scalar opVal, const scalar tol=VSMALL)
Standard comparison method by type.
static const Enum< opType > opNames
Names for the opType enumeration.
const T1 & first() const noexcept
Access the first element.