1 #ifndef SYMENGINE_CODEGEN_H
2 #define SYMENGINE_CODEGEN_H
4 #include <symengine/printers.h>
6 #include <symengine/printers/strprinter.h>
7 #include <symengine/symengine_exception.h>
16 = CodePrinterPrecision::Double);
17 using StrPrinter::apply;
18 using StrPrinter::bvisit;
19 using StrPrinter::str_;
20 void bvisit(
const Basic &x);
22 void bvisit(
const Dummy &x);
27 void bvisit(
const And &x);
28 void bvisit(
const Or &x);
29 void bvisit(
const Xor &x);
30 void bvisit(
const Not &x);
35 void bvisit(
const Reals &x);
39 void bvisit(
const Abs &x);
42 void bvisit(
const Max &x);
43 void bvisit(
const Min &x);
45 void bvisit(
const NaN &x);
50 void bvisit(
const Sign &x);
54 void bvisit(
const Subs &x);
58 #ifdef HAVE_SYMENGINE_MPFR
63 CodePrinterPrecision precision_;
64 std::string print_scalar_literal(
double d)
const;
65 std::string print_math_function(
const std::string &name)
const;
67 format_codegen_function_name(
const std::string &name)
const;
68 std::string print_binary_reduction(
const vec_basic &args,
69 const std::string &func_name);
70 std::string print_binary_reduction_impl(vec_basic::const_iterator begin,
71 vec_basic::const_iterator end,
72 const std::string &func_name);
79 = CodePrinterPrecision::Double);
80 using CodePrinter::apply;
81 using CodePrinter::bvisit;
82 using CodePrinter::str_;
83 void bvisit(
const Infty &x);
84 void _print_pow(std::ostringstream &o,
const RCP<const Basic> &a,
85 const RCP<const Basic> &b)
override;
92 = CodePrinterPrecision::Double);
93 using C89CodePrinter::apply;
94 using C89CodePrinter::bvisit;
95 using C89CodePrinter::str_;
96 void bvisit(
const Infty &x);
97 void _print_pow(std::ostringstream &o,
const RCP<const Basic> &a,
98 const RCP<const Basic> &b)
override;
99 void bvisit(
const Gamma &x);
108 = CodePrinterPrecision::Double);
109 using C99CodePrinter::apply;
110 using C99CodePrinter::bvisit;
111 using C99CodePrinter::str_;
114 void bvisit(
const NaN &x);
115 void bvisit(
const Infty &x);
123 = CodePrinterPrecision::Float);
124 using CodePrinter::apply;
125 using CodePrinter::bvisit;
126 using CodePrinter::str_;
128 void bvisit(
const NaN &x);
129 void bvisit(
const Infty &x);
130 void bvisit(
const Abs &x);
133 void bvisit(
const Max &x);
134 void bvisit(
const Min &x);
135 void _print_pow(std::ostringstream &o,
const RCP<const Basic> &a,
136 const RCP<const Basic> &b)
override;
140 format_codegen_function_name(
const std::string &name)
const override;
146 using CodePrinter::apply;
147 using CodePrinter::bvisit;
148 using CodePrinter::str_;
150 void _print_pow(std::ostringstream &o,
const RCP<const Basic> &a,
151 const RCP<const Basic> &b)
override;
152 void bvisit(
const Abs &x);
153 void bvisit(
const Sin &x);
154 void bvisit(
const Cos &x);
155 void bvisit(
const Max &x);
156 void bvisit(
const Min &x);
160 format_codegen_function_name(
const std::string &name)
const override;
The lowest unit of symbolic representation.
RealDouble Class to hold double values.
Main namespace for SymEngine package.