From 0c9b08e46e7507d9f13200f0702bc57ed6aae52c Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Thu, 14 Jun 2012 18:45:04 +0200 Subject: build complete... almost --- Eigen/src/OrderingMethods/Ordering.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'Eigen/src/OrderingMethods') diff --git a/Eigen/src/OrderingMethods/Ordering.h b/Eigen/src/OrderingMethods/Ordering.h index 3a3e3f6fc..eedaed144 100644 --- a/Eigen/src/OrderingMethods/Ordering.h +++ b/Eigen/src/OrderingMethods/Ordering.h @@ -32,9 +32,8 @@ template class OrderingBase { public: - typedef typename internal::traits::MatrixType MatrixType; - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Index Index; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::traits::Index Index; typedef PermutationMatrix PermutationType; public: @@ -42,10 +41,12 @@ class OrderingBase { } + template OrderingBase(const MatrixType& mat):OrderingBase() { compute(mat); } + template Derived& compute(const MatrixType& mat) { return derived().compute(mat); @@ -61,9 +62,9 @@ class OrderingBase /** * Get the permutation vector */ - PermutationType& get_perm(const MatrixType& mat) + PermutationType& get_perm() { - if (m_isInitialized = true) return m_P; + if (m_isInitialized == true) return m_P; else abort(); // FIXME Should find a smoother way to exit with error code } @@ -101,7 +102,6 @@ class OrderingBase mutable bool m_isInitialized; SparseMatrix m_mat; // Stores the (symmetrized) matrix to permute }; - /** * Get the approximate minimum degree ordering * If the matrix is not structurally symmetric, an ordering of A^T+A is computed @@ -161,6 +161,15 @@ class AMDOrdering : public OrderingBase > }; +namespace internal { + template + struct traits > + { + typedef _Scalar Scalar; + typedef _Index Index; + }; +} + /** * Get the column approximate minimum degree ordering * The matrix should be in column-major format -- cgit v1.2.3