aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/OrderingMethods
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2012-06-14 18:45:04 +0200
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2012-06-14 18:45:04 +0200
commit0c9b08e46e7507d9f13200f0702bc57ed6aae52c (patch)
treebc319fe32b4bdfa8dd601082e25c508606f53853 /Eigen/src/OrderingMethods
parentf8a0745cb0426eb3095dbea24288a64eddab04f0 (diff)
build complete... almost
Diffstat (limited to 'Eigen/src/OrderingMethods')
-rw-r--r--Eigen/src/OrderingMethods/Ordering.h21
1 files changed, 15 insertions, 6 deletions
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 Derived>
class OrderingBase
{
public:
- typedef typename internal::traits<Derived>::MatrixType MatrixType;
- typedef typename MatrixType::Scalar Scalar;
- typedef typename MatrixType::Index Index;
+ typedef typename internal::traits<Derived>::Scalar Scalar;
+ typedef typename internal::traits<Derived>::Index Index;
typedef PermutationMatrix<Dynamic, Dynamic, Index> PermutationType;
public:
@@ -42,10 +41,12 @@ class OrderingBase
{
}
+ template<typename MatrixType>
OrderingBase(const MatrixType& mat):OrderingBase()
{
compute(mat);
}
+ template<typename MatrixType>
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<Scalar,ColMajor,Index> 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<AMDOrdering<Scalar, Index> >
};
+namespace internal {
+ template <typename _Scalar, typename _Index>
+ struct traits<AMDOrdering<_Scalar, _Index> >
+ {
+ typedef _Scalar Scalar;
+ typedef _Index Index;
+ };
+}
+
/**
* Get the column approximate minimum degree ordering
* The matrix should be in column-major format