AutomaticDifferentiation/test/dual_test.cpp
2019-03-30 16:15:31 +01:00

40 lines
755 B
C++
Executable file

#include <catch2/catch.hpp>
#include <iostream>
#include "../utils.hpp"
#include "../AutomaticDifferentiation.hpp"
#define print(x) PRINT_VAR(x);
#define printstr(x) PRINT_STR(x);
template<typename T>
bool check_almost_equal(const std::vector<T> & v1, const std::vector<T> & v2, T tol)
{
bool ok = true;
for(size_t i = 0 ; i < v1.size() ; i++)
if(fabs(v1[i] - v2[i]) > tol)
{
ok = false;
break;
}
return ok;
}
TEST_CASE( "Dual numbers : Constructors", "[dual]" )
{
std::cout.precision(16);
using S = double;
using D = Dual<S>;
using V = std::vector<S>;
SECTION( "Default Constructor" ) {
}
SECTION( "Constructor with int" ) {
}
}
// CHECK()
// REQUIRE()