Dune::Copasi
Loading...
Searching...
No Matches
symengine.hh
Go to the documentation of this file.
1#ifndef DUNE_COPASI_SYMENGINE_PARSER_HH
2#define DUNE_COPASI_SYMENGINE_PARSER_HH
3
5
6#include <symengine/lambda_double.h>
7#include <symengine/parser.h>
8#include <symengine/parser/sbml/sbml_parser.h>
9#ifdef HAVE_SYMENGINE_LLVM
10#include <symengine/llvm_double.h>
11#endif
12
13#include <functional>
14#include <string>
15#include <unordered_map>
16#include <vector>
17
18namespace Dune::Copasi {
19
21{
22
23public:
24 enum class Type
25 {
26 Native,
27 SBML
28 };
29
31
37
39
42
45
47
49
51
52 std::vector<std::shared_ptr<std::size_t>> setup_function_symbol(const std::string& symbol);
53
59
61
63
65 using Parser::_compiled;
66 using Parser::_symbols;
67 using Parser::_variables;
68
69 Type _parser_type;
70 std::vector<std::string> _const_symbols;
71 mutable std::vector<RangeField> _input;
72
73 SymEngine::RCP<const SymEngine::Basic> _se_expression;
74 SymEngine::vec_basic _arguments;
75
76#ifdef HAVE_SYMENGINE_LLVM
77 std::list<SymEngine::LLVMDoubleVisitor> _visitors;
78#else
79 std::list<SymEngine::LambdaRealDoubleVisitor> _visitors;
80#endif
81
82 mutable std::vector<fu2::unique_function<void()>> _setup, _callbacks;
83 RangeField _result;
84};
85
86} // namespace Dune::Copasi
87
88#endif // DUNE_COPASI_SYMENGINE_PARSER_HH
Definition parser.hh:16
std::string expression() const
fu2::unique_function< RangeField(RangeField, RangeField, RangeField) const > Function3D
Definition parser.hh:34
fu2::unique_function< RangeField() const > Function0D
Definition parser.hh:31
fu2::unique_function< RangeField(RangeField, RangeField, RangeField, RangeField) const > Function4D
Definition parser.hh:35
double RangeField
Definition parser.hh:29
fu2::unique_function< RangeField(RangeField, RangeField) const > Function2D
Definition parser.hh:33
fu2::unique_function< RangeField(RangeField) const > Function1D
Definition parser.hh:32
Definition symengine.hh:21
SymEngineParser & operator=(SymEngineParser &&)=default
SymEngineParser(Type parser_type=Type::Native)
void compile() override final
void define_function(const std::string &symbol, Function0D &&function) override final
Type
Definition symengine.hh:25
typename Parser::Function0D Function0D
Definition symengine.hh:32
typename Parser::Function3D Function3D
Definition symengine.hh:35
typename Parser::Function4D Function4D
Definition symengine.hh:36
typename Parser::RangeField RangeField
Definition symengine.hh:30
typename Parser::Function1D Function1D
Definition symengine.hh:33
~SymEngineParser() override final=default
typename Parser::Function2D Function2D
Definition symengine.hh:34
SymEngineParser(SymEngineParser &&)=default
SymEngineParser & operator=(const SymEngineParser &)=delete
void define_constant(const std::string &symbol, const RangeField &value) override final
void set_expression(const std::string &expression) override final
std::vector< std::shared_ptr< std::size_t > > setup_function_symbol(const std::string &symbol)
SymEngineParser(const SymEngineParser &)=delete
Definition axis_names.hh:7
constexpr bool is_bitflags_v
Alias for Bitflag indicator.
Definition bit_flags.hh:24