Graph Framework
|
Tests for piecewise constants nodes. More...
#include <cmath>
#include <cassert>
#include "../graph_framework/arithmetic.hpp"
#include "../graph_framework/piecewise.hpp"
#include "../graph_framework/math.hpp"
#include "../graph_framework/trigonometry.hpp"
#include "../graph_framework/jit.hpp"
Functions | |
template<jit::float_scalar T> | |
void | check (const T test, const T tolarance) |
Assert when difference is greater than the tolarance. | |
template<jit::float_scalar T> | |
void | compile (graph::input_nodes< T > inputs, graph::output_nodes< T > outputs, graph::map_nodes< T > setters, const T expected, const T tolarance) |
Compile kernal and check the result of the output. | |
template<jit::float_scalar T> | |
void | piecewise_1D () |
Tests for 1D piecewise nodes. | |
template<jit::float_scalar T> | |
void | piecewise_2D () |
Tests for 2D piecewise nodes. | |
template<jit::float_scalar T> | |
void | run_tests () |
Run tests with a specified backend. | |
int | main (int argc, const char *argv[]) |
Main program of the test. | |
Tests for piecewise constants nodes.
void check | ( | const T | test, |
const T | tolarance | ||
) |
Assert when difference is greater than the tolarance.
Specialize to check for complex numbers since complex has not <= operator.
T | Base type of the calculation. |
[in] | test | Test value. |
[in] | tolarance | Test tolarance. |
void compile | ( | graph::input_nodes< T > | inputs, |
graph::output_nodes< T > | outputs, | ||
graph::map_nodes< T > | setters, | ||
const T | expected, | ||
const T | tolarance | ||
) |
Compile kernal and check the result of the output.
T | Base type of the calculation. |
[in] | inputs | Kernel input nodes. |
[in] | outputs | Kernel output nodes. |
[in] | setters | Kernel set nodes. |
[in] | expected | Expected result. |
[in] | tolarance | Check tolarances. |
int main | ( | int | argc, |
const char * | argv[] | ||
) |
Main program of the test.
[in] | argc | Number of commandline arguments. |
[in] | argv | Array of commandline arguments. |
void piecewise_1D | ( | ) |
Tests for 1D piecewise nodes.
T | Base type of the calculation. |
void piecewise_2D | ( | ) |
Tests for 2D piecewise nodes.
T | Base type of the calculation. |
void run_tests | ( | ) |
Run tests with a specified backend.
T | Base type of the calculation. |