From 251c0f45ac275d6635a9453d6df65c9d749ef245 Mon Sep 17 00:00:00 2001 From: Thomas Capricelli Date: Sun, 27 Sep 2009 23:54:06 +0200 Subject: remove references to adolc and split tests functions for clarity --- unsupported/test/autodiff.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'unsupported/test/autodiff.cpp') diff --git a/unsupported/test/autodiff.cpp b/unsupported/test/autodiff.cpp index 43ef1a308..b1164897c 100644 --- a/unsupported/test/autodiff.cpp +++ b/unsupported/test/autodiff.cpp @@ -111,7 +111,7 @@ struct TestFunc1 } }; -template void adolc_forward_jacobian(const Func& f) +template void forward_jacobian(const Func& f) { typename Func::InputType x = Func::InputType::Random(f.inputs()); typename Func::ValueType y(f.values()), yref(f.values()); @@ -134,21 +134,29 @@ template void adolc_forward_jacobian(const Func& f) VERIFY_IS_APPROX(j, jref); } -void test_autodiff() +void test_autodiff_scalar() { std::cerr << foo(1,2) << "\n"; AutoDiffScalar ax(1,Vector2f::UnitX()); AutoDiffScalar ay(2,Vector2f::UnitY()); std::cerr << foo >(ax,ay).value() << " <> " << foo >(ax,ay).derivatives().transpose() << "\n\n"; +} +void test_autodiff_jacobian() +{ for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1()) )); - CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1()) )); - CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1()) )); - CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1()) )); - CALL_SUBTEST(( adolc_forward_jacobian(TestFunc1(3,3)) )); + CALL_SUBTEST(( forward_jacobian(TestFunc1()) )); + CALL_SUBTEST(( forward_jacobian(TestFunc1()) )); + CALL_SUBTEST(( forward_jacobian(TestFunc1()) )); + CALL_SUBTEST(( forward_jacobian(TestFunc1()) )); + CALL_SUBTEST(( forward_jacobian(TestFunc1(3,3)) )); } - -// exit(1); } + +void test_autodiff() +{ + test_autodiff_scalar(); + test_autodiff_jacobian(); +} + -- cgit v1.2.3