diff --git a/src/feature_creation/node/ModelNode.cpp b/src/feature_creation/node/ModelNode.cpp index d3ce3d1895cac77be3f18bf84019ae4f68c2eee1..177d0c1f69c0a8b8515ac2f63930015b4dcddc56 100644 --- a/src/feature_creation/node/ModelNode.cpp +++ b/src/feature_creation/node/ModelNode.cpp @@ -432,6 +432,7 @@ void ModelNode::generate_fxn_list() } else { + std::cout << term << '\t' << _expr_postfix << std::endl; throw std::logic_error("Term in postfix expression does not represent a node"); } } diff --git a/src/feature_creation/node/operator_nodes/OperatorNode.hpp b/src/feature_creation/node/operator_nodes/OperatorNode.hpp index 05bac62ae4c358ddf29c110826967788af465b1d..5f6535031bbdc571c9f9326d61aafee72bca3462 100644 --- a/src/feature_creation/node/operator_nodes/OperatorNode.hpp +++ b/src/feature_creation/node/operator_nodes/OperatorNode.hpp @@ -426,29 +426,6 @@ public: */ virtual std::string get_latex_expr(double* params, int depth=1) = 0; - /** - * @brief Converts a feature into a postfix expression (reverse polish notation) - * - * @details Recursively creates a postfix representation of the string - * - * @param cur_expr The current expression - * @return The current postfix expression of the feature - */ - void update_postfix(std::string& cur_expr, double* params) - { - std::stringstream postfix; - postfix << get_postfix_term() << ":"; - postfix << std::setprecision(13) << std::scientific << params[0] << ","; - postfix << std::setprecision(13) << std::scientific << params[1]; - cur_expr = postfix.str() + "|" + cur_expr; - int n_used = 2; - for(int nn = N - 1; nn >= 0; --nn) - { - _feats[nn]->update_postfix(cur_expr, params + n_used); - n_used += _feats[nn]->n_params(); - } - } - /** * @brief Set the bounds for the nl parameterization * diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs/parameterized_absolute_value.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs/parameterized_absolute_value.hpp index 232b94e2981c13d7f75d8117f36494194b4f5f74..ab5ae9afb708edc98b29c96bdf00a4043087fb0c 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs/parameterized_absolute_value.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs/parameterized_absolute_value.hpp @@ -182,9 +182,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs_diff/parameterized_absolute_difference.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs_diff/parameterized_absolute_difference.hpp index c4e5a0a5f5e5729d29b0f53b03c630488b5941aa..1414193be0133020260ccbe6ed541d58fa70277b 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs_diff/parameterized_absolute_difference.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/abs_diff/parameterized_absolute_difference.hpp @@ -172,9 +172,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[1]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/add/parameterized_add.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/add/parameterized_add.hpp index ff09bf3a33adea7191cfa3e672bb4e991b69b8a4..e82661af383f53b3c62166d87256f133a6cb54a7 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/add/parameterized_add.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/add/parameterized_add.hpp @@ -173,9 +173,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[1]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cb/parameterized_cube.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cb/parameterized_cube.hpp index 9d6a5a1e04a88be656ffbeb8592125f5470b744a..8c029ae54068a7f8c7218da3af709ef2dde0ad3d 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cb/parameterized_cube.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cb/parameterized_cube.hpp @@ -172,9 +172,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cbrt/parameterized_cube_root.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cbrt/parameterized_cube_root.hpp index 51ec212a55a001a470a2c46e36930898a7e51386..a8a24bbadcfdf1f2c7022596fb2c8d77cf32f3c0 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cbrt/parameterized_cube_root.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cbrt/parameterized_cube_root.hpp @@ -180,9 +180,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cos/parameterized_cos.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cos/parameterized_cos.hpp index e9f636c678e528ea5eb2c99952d0e1312119807f..bac3a7b1a1134ea5584ccd2b94a88dba42572bd2 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cos/parameterized_cos.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/cos/parameterized_cos.hpp @@ -172,9 +172,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/parameterized_divide.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/parameterized_divide.hpp index e5f1473c14db6164b11d53a31c0198902842216b..4ba1fb4d8781bb2439d510a2b36f7e26abdbd603 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/parameterized_divide.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/div/parameterized_divide.hpp @@ -173,9 +173,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[1]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/exp/parameterized_exponential.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/exp/parameterized_exponential.hpp index e918c0e2d0d4a8a46415c536040c211cb67a1b33..0beb38e9e29c03dc55dbba05d615479801801eae 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/exp/parameterized_exponential.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/exp/parameterized_exponential.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/inv/parameterized_inverse.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/inv/parameterized_inverse.hpp index 00b03dd9bc3129bbb44c05fd6dab3e5cb8f36565..b8706b7126415013be17979112291cf32e2495c2 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/inv/parameterized_inverse.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/inv/parameterized_inverse.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/log/parameterized_log.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/log/parameterized_log.hpp index 7b54c7bdae8a1833440f80811f3fc994956ac5cb..53486f81b96c3e69bcd45ae95f4f7561451eca88 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/log/parameterized_log.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/log/parameterized_log.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/mult/parameterized_multiply.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/mult/parameterized_multiply.hpp index b083ee3f4ffca900ea54567587bc63ef6fce1651..55f5ecd16881dd3f35d026b31c9220667514b76d 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/mult/parameterized_multiply.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/mult/parameterized_multiply.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[1]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/neg_exp/parameterized_negative_exponential.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/neg_exp/parameterized_negative_exponential.hpp index 707295d11702f594f78e9349802421b7c01fb258..8e4396882ab6d46e9cff894c3a642beccc4b5ce3 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/neg_exp/parameterized_negative_exponential.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/neg_exp/parameterized_negative_exponential.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sin/parameterized_sin.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sin/parameterized_sin.hpp index 78cc18ffa64620a0f770342fa912dbd470b86d68..aab0ed154374014b78ce1d0e47c29a0f8f33a2a0 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sin/parameterized_sin.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sin/parameterized_sin.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/six_pow/parameterized_sixth_power.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/six_pow/parameterized_sixth_power.hpp index e16c2d966c0e14cf96d0d8babdf8b29311acf740..d7bd87d2960469596cd71c8d2347b989698cf453 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/six_pow/parameterized_sixth_power.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/six_pow/parameterized_sixth_power.hpp @@ -172,9 +172,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sq/parameterized_square.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sq/parameterized_square.hpp index d84daa1f401a177c2ecab0dd3262c279c9233e4a..a387ecba377b116bb342f0dbffebe634bda22498 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sq/parameterized_square.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sq/parameterized_square.hpp @@ -171,9 +171,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sqrt/parameterized_square_root.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sqrt/parameterized_square_root.hpp index c29dbe4d9085f93b6d1914cf8c73ed350cc6c779..ef6933295188353d8b1c7370df535fe3b9e7c967 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sqrt/parameterized_square_root.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sqrt/parameterized_square_root.hpp @@ -181,9 +181,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[0]->update_postfix(cur_expr, false); diff --git a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sub/parameterized_subtract.hpp b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sub/parameterized_subtract.hpp index c0385582f2e3fe1df83ece038a6bca646f615d90..c4144e08205da40624ad57ffe64bf821db66eb26 100644 --- a/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sub/parameterized_subtract.hpp +++ b/src/feature_creation/node/operator_nodes/allowed_operator_nodes/sub/parameterized_subtract.hpp @@ -173,9 +173,9 @@ public: postfix << get_postfix_term(); if(add_params) { - postfix << ":" << _params[0]; + postfix << ": " << std::setprecision(13) << std::scientific << _params[0]; for(int pp = 1; pp < _params.size(); ++pp) - postfix << "," << _params[pp]; + postfix << "," << std::setprecision(13) << std::scientific << _params[pp]; } cur_expr = postfix.str() + "|" + cur_expr; _feats[1]->update_postfix(cur_expr, false); diff --git a/tests/googletest/feature_creation/parameterization/test_abs_diff_node.cc b/tests/googletest/feature_creation/parameterization/test_abs_diff_node.cc index 91dcfc9e3a57f5d7c263efa248efcbcdc0fee49c..1b163477c933a0d21b12d03dc516facef33a7e02 100644 --- a/tests/googletest/feature_creation/parameterization/test_abs_diff_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_abs_diff_node.cc @@ -135,7 +135,7 @@ namespace EXPECT_LT(std::abs(_abs_diff_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|1|abd:" <<_abs_diff_test->parameters()[0] << ',' << _abs_diff_test->parameters()[1]; + postfix << "0|1|abd: " << std::setprecision(13) << std::scientific << _abs_diff_test->parameters()[0] << ',' << _abs_diff_test->parameters()[1]; EXPECT_STREQ(_abs_diff_test->unit().toString().c_str(), "m"); EXPECT_STREQ(_abs_diff_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_abs_node.cc b/tests/googletest/feature_creation/parameterization/test_abs_node.cc index 5f699016b86aa18891717e27add488620bde6129..6e493cbf6bb35252fa199b2a936769329ffc9f6f 100644 --- a/tests/googletest/feature_creation/parameterization/test_abs_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_abs_node.cc @@ -116,7 +116,7 @@ namespace EXPECT_LT(std::abs(_abs_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|abs:" <<_abs_test->parameters()[0] << ',' << _abs_test->parameters()[1]; + postfix << "0|abs: " << std::setprecision(13) << std::scientific <<_abs_test->parameters()[0] << ',' << _abs_test->parameters()[1]; EXPECT_STREQ(_abs_test->unit().toString().c_str(), "m"); EXPECT_STREQ(_abs_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_add_node.cc b/tests/googletest/feature_creation/parameterization/test_add_node.cc index b317955476f2eec79ed903b5ab760bad71ccfff4..bb5560ff51d13730ecb26c03dde2d87de2a422fa 100644 --- a/tests/googletest/feature_creation/parameterization/test_add_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_add_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_add_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|1|add:" <<_add_test->parameters()[0] << ',' << _add_test->parameters()[1]; + postfix << "0|1|add: " << std::setprecision(13) << std::scientific <<_add_test->parameters()[0] << ',' << _add_test->parameters()[1]; EXPECT_STREQ(_add_test->unit().toString().c_str(), "m"); EXPECT_STREQ(_add_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_cb_node.cc b/tests/googletest/feature_creation/parameterization/test_cb_node.cc index 3f2905efff63840216648b8d65ec2078a31a4f01..8f74c5804dd300df0c689955db5d0c586d327ba0 100644 --- a/tests/googletest/feature_creation/parameterization/test_cb_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_cb_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_exp_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|cb:" <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; + postfix << "1|cb: " << std::setprecision(13) << std::scientific <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; EXPECT_STREQ(_exp_test->unit().toString().c_str(), "s^3"); EXPECT_STREQ(_exp_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_cbrt_node.cc b/tests/googletest/feature_creation/parameterization/test_cbrt_node.cc index 4516404ac11d492b0b7d3a17e9131c214b8c597f..b7f5345685c4ca17692d40f1b2f2f89e916df895 100644 --- a/tests/googletest/feature_creation/parameterization/test_cbrt_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_cbrt_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_cbrt_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|cbrt:" <<_cbrt_test->parameters()[0] << ',' << _cbrt_test->parameters()[1]; + postfix << "1|cbrt: " << std::setprecision(13) << std::scientific <<_cbrt_test->parameters()[0] << ',' << _cbrt_test->parameters()[1]; EXPECT_STREQ(_cbrt_test->unit().toString().c_str(), "s^0.333333"); EXPECT_STREQ(_cbrt_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_cos_node.cc b/tests/googletest/feature_creation/parameterization/test_cos_node.cc index db89672c221625f3b6564bb30953107713d5d691..94042cfc1bd66b39a816f61ef1930fc3221273c3 100644 --- a/tests/googletest/feature_creation/parameterization/test_cos_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_cos_node.cc @@ -155,7 +155,7 @@ namespace EXPECT_LT(std::abs(_cos_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|cos:" <<_cos_test->parameters()[0] << ',' << _cos_test->parameters()[1]; + postfix << "1|cos: " << std::setprecision(13) << std::scientific <<_cos_test->parameters()[0] << ',' << _cos_test->parameters()[1]; EXPECT_STREQ(_cos_test->unit().toString().c_str(), "Unitless"); EXPECT_STREQ(_cos_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_div_node.cc b/tests/googletest/feature_creation/parameterization/test_div_node.cc index 6ff7cb31cae75fefd540805569dcd8fa84f2d153..042312b6db4d9986ca6ab4a29af6a3d9c231d951 100644 --- a/tests/googletest/feature_creation/parameterization/test_div_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_div_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_div_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|1|div:" <<_div_test->parameters()[0] << ',' << _div_test->parameters()[1]; + postfix << "0|1|div: " << std::setprecision(13) << std::scientific <<_div_test->parameters()[0] << ',' << _div_test->parameters()[1]; EXPECT_STREQ(_div_test->unit().toString().c_str(), "m * s^-1"); EXPECT_STREQ(_div_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_exp_node.cc b/tests/googletest/feature_creation/parameterization/test_exp_node.cc index 445275edee7e6bee851f1b0bb090d98ab15899ca..dcbcabb710fff98a4824c8350aeea9f85a955983 100644 --- a/tests/googletest/feature_creation/parameterization/test_exp_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_exp_node.cc @@ -168,7 +168,7 @@ namespace EXPECT_LT(std::abs(_exp_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|exp:" <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; + postfix << "1|exp: " << std::setprecision(13) << std::scientific <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; EXPECT_STREQ(_exp_test->unit().toString().c_str(), "Unitless"); EXPECT_STREQ(_exp_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_inv_node.cc b/tests/googletest/feature_creation/parameterization/test_inv_node.cc index abeadc8dc40fb92e7fe2b574a2f78f6dc69ba7f2..932b39d210f8e2f92fafeaff7b4b56c8e01539f5 100644 --- a/tests/googletest/feature_creation/parameterization/test_inv_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_inv_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_inv_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|inv:" <<_inv_test->parameters()[0] << ',' << _inv_test->parameters()[1]; + postfix << "1|inv: " << std::setprecision(13) << std::scientific <<_inv_test->parameters()[0] << ',' << _inv_test->parameters()[1]; EXPECT_STREQ(_inv_test->unit().toString().c_str(), "s^-1"); EXPECT_STREQ(_inv_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_log_node.cc b/tests/googletest/feature_creation/parameterization/test_log_node.cc index 28a4dd68e5ec3fab9df087e8ee7fb75c6f79388f..294771b4734690c51bc8e87dd982a45e826bd80f 100644 --- a/tests/googletest/feature_creation/parameterization/test_log_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_log_node.cc @@ -169,7 +169,7 @@ namespace EXPECT_LT(std::abs(_exp_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|log:" <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; + postfix << "1|log: " << std::setprecision(13) << std::scientific <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; EXPECT_STREQ(_exp_test->unit().toString().c_str(), "Unitless"); EXPECT_STREQ(_exp_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_mult_node.cc b/tests/googletest/feature_creation/parameterization/test_mult_node.cc index 0562b85e113de591c0f6dea0f3e4122d2cf19fe9..e2c65a8973dde30c34af5274b8eb42be926bee89 100644 --- a/tests/googletest/feature_creation/parameterization/test_mult_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_mult_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_mult_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|1|mult:" <<_mult_test->parameters()[0] << ',' << _mult_test->parameters()[1]; + postfix << "0|1|mult: " << std::setprecision(13) << std::scientific <<_mult_test->parameters()[0] << ',' << _mult_test->parameters()[1]; EXPECT_STREQ(_mult_test->unit().toString().c_str(), "m * s"); EXPECT_STREQ(_mult_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_neg_exp_node.cc b/tests/googletest/feature_creation/parameterization/test_neg_exp_node.cc index 34435238e094c4055530462e5ddb6102e9b3f4b0..3dd9c155ee78cffc9197b914fd05151e74247dad 100644 --- a/tests/googletest/feature_creation/parameterization/test_neg_exp_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_neg_exp_node.cc @@ -168,7 +168,7 @@ namespace EXPECT_LT(std::abs(_exp_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|nexp:" <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; + postfix << "1|nexp: " << std::setprecision(13) << std::scientific <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; EXPECT_STREQ(_exp_test->unit().toString().c_str(), "Unitless"); EXPECT_STREQ(_exp_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_sin_node.cc b/tests/googletest/feature_creation/parameterization/test_sin_node.cc index c3f220ca92bf3d4e3109113ba3d33c5cd4ec2bb3..8801de4799770f847da45c1ae25bfcce1992a16a 100644 --- a/tests/googletest/feature_creation/parameterization/test_sin_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_sin_node.cc @@ -155,7 +155,7 @@ namespace EXPECT_LT(std::abs(_sin_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|sin:" <<_sin_test->parameters()[0] << ',' << _sin_test->parameters()[1]; + postfix << "0|sin: " << std::setprecision(13) << std::scientific <<_sin_test->parameters()[0] << ',' << _sin_test->parameters()[1]; EXPECT_STREQ(_sin_test->unit().toString().c_str(), "Unitless"); EXPECT_STREQ(_sin_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_six_pow_node.cc b/tests/googletest/feature_creation/parameterization/test_six_pow_node.cc index e37ab130203d6d04d3cf486922ba201481bdc1d3..cbe2a311d8ae8c5f1a9d70ca02ff3fd80646aca7 100644 --- a/tests/googletest/feature_creation/parameterization/test_six_pow_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_six_pow_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_exp_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|sp:" <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; + postfix << "1|sp: " << std::setprecision(13) << std::scientific <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; EXPECT_STREQ(_exp_test->unit().toString().c_str(), "s^6"); EXPECT_STREQ(_exp_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_sq_node.cc b/tests/googletest/feature_creation/parameterization/test_sq_node.cc index b4e1693e55876fa996eb0ee59a8fd4d18b7cba9b..943184d71fbc9af58be70aaa5642fe0b9eed834c 100644 --- a/tests/googletest/feature_creation/parameterization/test_sq_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_sq_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_exp_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|sq:" <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; + postfix << "1|sq: " << std::setprecision(13) << std::scientific <<_exp_test->parameters()[0] << ',' << _exp_test->parameters()[1]; EXPECT_STREQ(_exp_test->unit().toString().c_str(), "s^2"); EXPECT_STREQ(_exp_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_sqrt_node.cc b/tests/googletest/feature_creation/parameterization/test_sqrt_node.cc index fe81ae41b9cfcba1d101aa608cac3d3ca0d502b3..211f977f839f0b058c47b3dff1a01fb8f767367f 100644 --- a/tests/googletest/feature_creation/parameterization/test_sqrt_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_sqrt_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_sqrt_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "1|sqrt:" <<_sqrt_test->parameters()[0] << ',' << _sqrt_test->parameters()[1]; + postfix << "1|sqrt: " << std::setprecision(13) << std::scientific <<_sqrt_test->parameters()[0] << ',' << _sqrt_test->parameters()[1]; EXPECT_STREQ(_sqrt_test->unit().toString().c_str(), "s^0.5"); EXPECT_STREQ(_sqrt_test->postfix_expr().c_str(), postfix.str().c_str()); } diff --git a/tests/googletest/feature_creation/parameterization/test_sub_node.cc b/tests/googletest/feature_creation/parameterization/test_sub_node.cc index 68d3ea62a373ca70216d2f2a9ce9b30191385511..0452e4b700993356d806430f7970c4751b31a806 100644 --- a/tests/googletest/feature_creation/parameterization/test_sub_node.cc +++ b/tests/googletest/feature_creation/parameterization/test_sub_node.cc @@ -126,7 +126,7 @@ namespace EXPECT_LT(std::abs(_sub_test->test_value()[0] - expected_val[0]), 1e-10); std::stringstream postfix; - postfix << "0|1|sub:" <<_sub_test->parameters()[0] << ',' << _sub_test->parameters()[1]; + postfix << "0|1|sub: " << std::setprecision(13) << std::scientific <<_sub_test->parameters()[0] << ',' << _sub_test->parameters()[1]; EXPECT_STREQ(_sub_test->unit().toString().c_str(), "m"); EXPECT_STREQ(_sub_test->postfix_expr().c_str(), postfix.str().c_str()); }