Expression tree test.
More...
#include <ExprTreeTest.h>
|
| ExprTreeTest () |
| Expression tree test constructor.
|
|
bool | run () override |
|
bool | testUnivarExprTree () |
| Test univariate expression tree. More...
|
|
template<typename InputType , typename OutputType > |
bool | validate (std::shared_ptr< IExprTreeNode< InputType, OutputType >> f, std::vector< InputType > const &t, std::vector< OutputType > const &y) |
| Validate \(f(t) \approx y\). More...
|
|
template<typename InputType , typename OutputType > |
bool | validate (std::shared_ptr< IExprTreeNode< InputType, OutputType >> f, std::shared_ptr< IExprTreeNode< InputType, OutputType >> g, std::vector< InputType > const &t) |
| Validate \(f(t) = g(t)\). More...
|
|
template<typename NumericType > |
bool | validatePowIPow (std::shared_ptr< UnivarExprTreeNode< NumericType >> f, size_t const expectedPowCount, size_t const expectedIPowCount) |
| Validate given tree as UnivarExprTreeNode contains exactly as many POW and IPOW nodes as specified. More...
|
|
template<typename NumericType > |
bool | validatePowIPow (std::shared_ptr< IExprTreeNode< NumericType, NumericType >> f, size_t const expectedPowCount, size_t const expectedIPowCount) |
| Wrapper for validatePowIPow method providing automatic pointer casting. More...
|
|
| BaseTest (std::string const &name) |
| Base test constructor. More...
|
|
std::string | getName () |
| Obtain the test name. More...
|
|
void | operator() (std::ostream &out=std::cout, bool color=true) |
| Another way to call test function. More...
|
|
bool | test (std::ostream &out=std::cout, bool color=true) |
| Perform the test and output its final status. More...
|
|
|
double | eps = 0.00001 |
| Decimal precision for validation purposes.
|
|
|
std::string const | name |
| The name for the test.
|
|
Expression tree test.
- Author
- Alberto M. Esmoris Pena
- Version
- 1.0
◆ run()
bool HeliosTests::ExprTreeTest::run |
( |
| ) |
|
|
overridevirtual |
◆ testUnivarExprTree()
bool HeliosTests::ExprTreeTest::testUnivarExprTree |
( |
| ) |
|
Test univariate expression tree.
- Returns
- True if passed, false otherwise
◆ validate() [1/2]
template<typename InputType , typename OutputType >
bool HeliosTests::ExprTreeTest::validate |
( |
std::shared_ptr< IExprTreeNode< InputType, OutputType >> |
f, |
|
|
std::shared_ptr< IExprTreeNode< InputType, OutputType >> |
g, |
|
|
std::vector< InputType > const & |
t |
|
) |
| |
|
inline |
Validate \(f(t) = g(t)\).
- Returns
- True if the test is passed, false otherwise
◆ validate() [2/2]
template<typename InputType , typename OutputType >
bool HeliosTests::ExprTreeTest::validate |
( |
std::shared_ptr< IExprTreeNode< InputType, OutputType >> |
f, |
|
|
std::vector< InputType > const & |
t, |
|
|
std::vector< OutputType > const & |
y |
|
) |
| |
|
inline |
Validate \(f(t) \approx y\).
- Returns
- True if the test is passed, false otherwise
◆ validatePowIPow() [1/2]
template<typename NumericType >
bool HeliosTests::ExprTreeTest::validatePowIPow |
( |
std::shared_ptr< IExprTreeNode< NumericType, NumericType >> |
f, |
|
|
size_t const |
expectedPowCount, |
|
|
size_t const |
expectedIPowCount |
|
) |
| |
|
inline |
◆ validatePowIPow() [2/2]
template<typename NumericType >
bool HeliosTests::ExprTreeTest::validatePowIPow |
( |
std::shared_ptr< UnivarExprTreeNode< NumericType >> |
f, |
|
|
size_t const |
expectedPowCount, |
|
|
size_t const |
expectedIPowCount |
|
) |
| |
|
inline |
Validate given tree as UnivarExprTreeNode contains exactly as many POW and IPOW nodes as specified.
- Returns
- True if the test is passed, false otherwise
The documentation for this class was generated from the following file: