16#ifndef dealii_differentiation_sd_symengine_utilities_h
17#define dealii_differentiation_sd_symengine_utilities_h
21#ifdef DEAL_II_WITH_SYMENGINE
26# include <symengine/basic.h>
27# include <symengine/dict.h>
40 SymEngine::map_basic_basic
49 const SymEngine::map_basic_basic &substitution_map);
63 const SymEngine::vec_basic &symbol_vector);
69 std::vector<std::pair<Expression, Expression>>
71 const SymEngine::vec_pair &symbol_value_vector);
96 template <
typename NumberType,
typename ExpressionType = SD::Expression>
97 std::vector<NumberType>
103 template <
typename StreamType>
127 template <
typename NumberType,
typename ExpressionType>
128 std::vector<NumberType>
131 std::vector<NumberType> values;
132 values.reserve(substitution_values.size());
134 for (
const auto &entry : substitution_values)
136 static_cast<NumberType>(ExpressionType(entry.
second)));
142 template <
typename StreamType>
148 for (
const auto &entry : symbol_value_map)
149 stream << entry.
first <<
" = " << entry.
second <<
'\n';
151 stream << std::flush;
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
std::vector< NumberType > extract_values(const SD::types::substitution_map &substitution_values)
SD::types::symbol_vector extract_symbols(const SD::types::substitution_map &substitution_values)
StreamType & print_substitution_map(StreamType &stream, const SD::types::substitution_map &symbol_value_map)
std::vector< std::pair< Expression, Expression > > convert_basic_pair_vector_to_expression_pair_vector(const SymEngine::vec_pair &symbol_value_vector)
SD::types::substitution_map convert_basic_map_to_expression_map(const SymEngine::map_basic_basic &substitution_map)
SD::types::symbol_vector convert_basic_vector_to_expression_vector(const SymEngine::vec_basic &symbol_vector)
SymEngine::map_basic_basic convert_expression_map_to_basic_map(const SD::types::substitution_map &substitution_map)
SymEngine::vec_basic convert_expression_vector_to_basic_vector(const SD::types::symbol_vector &symbol_vector)
std::vector< SD::Expression > symbol_vector
std::map< SD::Expression, SD::Expression, internal::ExpressionKeyLess > substitution_map