15#ifndef dealii_differentiation_sd_symengine_utilities_h
16#define dealii_differentiation_sd_symengine_utilities_h
20#ifdef DEAL_II_WITH_SYMENGINE
25# include <symengine/basic.h>
26# include <symengine/dict.h>
39 SymEngine::map_basic_basic
48 const SymEngine::map_basic_basic &substitution_map);
62 const SymEngine::vec_basic &symbol_vector);
68 std::vector<std::pair<Expression, Expression>>
70 const SymEngine::vec_pair &symbol_value_vector);
95 template <
typename NumberType,
typename ExpressionType = SD::Expression>
96 std::vector<NumberType>
102 template <
typename StreamType>
126 template <
typename NumberType,
typename ExpressionType>
127 std::vector<NumberType>
130 std::vector<NumberType> values;
131 values.reserve(substitution_values.size());
133 for (
const auto &entry : substitution_values)
135 static_cast<NumberType>(ExpressionType(entry.
second)));
141 template <
typename StreamType>
147 for (
const auto &entry : symbol_value_map)
148 stream << entry.
first <<
" = " << entry.
second <<
'\n';
150 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