diff options
Diffstat (limited to 'Eigen/src/Core/MatrixBase.h')
-rw-r--r-- | Eigen/src/Core/MatrixBase.h | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 3cb5e04fd..86994cb36 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -66,8 +66,7 @@ template<typename Derived> class MatrixBase using Base::MaxSizeAtCompileTime; using Base::IsVectorAtCompileTime; using Base::Flags; - using Base::CoeffReadCost; - + using Base::derived; using Base::const_cast_derived; using Base::rows; @@ -181,26 +180,20 @@ template<typename Derived> class MatrixBase #ifdef __CUDACC__ template<typename OtherDerived> EIGEN_DEVICE_FUNC - const typename LazyProductReturnType<Derived,OtherDerived>::Type + const Product<Derived,OtherDerived,LazyProduct> operator*(const MatrixBase<OtherDerived> &other) const { return this->lazyProduct(other); } #else -#ifdef EIGEN_TEST_EVALUATORS template<typename OtherDerived> const Product<Derived,OtherDerived> operator*(const MatrixBase<OtherDerived> &other) const; -#else - template<typename OtherDerived> - const typename ProductReturnType<Derived,OtherDerived>::Type - operator*(const MatrixBase<OtherDerived> &other) const; -#endif #endif template<typename OtherDerived> EIGEN_DEVICE_FUNC - const typename LazyProductReturnType<Derived,OtherDerived>::Type + const Product<Derived,OtherDerived,LazyProduct> lazyProduct(const MatrixBase<OtherDerived> &other) const; template<typename OtherDerived> @@ -214,7 +207,7 @@ template<typename Derived> class MatrixBase template<typename DiagonalDerived> EIGEN_DEVICE_FUNC - const DiagonalProduct<Derived, DiagonalDerived, OnTheRight> + const Product<Derived, DiagonalDerived, LazyProduct> operator*(const DiagonalBase<DiagonalDerived> &diagonal) const; template<typename OtherDerived> @@ -251,19 +244,14 @@ template<typename Derived> class MatrixBase template<int Index> EIGEN_DEVICE_FUNC typename ConstDiagonalIndexReturnType<Index>::Type diagonal() const; + + typedef Diagonal<Derived,DynamicIndex> DiagonalDynamicIndexReturnType; + typedef typename internal::add_const<Diagonal<const Derived,DynamicIndex> >::type ConstDiagonalDynamicIndexReturnType; - // Note: The "MatrixBase::" prefixes are added to help MSVC9 to match these declarations with the later implementations. - // On the other hand they confuse MSVC8... - #if (defined _MSC_VER) && (_MSC_VER >= 1500) // 2008 or later - typename MatrixBase::template DiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index); - typename MatrixBase::template ConstDiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index) const; - #else EIGEN_DEVICE_FUNC - typename DiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index); - + DiagonalDynamicIndexReturnType diagonal(Index index); EIGEN_DEVICE_FUNC - typename ConstDiagonalIndexReturnType<DynamicIndex>::Type diagonal(Index index) const; - #endif + ConstDiagonalDynamicIndexReturnType diagonal(Index index) const; template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; }; template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; }; @@ -334,10 +322,12 @@ template<typename Derived> class MatrixBase NoAlias<Derived,Eigen::MatrixBase > noalias(); - inline const ForceAlignedAccess<Derived> forceAlignedAccess() const; - inline ForceAlignedAccess<Derived> forceAlignedAccess(); - template<bool Enable> inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type forceAlignedAccessIf() const; - template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf(); + // TODO forceAlignedAccess is temporarily disabled + // Need to find a nicer workaround. + inline const Derived& forceAlignedAccess() const { return derived(); } + inline Derived& forceAlignedAccess() { return derived(); } + template<bool Enable> inline const Derived& forceAlignedAccessIf() const { return derived(); } + template<bool Enable> inline Derived& forceAlignedAccessIf() { return derived(); } Scalar trace() const; @@ -348,10 +338,10 @@ template<typename Derived> class MatrixBase /** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix * \sa ArrayBase::matrix() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return derived(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); } /** \returns a const \link Eigen::ArrayBase Array \endlink expression of this matrix * \sa ArrayBase::matrix() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const { return derived(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const { return ArrayWrapper<const Derived>(derived()); } /////////// LU module /////////// @@ -361,7 +351,8 @@ template<typename Derived> class MatrixBase const PartialPivLU<PlainObject> lu() const; EIGEN_DEVICE_FUNC - const internal::inverse_impl<Derived> inverse() const; + const Inverse<Derived> inverse() const; + template<typename ResultType> void computeInverseAndDetWithCheck( ResultType& inverse, @@ -394,6 +385,7 @@ template<typename Derived> class MatrixBase /////////// SVD module /////////// JacobiSVD<PlainObject> jacobiSvd(unsigned int computationOptions = 0) const; + BDCSVD<PlainObject> bdcSvd(unsigned int computationOptions = 0) const; /////////// Geometry module /////////// |