![]() |
OpenLB 1.8.1
|
Basic value-substitute enabling extraction of expression trees for code generation. More...
#include <expr.h>
Public Types | |
enum struct | Op : std::size_t { Add , Mul , Sub , Div , Sqrt , Abs , Pow , Exp , End } |
Public Member Functions | |
Expr () | |
Expr (Expr &&rhs) | |
Expr (const Expr &rhs) | |
Expr (double v) | |
Expr (std::string name) | |
Expr (Expr lhs, Op op, Expr rhs) | |
Expr (Op op, Expr rhs) | |
Expr & | operator= (const Expr &rhs) |
Expr & | operator+= (Expr rhs) |
Expr & | operator-= (Expr rhs) |
Expr & | operator*= (Expr rhs) |
Expr & | operator/= (Expr rhs) |
void | describe (std::stringstream &out) const |
Writes the serialized expression tree to out. | |
std::string | describe () const |
Returns the serialized expression tree. | |
bool | isSymbol (std::string name) const |
Helper function to quickly check if Expr is a specific symbol. | |
std::size_t | size () const |
Returns expanded size of tree. | |
Static Public Member Functions | |
static void | reset () |
Resets FLOP counter. | |
static void | increment (Op op) |
Increment FLOP counter. | |
static std::size_t | count () |
Return accumulated FLOPs. | |
static std::size_t | count (Op op) |
Return accumulated FLOPs of type. | |
Basic value-substitute enabling extraction of expression trees for code generation.
|
strong |
olb::Expr::Expr | ( | Expr && | rhs | ) |
olb::Expr::Expr | ( | const Expr & | rhs | ) |
olb::Expr::Expr | ( | double | v | ) |
olb::Expr::Expr | ( | std::string | name | ) |
Definition at line 106 of file expr.cpp.
|
inlinestatic |
|
inlinestatic |
std::string olb::Expr::describe | ( | ) | const |
Returns the serialized expression tree.
Definition at line 150 of file expr.cpp.
References describe().
void olb::Expr::describe | ( | std::stringstream & | out | ) | const |
|
inlinestatic |
bool olb::Expr::isSymbol | ( | std::string | name | ) | const |
Definition at line 132 of file expr.cpp.
References increment(), and Mul.
Definition at line 120 of file expr.cpp.
References Add, and increment().
Definition at line 126 of file expr.cpp.
References increment(), and Sub.
Definition at line 138 of file expr.cpp.
References Div, and increment().
|
inlinestatic |
std::size_t olb::Expr::size | ( | ) | const |