diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-05-23 13:34:04 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-05-23 13:34:04 +0200 |
commit | 46bee5682fc41a8e2ad1f563b6362a9297ca3094 (patch) | |
tree | 2dc3af69d997b997ea9c5e55b8fb18ce84317e09 /Eigen/src/Core/TriangularMatrix.h | |
parent | 074b067624e45c8e9f42f2347509d06d0d437226 (diff) |
clean a bit previous patch (ctor vs static_cast and a few bits)
Diffstat (limited to 'Eigen/src/Core/TriangularMatrix.h')
-rw-r--r-- | Eigen/src/Core/TriangularMatrix.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 38c4f1949..c04fa0c32 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -448,6 +448,8 @@ struct triangular_assignment_selector col = (UnrollCount-1) / Derived1::RowsAtCompileTime, row = (UnrollCount-1) % Derived1::RowsAtCompileTime }; + + typedef typename Derived1::Scalar Scalar; inline static void run(Derived1 &dst, const Derived2 &src) { @@ -466,9 +468,9 @@ struct triangular_assignment_selector else if(ClearOpposite) { if (Mode&UnitDiag && row==col) - dst.coeffRef(row, col) = 1; + dst.coeffRef(row, col) = Scalar(1); else - dst.coeffRef(row, col) = static_cast<typename Derived1::Scalar>(0); + dst.coeffRef(row, col) = Scalar(0); } } }; @@ -484,6 +486,7 @@ template<typename Derived1, typename Derived2, bool ClearOpposite> struct triangular_assignment_selector<Derived1, Derived2, Upper, Dynamic, ClearOpposite> { typedef typename Derived1::Index Index; + typedef typename Derived1::Scalar Scalar; inline static void run(Derived1 &dst, const Derived2 &src) { for(Index j = 0; j < dst.cols(); ++j) @@ -493,7 +496,7 @@ struct triangular_assignment_selector<Derived1, Derived2, Upper, Dynamic, ClearO dst.copyCoeff(i, j, src); if (ClearOpposite) for(Index i = maxi+1; i < dst.rows(); ++i) - dst.coeffRef(i, j) = static_cast<typename Derived1::Scalar>(0); + dst.coeffRef(i, j) = Scalar(0); } } }; |