25 template<jit::
float_scalar T,
bool SAFE_MATH=false>
69 if (
ac->is(0) ||
ac->is(1)) {
86 ap2->get_num_columns(),
87 ap2->get_left(),
ap2->get_x_scale(),
ap2->get_x_offset(),
88 ap2->get_right(),
ap2->get_y_scale(),
ap2->get_y_offset());
96 am->get_left()->is_constant() ||
98 am->get_right()->is_constant()) {
99 return sqrt(
am->get_left()) *
108 if (
alm.get() &&
alm->get_left()->is_constant()) {
116 ad->get_left()->is_constant() ||
118 ad->get_right()->is_constant()) {
119 return sqrt(
ad->get_left()) /
140 const size_t hash =
reinterpret_cast<size_t> (x.get());
162 if (registers.find(
this) == registers.end()) {
170 jit::add_type<T> (stream);
171 stream <<
" " << registers[
this] <<
" = sqrt("
172 << registers[
a.get()] <<
")";
186 if (
this == x.get()) {
192 return this->
arg->is_match(
x_cast->get_arg());
202 std::cout <<
"\\sqrt{";
203 this->
arg->to_latex();
241 return sqrt(this->
arg->remove_pseudo());
255 if (registers.find(
this) == registers.end()) {
257 registers[
this] =
name;
258 stream <<
" " <<
name
259 <<
" [label = \"sqrt\", shape = oval, style = filled, fillcolor = blue, fontcolor = white];" << std::endl;
261 auto a = this->
arg->to_vizgraph(stream, registers);
262 stream <<
" " <<
name <<
" -- " << registers[
a.get()] <<
";" << std::endl;
278 template<jit::
float_scalar T,
bool SAFE_MATH=false>
280 auto temp = std::make_shared<sqrt_node<T, SAFE_MATH>> (x)->reduce();
282 for (
size_t i =
temp->get_hash();
292#if defined(__clang__) || defined(__GNUC__)
295 assert(
false &&
"Should never reach.");
300 template<jit::
float_scalar T,
bool SAFE_MATH=false>
312 template<jit::
float_scalar T,
bool SAFE_MATH=false>
314 return std::dynamic_pointer_cast<sqrt_node<T, SAFE_MATH>> (x);
328 template<jit::
float_scalar T,
bool SAFE_MATH=false>
384 ap2->get_num_columns(),
385 ap2->get_left(),
ap2->get_x_scale(),
ap2->get_x_offset(),
386 ap2->get_right(),
ap2->get_y_scale(),
ap2->get_y_offset());
411 const size_t hash =
reinterpret_cast<size_t> (x.get());
432 if (registers.find(
this) == registers.end()) {
440 jit::add_type<T> (stream);
441 stream <<
" " << registers[
this] <<
" = ";
446 stream << registers[
a.get()];
450 stream <<
" < 709.8 ? ";
452 stream <<
"exp(" << registers[
a.get()] <<
")";
456 jit::add_type<T> (stream);
478 if (
this == x.get()) {
484 return this->
arg->is_match(
x_cast->get_arg());
494 std::cout <<
"e^{\\left(";
495 this->
arg->to_latex();
496 std::cout <<
"\\right)}";
506 return exp(this->
arg->remove_pseudo());
520 if (registers.find(
this) == registers.end()) {
522 registers[
this] =
name;
523 stream <<
" " <<
name
524 <<
" [label = \"exp\", shape = oval, style = filled, fillcolor = blue, fontcolor = white];" << std::endl;
526 auto a = this->
arg->to_vizgraph(stream, registers);
527 stream <<
" " <<
name <<
" -- " << registers[
a.get()] <<
";" << std::endl;
543 template<jit::
float_scalar T,
bool SAFE_MATH=false>
545 auto temp = std::make_shared<exp_node<T, SAFE_MATH>> (x)->reduce();
547 for (
size_t i =
temp->get_hash();
557#if defined(__clang__) || defined(__GNUC__)
560 assert(
false &&
"Should never reach.");
565 template<jit::
float_scalar T,
bool SAFE_MATH=false>
577 template<jit::
float_scalar T,
bool SAFE_MATH=false>
579 return std::dynamic_pointer_cast<exp_node<T, SAFE_MATH>> (x);
593 template<jit::
float_scalar T,
bool SAFE_MATH=false>
649 ap2->get_num_columns(),
650 ap2->get_left(),
ap2->get_x_scale(),
ap2->get_x_offset(),
651 ap2->get_right(),
ap2->get_y_scale(),
ap2->get_y_offset());
676 const size_t hash =
reinterpret_cast<size_t> (x.get());
697 if (registers.find(
this) == registers.end()) {
705 jit::add_type<T> (stream);
706 stream <<
" " << registers[
this] <<
" = log("
707 << registers[
a.get()] <<
")";
721 if (
this == x.get()) {
727 return this->
arg->is_match(
x_cast->get_arg());
737 std::cout <<
"\\ln{\\left(";
738 this->
arg->to_latex();
739 std::cout <<
"\\right)}";
749 return log(this->
arg->remove_pseudo());
763 if (registers.find(
this) == registers.end()) {
765 registers[
this] =
name;
766 stream <<
" " <<
name
767 <<
" [label = \"log\", shape = oval, style = filled, fillcolor = blue, fontcolor = white];" << std::endl;
769 auto a = this->
arg->to_vizgraph(stream, registers);
770 stream <<
" " <<
name <<
" -- " << registers[
a.get()] <<
";" << std::endl;
786 template<jit::
float_scalar T,
bool SAFE_MATH=false>
788 auto temp = std::make_shared<log_node<T, SAFE_MATH>> (x)->reduce();
799#if defined(__clang__) || defined(__GNUC__)
802 assert(
false &&
"Should never reach.");
807 template<jit::
float_scalar T,
bool SAFE_MATH=false>
819 template<jit::
float_scalar T,
bool SAFE_MATH=false>
821 return std::dynamic_pointer_cast<log_node<T, SAFE_MATH>> (x);
835 template<jit::
float_scalar T,
bool SAFE_MATH=false>
885 if (
rc.get() &&
rc->is(0)) {
887 }
else if (
rc.get() &&
rc->is(1)) {
889 }
else if (
rc.get() &&
rc->is(0.5)) {
891 }
else if (
rc.get() &&
rc->is(2)){
894 return sq->get_arg();
898 if (
lc.get() &&
rc.get()) {
904 if (
pl1.get() && (
rc.get() ||
pl1->is_arg_match(
this->right))) {
906 pl1->get_scale(),
pl1->get_offset());
907 }
else if (
pr1.get() && (
lc.get() ||
pr1->is_arg_match(
this->left))) {
909 pr1->get_scale(),
pr1->get_offset());
914 if (
pl2.get() && (
rc.get() ||
pl2->is_arg_match(
this->right))) {
916 pl2->get_num_columns(),
917 pl2->get_left(),
pl2->get_x_scale(),
pl2->get_x_offset(),
918 pl2->get_right(),
pl2->get_y_scale(),
pl2->get_y_offset());
919 }
else if (
pr2.get() && (
lc.get() ||
pr2->is_arg_match(
this->left))) {
921 pr2->get_num_columns(),
922 pr2->get_left(),
pr2->get_x_scale(),
pr2->get_x_offset(),
923 pr2->get_right(),
pr2->get_y_scale(),
pr2->get_y_offset());
927 if (
pr2.get() &&
pr2->is_row_match(
this->left)) {
931 pr2->get_num_columns(),
932 pr2->get_left(),
pr2->get_x_scale(),
pr2->get_x_offset(),
933 pr2->get_right(),
pr2->get_y_scale(),
pr2->get_y_offset());
934 }
else if (
pr2.get() &&
pr2->is_col_match(
this->left)) {
938 pr2->get_num_columns(),
939 pr2->get_left(),
pr2->get_x_scale(),
pr2->get_x_offset(),
940 pr2->get_right(),
pr2->get_y_scale(),
pr2->get_y_offset());
941 }
else if (
pl2.get() &&
pl2->is_row_match(
this->right)) {
945 pl2->get_num_columns(),
946 pl2->get_left(),
pl2->get_x_scale(),
pl2->get_x_offset(),
947 pl2->get_right(),
pl2->get_y_scale(),
pl2->get_y_offset());
948 }
else if (
pl2.get() &&
pl2->is_col_match(
this->right)) {
952 pl2->get_num_columns(),
953 pl2->get_left(),
pl2->get_x_scale(),
pl2->get_x_offset(),
954 pl2->get_right(),
pl2->get_y_scale(),
pl2->get_y_offset());
959 if (
lp.get() &&
rc.get() &&
rc->is_integer()) {
960 return pow(
lp->get_left(),
lp->get_right()*
this->right);
966 if (
lm.get() &&
rc.get()) {
967 if (
lm->get_left()->is_constant() ||
968 lm->get_right()->is_constant() ||
973 return pow(
lm->get_left(),
this->right) *
981 if (
lmlm->get_left()->is_constant() ||
982 lmlm->get_right()->is_constant() ||
996 if (
ld.get() &&
rc.get()) {
1002 rc->evaluate().is_even()) {
1003 if (
ldlm->get_left()->is_constant()) {
1009 if (
ldlm->get_left()->is_constant() ||
1010 ldlm->get_right()->is_constant() ||
1022 if (
ldlmlm->get_left()->is_constant() ||
1023 ldlmlm->get_right()->is_constant() ||
1037 if (
ldlmrm->get_left()->is_constant() ||
1038 ldlmrm->get_right()->is_constant() ||
1052 if (
ld->get_left()->is_constant() ||
1053 ld->get_right()->is_constant() ||
1058 return pow(
ld->get_left(),
this->right) /
1065 if (
ldrm->get_left()->is_constant() ||
1066 ldrm->get_right()->is_constant() ||
1071 return pow(
ld->get_left(),
this->right) /
1078 if (
ldrmlm->get_left()->is_constant() ||
1079 ldrmlm->get_right()->is_constant() ||
1084 return pow(
ld->get_left(),
this->right) /
1093 if (
ldrmrm->get_left()->is_constant() ||
1094 ldrmrm->get_right()->is_constant() ||
1099 return pow(
ld->get_left(),
this->right) /
1109 return pow(
ld->get_left()->get_power_base(),
1110 this->right*(
ld->get_left()->get_power_exponent() -
1111 ld->get_right()->get_power_exponent()));
1118 ldrmlm->get_right()->get_power_base())) {
1124 ldrmlm->get_left()->get_power_base())) {
1130 ldrmlm->get_right()->get_power_base()) ||
1132 ldrmlm->get_left()->get_power_base())) {
1133 return pow(
ld->get_left()/
ldrm->get_right(),
1145 return pow(
lsq->get_arg(),
1151 if (
temp.get() &&
rc.get() &&
rc->is_integer()) {
1172 const size_t hash =
reinterpret_cast<size_t> (x.get());
1195 if (registers.find(
this) == registers.end()) {
1202 if (!
temp.get() || !
temp->is_integer()) {
1207 stream <<
" const ";
1208 jit::add_type<T> (stream);
1209 stream <<
" " << registers[
this] <<
" = ";
1210 if (
temp.get() &&
temp->is_integer()) {
1211 stream << registers[
l.get()];
1212 const size_t end =
static_cast<size_t> (std::real(this->
right->evaluate().at(0)));
1213 for (
size_t i = 1;
i < end;
i++) {
1214 stream <<
"*" << registers[
l.get()];
1218 << registers[
l.get()] <<
", "
1219 << registers[
r.get()] <<
")";
1234 if (
this == x.get()) {
1240 return this->
left->is_match(
x_cast->get_left()) &&
1255 std::cout <<
"\\left(";
1257 this->
left->to_latex();
1259 std::cout <<
"\\right)";
1262 this->
right->to_latex();
1275 if (registers.find(
this) == registers.end()) {
1277 registers[
this] =
name;
1278 stream <<
" " <<
name
1279 <<
" [label = \"pow\", shape = oval, style = filled, fillcolor = blue, fontcolor = white];" << std::endl;
1281 auto l = this->
left->to_vizgraph(stream, registers);
1282 stream <<
" " <<
name <<
" -- " << registers[
l.get()] <<
";" << std::endl;
1283 auto r = this->
right->to_vizgraph(stream, registers);
1284 stream <<
" " <<
name <<
" -- " << registers[
r.get()] <<
";" << std::endl;
1296 return this->
left->is_all_variables() &&
1297 (this->
right->is_all_variables() ||
1335 return pow(this->
left->remove_pseudo(),
1336 this->right->remove_pseudo());
1351 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1354 auto temp = std::make_shared<pow_node<T, SAFE_MATH>> (
l,
r)->reduce();
1356 for (
size_t i =
temp->get_hash();
1366#if defined(__clang__) || defined(__GNUC__)
1369 assert(
false &&
"Should never reach.");
1383 template<jit::
float_scalar T, jit::
float_scalar L,
bool SAFE_MATH=false>
1399 template<jit::
float_scalar T, jit::
float_scalar R,
bool SAFE_MATH=false>
1406 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1415 template<jit::
float_scalar T,
bool SAFE_MATH=false>
1417 return std::dynamic_pointer_cast<pow_node<T, SAFE_MATH>> (x);
1431 template<jit::complex_scalar T,
bool SAFE_MATH=false>
1487 ap2->get_num_columns(),
1488 ap2->get_left(),
ap2->get_x_scale(),
ap2->get_x_offset(),
1489 ap2->get_right(),
ap2->get_y_scale(),
ap2->get_y_offset());
1508 const size_t hash =
reinterpret_cast<size_t> (x.get());
1511 *
exp(this->
arg*this->
arg)*this->arg->df(x);
1530 if (registers.find(
this) == registers.end()) {
1537 stream <<
" const ";
1538 jit::add_type<T> (stream);
1539 stream <<
" " << registers[
this] <<
" = special::erfi("
1540 << registers[
a.get()] <<
")";
1554 if (
this == x.get()) {
1560 return this->
arg->is_match(
x_cast->get_arg());
1570 std::cout <<
"erfi\\left(";
1571 this->
arg->to_latex();
1572 std::cout <<
"\\right)";
1582 return erfi(this->
arg->remove_pseudo());
1596 if (registers.find(
this) == registers.end()) {
1598 registers[
this] =
name;
1599 stream <<
" " <<
name
1600 <<
" [label = \"erfi\", shape = oval, style = filled, fillcolor = blue, fontcolor = white];" << std::endl;
1602 auto a = this->
arg->to_vizgraph(stream, registers);
1603 stream <<
" " <<
name <<
" -- " << registers[
a.get()] <<
";" << std::endl;
1619 template<jit::complex_scalar T,
bool SAFE_MATH=false>
1621 auto temp = std::make_shared<erfi_node<T, SAFE_MATH>> (x)->reduce();
1623 for (
size_t i =
temp->get_hash();
1633#if defined(__clang__) || defined(__GNUC__)
1636 assert(
false &&
"Should never reach.");
1641 template<jit::complex_scalar T,
bool SAFE_MATH=false>
1653 template<jit::complex_scalar T,
bool SAFE_MATH=false>
1655 return std::dynamic_pointer_cast<erfi_node<T, SAFE_MATH>> (x);
Class representing a generic buffer.
Definition backend.hpp:29
void erfi()
Take erfi.
Definition backend.hpp:259
void log()
Take log.
Definition backend.hpp:232
void sqrt()
Take sqrt.
Definition backend.hpp:214
void pow_col(const buffer< T > &x)
Pow col operation.
Definition backend.hpp:715
void pow_row(const buffer< T > &x)
Pow row operation.
Definition backend.hpp:679
void exp()
Take exp.
Definition backend.hpp:223
Class representing a branch node.
Definition node.hpp:1173
shared_leaf< T, SAFE_MATH > right
Right branch of the tree.
Definition node.hpp:1178
shared_leaf< T, SAFE_MATH > left
Left branch of the tree.
Definition node.hpp:1176
An imaginary error function node.
Definition math.hpp:1432
erfi_node(shared_leaf< T, SAFE_MATH > x)
Construct a exp node.
Definition math.hpp:1450
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduce the erfi(x).
Definition math.hpp:1471
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition math.hpp:1526
virtual void to_latex() const
Convert the node to latex.
Definition math.hpp:1569
virtual shared_leaf< T, SAFE_MATH > remove_pseudo()
Remove pseudo variable nodes.
Definition math.hpp:1580
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition math.hpp:1503
virtual bool is_match(shared_leaf< T, SAFE_MATH > x)
Querey if the nodes match.
Definition math.hpp:1553
virtual backend::buffer< T > evaluate()
Evaluate the results of erfi.
Definition math.hpp:1460
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition math.hpp:1594
A exp node.
Definition math.hpp:329
virtual backend::buffer< T > evaluate()
Evaluate the results of exp.
Definition math.hpp:357
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition math.hpp:406
virtual bool is_match(shared_leaf< T, SAFE_MATH > x)
Querey if the nodes match.
Definition math.hpp:477
virtual shared_leaf< T, SAFE_MATH > remove_pseudo()
Remove pseudo variable nodes.
Definition math.hpp:504
exp_node(shared_leaf< T, SAFE_MATH > x)
Construct a exp node.
Definition math.hpp:347
virtual void to_latex() const
Convert the node to latex.
Definition math.hpp:493
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduce the exp(x).
Definition math.hpp:368
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition math.hpp:518
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition math.hpp:428
Class representing a node leaf.
Definition node.hpp:364
virtual void endline(std::ostringstream &stream, const jit::register_usage &usage) const final
End a line in the kernel source.
Definition node.hpp:637
std::map< size_t, std::shared_ptr< leaf_node< T, SAFE_MATH > > > df_cache
Cache derivative terms.
Definition node.hpp:371
virtual bool has_pseudo() const
Query if the node contains pseudo variables.
Definition node.hpp:618
const size_t hash
Hash for node.
Definition node.hpp:367
A log node.
Definition math.hpp:594
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition math.hpp:761
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition math.hpp:671
virtual backend::buffer< T > evaluate()
Evaluate the results of log.
Definition math.hpp:622
virtual bool is_match(shared_leaf< T, SAFE_MATH > x)
Querey if the nodes match.
Definition math.hpp:720
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduce the log(x).
Definition math.hpp:633
virtual void to_latex() const
Convert the node to latex.
Definition math.hpp:736
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition math.hpp:693
log_node(shared_leaf< T, SAFE_MATH > x)
Construct a log node.
Definition math.hpp:612
virtual shared_leaf< T, SAFE_MATH > remove_pseudo()
Remove pseudo variable nodes.
Definition math.hpp:747
An power node.
Definition math.hpp:836
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition math.hpp:1273
virtual bool is_all_variables() const
Test if node acts like a variable.
Definition math.hpp:1295
virtual shared_leaf< T, SAFE_MATH > get_power_base()
Get the base of a power.
Definition math.hpp:1315
virtual backend::buffer< T > evaluate()
Evaluate the results of addition.
Definition math.hpp:870
pow_node(shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > r)
Construct an power node.
Definition math.hpp:858
virtual bool is_power_like() const
Test if the node acts like a power of variable.
Definition math.hpp:1306
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition math.hpp:1191
virtual shared_leaf< T, SAFE_MATH > remove_pseudo()
Remove pseudo variable nodes.
Definition math.hpp:1333
virtual bool is_match(shared_leaf< T, SAFE_MATH > x)
Querey if the nodes match.
Definition math.hpp:1233
virtual shared_leaf< T, SAFE_MATH > get_power_exponent() const
Get the exponent of a power.
Definition math.hpp:1324
virtual void to_latex() const
Convert the node to latex.
Definition math.hpp:1250
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduce a power node.
Definition math.hpp:881
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition math.hpp:1167
A sqrt node.
Definition math.hpp:26
virtual shared_leaf< T, SAFE_MATH > get_power_exponent() const
Get the exponent of a power.
Definition math.hpp:230
virtual backend::buffer< T > evaluate()
Evaluate the results of sqrt.
Definition math.hpp:54
virtual shared_leaf< T, SAFE_MATH > reduce()
Reduce the sqrt(x).
Definition math.hpp:65
sqrt_node(shared_leaf< T, SAFE_MATH > x)
Construct a sqrt node.
Definition math.hpp:44
virtual bool is_power_like() const
Test if the node acts like a power of variable.
Definition math.hpp:212
virtual bool is_match(shared_leaf< T, SAFE_MATH > x)
Querey if the nodes match.
Definition math.hpp:185
virtual shared_leaf< T, SAFE_MATH > compile(std::ostringstream &stream, jit::register_map ®isters, jit::register_map &indices, const jit::register_usage &usage)
Compile the node.
Definition math.hpp:158
virtual shared_leaf< T, SAFE_MATH > remove_pseudo()
Remove pseudo variable nodes.
Definition math.hpp:239
virtual shared_leaf< T, SAFE_MATH > df(shared_leaf< T, SAFE_MATH > x)
Transform node to derivative.
Definition math.hpp:135
virtual shared_leaf< T, SAFE_MATH > to_vizgraph(std::stringstream &stream, jit::register_map ®isters)
Convert the node to vizgraph.
Definition math.hpp:253
virtual void to_latex() const
Convert the node to latex.
Definition math.hpp:201
virtual shared_leaf< T, SAFE_MATH > get_power_base()
Get the base of a power.
Definition math.hpp:221
Class representing a straight node.
Definition node.hpp:1059
shared_leaf< T, SAFE_MATH > arg
Argument.
Definition node.hpp:1062
Complex scalar concept.
Definition register.hpp:24
subroutine assert(test, message)
Assert check.
Definition f_binding_test.f90:38
buffer< T > pow(buffer< T > &base, buffer< T > &exponent)
Take the power.
Definition backend.hpp:1025
Name space for graph nodes.
Definition arithmetic.hpp:13
shared_piecewise_2D< T, SAFE_MATH > piecewise_2D_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a piecewise 2D node.
Definition piecewise.hpp:1323
bool is_variable_combineable(shared_leaf< T, SAFE_MATH > a, shared_leaf< T, SAFE_MATH > b)
Check if the variable is combinable.
Definition arithmetic.hpp:75
shared_leaf< T, SAFE_MATH > log(shared_leaf< T, SAFE_MATH > x)
Define log convience function.
Definition math.hpp:787
shared_pow< T, SAFE_MATH > pow_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a power node.
Definition math.hpp:1416
constexpr shared_leaf< T, SAFE_MATH > zero()
Forward declare for zero.
Definition node.hpp:994
shared_sqrt< T, SAFE_MATH > sqrt_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a sqrt node.
Definition math.hpp:313
shared_leaf< T, SAFE_MATH > pow(shared_leaf< T, SAFE_MATH > l, shared_leaf< T, SAFE_MATH > r)
Build power node.
Definition math.hpp:1352
shared_divide< T, SAFE_MATH > divide_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a divide node.
Definition arithmetic.hpp:3688
std::shared_ptr< erfi_node< T, SAFE_MATH > > shared_erfi
Convenience type alias for shared exp nodes.
Definition math.hpp:1642
shared_piecewise_1D< T, SAFE_MATH > piecewise_1D_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a piecewise 1D node.
Definition piecewise.hpp:601
shared_multiply< T, SAFE_MATH > multiply_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a multiply node.
Definition arithmetic.hpp:2723
shared_leaf< T, SAFE_MATH > exp(shared_leaf< T, SAFE_MATH > x)
Define exp convience function.
Definition math.hpp:544
shared_exp< T, SAFE_MATH > exp_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a exp node.
Definition math.hpp:578
shared_constant< T, SAFE_MATH > constant_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a constant node.
Definition node.hpp:1042
shared_leaf< T, SAFE_MATH > erfi(shared_leaf< T, SAFE_MATH > x)
Define erfi convience function.
Definition math.hpp:1620
shared_variable< T, SAFE_MATH > variable_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a variable node.
Definition node.hpp:1746
constexpr T i
Convinece type for imaginary constant.
Definition node.hpp:1026
shared_erfi< T, SAFE_MATH > erfi_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a exp node.
Definition math.hpp:1654
shared_leaf< T, SAFE_MATH > sqrt(shared_leaf< T, SAFE_MATH > x)
Define sqrt convience function.
Definition math.hpp:279
std::shared_ptr< exp_node< T, SAFE_MATH > > shared_exp
Convenience type alias for shared exp nodes.
Definition math.hpp:566
shared_log< T, SAFE_MATH > log_cast(shared_leaf< T, SAFE_MATH > x)
Cast to a exp node.
Definition math.hpp:820
std::shared_ptr< leaf_node< T, SAFE_MATH > > shared_leaf
Convenience type alias for shared leaf nodes.
Definition node.hpp:673
std::shared_ptr< log_node< T, SAFE_MATH > > shared_log
Convenience type alias for shared log nodes.
Definition math.hpp:808
std::shared_ptr< pow_node< T, SAFE_MATH > > shared_pow
Convenience type alias for shared add nodes.
Definition math.hpp:1407
std::shared_ptr< sqrt_node< T, SAFE_MATH > > shared_sqrt
Convenience type alias for shared sqrt nodes.
Definition math.hpp:301
std::string format_to_string(const T value)
Convert a value to a string while avoiding locale.
Definition register.hpp:211
std::map< void *, size_t > register_usage
Type alias for counting register usage.
Definition register.hpp:258
std::map< void *, std::string > register_map
Type alias for mapping node pointers to register names.
Definition register.hpp:256
std::string to_string(const char prefix, const NODE *pointer)
Convert a graph::leaf_node pointer to a string.
Definition register.hpp:245
Base nodes of graph computation framework.
void piecewise_1D()
Tests for 1D piecewise nodes.
Definition piecewise_test.cpp:80
void piecewise_2D()
Tests for 2D piecewise nodes.
Definition piecewise_test.cpp:283