diff options
author | 2011-01-23 21:53:28 -0500 | |
---|---|---|
committer | 2011-01-23 21:53:28 -0500 | |
commit | 1dabd133cc7b547ded5750e3fd1a6c6701ba47b5 (patch) | |
tree | 5ef2cd6a6337f0e2591d03e097b41fe7ea71d2a7 /Eigen/src/Core/TriangularMatrix.h | |
parent | 5c82fd7f40e926e07a2303bc144334286fe48d70 (diff) |
pass eigen2's triangular test
Diffstat (limited to 'Eigen/src/Core/TriangularMatrix.h')
-rw-r--r-- | Eigen/src/Core/TriangularMatrix.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index af5092a7e..3b5f5986b 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -295,6 +295,36 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView <Mode,false,OtherDerived,OtherDerived::IsVectorAtCompileTime,MatrixType,false> (lhs.derived(),rhs.m_matrix); } + + #ifdef EIGEN2_SUPPORT + + template<typename OtherMatrixType> + struct eigen2_product_return_type + { + typedef typename TriangularView<MatrixType,Mode>::DenseMatrixType DenseMatrixType; + typedef typename TriangularView<OtherMatrixType,Mode>::DenseMatrixType OtherDenseMatrixType; + typedef typename ProductReturnType<DenseMatrixType, OtherDenseMatrixType>::Type ProdRetType; + typedef typename ProdRetType::PlainObject type; + }; + template<typename OtherMatrixType> + const typename eigen2_product_return_type<OtherMatrixType>::type + operator*(const TriangularView<OtherMatrixType, Mode>& rhs) const + { + return toDenseMatrix() * rhs.toDenseMatrix(); + } + + template<typename OtherMatrixType> + bool isApprox(const TriangularView<OtherMatrixType, Mode>& other, typename NumTraits<Scalar>::Real precision = NumTraits<Scalar>::dummy_precision()) const + { + return toDenseMatrix().isApprox(other.toDenseMatrix(), precision); + } + template<typename OtherDerived> + bool isApprox(const MatrixBase<OtherDerived>& other, typename NumTraits<Scalar>::Real precision = NumTraits<Scalar>::dummy_precision()) const + { + return toDenseMatrix().isApprox(other, precision); + } + + #endif // EIGEN2_SUPPORT template<int Side, typename OtherDerived> typename internal::plain_matrix_type_column_major<OtherDerived>::type |