mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
adapt AutoDiff to scalar_product_traits
This commit is contained in:
parent
c519be2bac
commit
225fd0f579
@ -489,20 +489,32 @@ struct make_coherent_impl<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols> struct scalar_product_traits<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols>,A_Scalar>
|
template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols>
|
||||||
|
struct scalar_product_traits<Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols>,A_Scalar>
|
||||||
{
|
{
|
||||||
typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType;
|
enum { Defined = 1 };
|
||||||
|
typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols> struct scalar_product_traits<A_Scalar, Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> >
|
template<typename A_Scalar, int A_Rows, int A_Cols, int A_Options, int A_MaxRows, int A_MaxCols>
|
||||||
|
struct scalar_product_traits<A_Scalar, Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> >
|
||||||
{
|
{
|
||||||
typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType;
|
enum { Defined = 1 };
|
||||||
|
typedef Matrix<A_Scalar, A_Rows, A_Cols, A_Options, A_MaxRows, A_MaxCols> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename DerType>
|
template<typename DerType>
|
||||||
struct scalar_product_traits<AutoDiffScalar<DerType>,typename DerType::Scalar>
|
struct scalar_product_traits<AutoDiffScalar<DerType>,typename DerType::Scalar>
|
||||||
{
|
{
|
||||||
typedef AutoDiffScalar<DerType> ReturnType;
|
enum { Defined = 1 };
|
||||||
|
typedef AutoDiffScalar<DerType> ReturnType;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename DerType>
|
||||||
|
struct scalar_product_traits<typename DerType::Scalar,AutoDiffScalar<DerType> >
|
||||||
|
{
|
||||||
|
enum { Defined = 1 };
|
||||||
|
typedef AutoDiffScalar<DerType> ReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user