Ok, I've pushed my changes to https://bitbucket.org/bjornpiltz/autodiff. It would be great if you could take a look!
I'm getting performance like:
Computing first order:
Fixed Dynamic Sparse
Eigen 72 ms 427 ms 718 ms
Sacado 194 ms 430 ms
Computing second order:
Fixed Dynamic Sparse
Eigen 553 ms 7813 ms 13983 ms
Sacado 1002 ms 3617 ms
The first goal performance-wise should be to make the second order dynamic case as fast as Sacado.
If you remember I suggested doing something like:
template<typename T>
struct MyTraits
{
};
template<>
struct MyTraits<double>
{
typedef double Real;
};
template<>
struct MyTraits<float>
{
typedef float Real;
};
template<typename DerType>
struct MyTraits<AutoDiffScalar<DerType> >
{
typedef MyTraits<AutoDiffScalar<DerType>::Real>::Real Real;
};
I think this should be put outside of the AutoDiff module, if you want Eigen to support matrices of matrices. I just don't know where exactly.
Björn