fix some compilation issues

This commit is contained in:
Gael Guennebaud 2011-09-23 16:28:26 +02:00
parent 823b2105b6
commit d8ae978b65
2 changed files with 4 additions and 4 deletions

View File

@ -495,8 +495,8 @@ template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows
typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType;
};
template<typename DerType, typename T>
struct scalar_product_traits<AutoDiffScalar<DerType>,T>
template<typename DerType>
struct scalar_product_traits<AutoDiffScalar<DerType>,typename DerType::Scalar>
{
typedef AutoDiffScalar<DerType> ReturnType;
};
@ -605,7 +605,7 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(acos,
template<typename DerType> struct NumTraits<AutoDiffScalar<DerType> >
: NumTraits< typename NumTraits<typename DerType::Scalar>::Real >
{
typedef AutoDiffScalar<Matrix<typename NumTraits<typename DerType::Scalar>::Real,DerType::ColsAtCompileTime,DerType::RowsAtCompileTime> > Real;
typedef AutoDiffScalar<Matrix<typename NumTraits<typename DerType::Scalar>::Real,DerType::RowsAtCompileTime,DerType::ColsAtCompileTime> > Real;
typedef AutoDiffScalar<DerType> NonInteger;
typedef AutoDiffScalar<DerType>& Nested;
enum{

View File

@ -40,7 +40,7 @@ template<typename Vector>
EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p)
{
typedef typename Vector::Scalar Scalar;
return (p-Vector(Scalar(-1),Scalar(1.))).norm();
return (p-Vector(Scalar(-1),Scalar(1.))).norm() + (p.array() * p.array()).sum() + p.dot(p);
}
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>