Go to the documentation of this file.
41 { opType::EQUAL,
"eq" },
42 { opType::EQUAL,
"equal" },
43 { opType::NOT_EQUAL,
"neq" },
44 { opType::NOT_EQUAL,
"notEqual" },
45 { opType::LESS,
"lt" },
46 { opType::LESS,
"less" },
47 { opType::LESS_EQ,
"le" },
48 { opType::LESS_EQ,
"lessEq" },
49 { opType::GREATER,
"gt" },
50 { opType::GREATER,
"greater" },
51 { opType::GREATER_EQ,
"ge" },
52 { opType::GREATER_EQ,
"greaterEq" },
60 const enum predicates::scalars::opType op,
61 const Foam::scalar opVal,
62 const Foam::scalar tol
70 case opType::NOT_EQUAL:
82 case opType::GREATER_EQ:
101 template<
class Container,
class Get0>
104 const Container& entries,
108 for (
const auto&
entry : entries)
121 template<
class Error,
class Container,
class Get0,
class Get1>
125 const Container& entries,
134 for (
const auto&
entry : entries)
144 <<
"Entries with unknown operations:" <<
nl
149 for (
const auto&
entry : entries)
151 const bool bad = badIndices.
found(idx);
162 err <<
'(' << get0(
entry) <<
' ' << get1(
entry) <<
')';
183 std::initializer_list<std::pair<word, scalar>> entries
190 [](
const std::pair<word,scalar>&
entry) {
return entry.first; };
192 [](
const std::pair<word,scalar>&
entry) {
return entry.second; };
204 for (
const auto&
entry : entries)
235 for (
const auto&
entry : entries)
259 const label len = this->size();
267 if ((*
this)[
pos](value))
287 if (pos < 0 || pos >= this->size())
289 pos = this->size()-1;
294 if ((*
this)[
pos](value))
328 list.
resize(entries.size());
A keyword and a list of tokens is an 'entry'.
scalars(std::initializer_list< std::pair< word, scalar >> entries)
Construct from an initializer list of (opName opValue) tuples.
static unary greaterEqOp(const scalar opVal)
Test if value is 'greater_equal' to prescribed.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
static const Enum< opType > opNames
Names for the opType enumeration.
opType
Enumerations for some standard comparison predicates.
A list of unary predicates (tests) on scalars. Includes a number of standard comparison predicates (e...
Istream & operator>>(Istream &, directionInfo &)
static bool hasBadEntries(const Container &entries, const Get0 &get0)
static unary greaterOp(const scalar opVal)
label find(const scalar value, label pos=0) const
Index of the first match for the value.
label rfind(const scalar value, label pos=-1) const
Index of the last match for the value.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static unary falseOp()
Predicate that always returns false.
static unary notEqualOp(const scalar opVal, const scalar tol=VSMALL)
Compare for inequality, with specified tolerance (non-negative)
static unary trueOp()
Predicate that always returns true.
void resize(const label newSize)
Adjust allocated size of list.
static unary lessEqOp(const scalar opVal)
Test if value is 'less_equal' to prescribed.
static unary equalOp(const scalar opVal, const scalar tol=VSMALL)
Compare for equality, with specified tolerance (non-negative)
static unary lessOp(const scalar opVal)
Test if value is 'less' than prescribed.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static unary operation(const opType op, const scalar opVal, const scalar tol=VSMALL)
Standard comparison method by type.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static Error & printBadEntries(Error &err, const Container &entries, const Get0 &get0, const Get1 &get1)
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
bool found(const Key &key) const
Return true if hashed entry is found in table.
std::function< bool(Foam::scalar)> unary
The unary function type for testing a scalar.
dimensionedScalar pos(const dimensionedScalar &ds)