diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-10-26 16:26:20 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-10-26 16:26:20 +0200 |
commit | 5e95ee66621471b807392158815135b5aa4651c1 (patch) | |
tree | d7727a85f018bbc1d3178a5dc019624a40e795d0 | |
parent | 92044fcc2bf3889da7a320b8295917d5188c47d6 (diff) |
fix compilation and unit test of adolc
-rw-r--r-- | unsupported/Eigen/AdolcForward | 25 | ||||
-rw-r--r-- | unsupported/test/forward_adolc.cpp | 2 |
2 files changed, 14 insertions, 13 deletions
diff --git a/unsupported/Eigen/AdolcForward b/unsupported/Eigen/AdolcForward index 1ecf98794..cb71fbcd6 100644 --- a/unsupported/Eigen/AdolcForward +++ b/unsupported/Eigen/AdolcForward @@ -82,21 +82,22 @@ namespace Eigen { // the Adolc's type adouble is defined in the adtl namespace // therefore, the following internal::* functions *must* be defined // in the same namespace -namespace adtl { +namespace Eigen { namespace internal { - inline const adouble& internal::conj(const adouble& x) { return x; } - inline const adouble& internal::real(const adouble& x) { return x; } - inline adouble internal::imag(const adouble&) { return 0.; } - inline adouble internal::abs(const adouble& x) { return fabs(x); } - inline adouble internal::abs2(const adouble& x) { return x*x; } - inline adouble internal::sqrt(const adouble& x) { return sqrt(x); } - inline adouble internal::exp(const adouble& x) { return exp(x); } - inline adouble internal::log(const adouble& x) { return log(x); } - inline adouble internal::sin(const adouble& x) { return sin(x); } - inline adouble internal::cos(const adouble& x) { return cos(x); } - inline adouble internal::pow(const adouble& x, adouble y) { return pow(x, y); } + inline const adtl::adouble& conj(const adtl::adouble& x) { return x; } + inline const adtl::adouble& real(const adtl::adouble& x) { return x; } + inline adtl::adouble imag(const adtl::adouble&) { return 0.; } + inline adtl::adouble abs(const adtl::adouble& x) { return adtl::fabs(x); } + inline adtl::adouble abs2(const adtl::adouble& x) { return x*x; } + + using adtl::sqrt; + using adtl::exp; + using adtl::log; + using adtl::sin; + using adtl::cos; + using adtl::pow; } diff --git a/unsupported/test/forward_adolc.cpp b/unsupported/test/forward_adolc.cpp index 4bb35b05c..1971d883b 100644 --- a/unsupported/test/forward_adolc.cpp +++ b/unsupported/test/forward_adolc.cpp @@ -106,7 +106,7 @@ struct TestFunc1 template<typename Func> void adolc_forward_jacobian(const Func& f) { - typename Func::InputType x = Func::InputType::Random(); + typename Func::InputType x = Func::InputType::Random(f.inputs()); typename Func::ValueType y(f.values()), yref(f.values()); typename Func::JacobianType j(f.values(),f.inputs()), jref(f.values(),f.inputs()); |