ra4_draw
4bd0201e3d922d42bd545d4b045ed44db33454a4
|
#include "core/named_func.hpp"
#include <iostream>
#include <utility>
#include "core/utilities.hpp"
#include "core/function_parser.hpp"
Go to the source code of this file.
Namespaces | |
anonymous_namespace{named_func.cpp} | |
Typedefs | |
using | ScalarType = NamedFunc::ScalarType |
using | VectorType = NamedFunc::VectorType |
using | ScalarFunc = NamedFunc::ScalarFunc |
using | VectorFunc = NamedFunc::VectorFunc |
Functions | |
template<typename Operator > | |
function< ScalarFunc > | anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &f, const Operator &op) |
Get a functor applying unary operator op to f. More... | |
template<typename Operator > | |
function< VectorFunc > | anonymous_namespace{named_func.cpp}::ApplyOp (const function< VectorFunc > &f, const Operator &op) |
Get a functor applying unary operator op to f. More... | |
template<typename Operator > | |
pair< function< ScalarFunc >, function< VectorFunc > > | anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &sfa, const function< VectorFunc > &vfa, const function< ScalarFunc > &sfb, const function< VectorFunc > &vfb, const Operator &op) |
Get a functor applying binary operator op to operands (sfa or vfa) and (sfb or vfb) More... | |
template<> | |
pair< function< ScalarFunc >, function< VectorFunc > > | anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &sfa, const function< VectorFunc > &vfa, const function< ScalarFunc > &sfb, const function< VectorFunc > &vfb, const logical_and< ScalarType > &) |
Get a functor applying binary "&&" to operands (sfa or vfa) and (sfb or vfb) More... | |
template<> | |
pair< function< ScalarFunc >, function< VectorFunc > > | anonymous_namespace{named_func.cpp}::ApplyOp (const function< ScalarFunc > &sfa, const function< VectorFunc > &vfa, const function< ScalarFunc > &sfb, const function< VectorFunc > &vfb, const logical_or< ScalarType > &) |
Get a functor applying binary "||" to operands (sfa or vfa) and (sfb or vfb) More... | |
NamedFunc | operator+ (NamedFunc f, NamedFunc g) |
Add two NamedFuncs. More... | |
NamedFunc | operator- (NamedFunc f, NamedFunc g) |
Add a NamedFunc from another. More... | |
NamedFunc | operator* (NamedFunc f, NamedFunc g) |
Multiply two NamedFuncs. More... | |
NamedFunc | operator/ (NamedFunc f, NamedFunc g) |
Divide two NamedFuncs. More... | |
NamedFunc | operator% (NamedFunc f, NamedFunc g) |
Get remainder form division of two NamedFuncs. More... | |
NamedFunc | operator+ (NamedFunc f) |
Applied unary plus operator. Acts as identity operation. More... | |
NamedFunc | operator- (NamedFunc f) |
Negates f. More... | |
NamedFunc | operator== (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests for equality of results of f and g. More... | |
NamedFunc | operator!= (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests for inequality of results of f and g. More... | |
NamedFunc | operator> (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests if result of f is greater than result of g. More... | |
NamedFunc | operator< (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests if result of f is less than result of g. More... | |
NamedFunc | operator>= (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests if result of f is greater than or equal to result of g. More... | |
NamedFunc | operator<= (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests if result of f is less than or equal to result of g. More... | |
NamedFunc | operator&& (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests if results of both f and g are true. More... | |
NamedFunc | operator|| (NamedFunc f, NamedFunc g) |
Gets NamedFunc which tests if result of f or g is true. More... | |
NamedFunc | operator! (NamedFunc f) |
Gets NamedFunct returning logical inverse of result of f. More... | |
ostream & | operator<< (ostream &stream, const NamedFunc &function) |
Print NamedFunc to output stream. More... | |
bool | HavePass (const NamedFunc::VectorType &v) |
bool | HavePass (const std::vector< NamedFunc::VectorType > &vv) |
using ScalarFunc = NamedFunc::ScalarFunc |
Definition at line 56 of file named_func.cpp.
using ScalarType = NamedFunc::ScalarType |
Definition at line 54 of file named_func.cpp.
using VectorFunc = NamedFunc::VectorFunc |
Definition at line 57 of file named_func.cpp.
using VectorType = NamedFunc::VectorType |
Definition at line 55 of file named_func.cpp.
bool HavePass | ( | const NamedFunc::VectorType & | v | ) |
Definition at line 830 of file named_func.cpp.
Referenced by PlotMaker::GetYield(), Hist2D::SingleHist2D::RecordEvent(), and Hist1D::SingleHist1D::RecordEvent().
bool HavePass | ( | const std::vector< NamedFunc::VectorType > & | vv | ) |
Definition at line 837 of file named_func.cpp.
Gets NamedFunct returning logical inverse of result of f.
[in] | f | Function whose result the logical not is applied to |
Definition at line 812 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Gets NamedFunc which tests for inequality of results of f and g.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 683 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Get remainder form division of two NamedFuncs.
[in] | f | Dividend |
[in] | g | Divisor |
Definition at line 629 of file named_func.cpp.
Gets NamedFunc which tests if results of both f and g are true.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 778 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Multiply two NamedFuncs.
[in] | f | Multiplier |
[in] | g | Multiplicand |
Definition at line 604 of file named_func.cpp.
Add two NamedFuncs.
[in] | f | Augend |
[in] | g | Addend |
Definition at line 580 of file named_func.cpp.
Applied unary plus operator. Acts as identity operation.
[in] | f | NamedFunc to apply unary "+" to |
Definition at line 639 of file named_func.cpp.
References NamedFunc::Name().
Add a NamedFunc from another.
[in] | f | Minuend |
[in] | g | Subtrahend |
Definition at line 592 of file named_func.cpp.
Negates f.
[in] | f | NamedFunc to apply unary "-" to |
Definition at line 650 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Divide two NamedFuncs.
[in] | f | Dividend |
[in] | g | Divisor |
Definition at line 616 of file named_func.cpp.
Gets NamedFunc which tests if result of f is less than result of g.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 720 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
ostream& operator<< | ( | ostream & | stream, |
const NamedFunc & | function | ||
) |
Print NamedFunc to output stream.
[in,out] | stream | Output stream to print to |
[in] | function | NamedFunc to print |
Definition at line 825 of file named_func.cpp.
Gets NamedFunc which tests if result of f is less than or equal to result of g.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 760 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Gets NamedFunc which tests for equality of results of f and g.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 665 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Gets NamedFunc which tests if result of f is greater than result of g.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 702 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Gets NamedFunc which tests if result of f is greater than or equal to result of g.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 740 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().
Gets NamedFunc which tests if result of f or g is true.
[in] | f | Left hand operand |
[in] | g | Right hand operand |
Definition at line 796 of file named_func.cpp.
References anonymous_namespace{named_func.cpp}::ApplyOp(), NamedFunc::Function(), NamedFunc::Name(), NamedFunc::ScalarFunction(), and NamedFunc::VectorFunction().