From f0c34c6822855bbb91d788cfd0983fd3ceb6345f Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Fri, 15 Jun 2012 17:23:54 +0200 Subject: [PATCH] Build finished... start debugging --- Eigen/src/SparseLU/SparseLU.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Eigen/src/SparseLU/SparseLU.h b/Eigen/src/SparseLU/SparseLU.h index 682cd465c..a07b5a9f3 100644 --- a/Eigen/src/SparseLU/SparseLU.h +++ b/Eigen/src/SparseLU/SparseLU.h @@ -130,9 +130,10 @@ class SparseLU } template - bool _solve(const MatrixBase &B, MatrixBase &X) const - { - eigen_assert(m_isInitialized && "The matrix should be factorized first"); + bool _solve(const MatrixBase &B, MatrixBase &_X) const + { + Dest& X(_X.derived()); + eigen_assert(m_factorizationIsOk && "The matrix should be factorized first"); EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); @@ -184,7 +185,8 @@ class SparseLU // Triangular solve Map, 0, OuterStride<> > A( &(Lval[luptr]), nsupc, nsupc, OuterStride<>(nsupr) ); - Block U(X, fsupc, 0, nsupc, nrhs); //FIXME TODO Consider more RHS + Map< Matrix, 0, OuterStride<> > U (&(X.data()[fsupc]), nsupc, nrhs, OuterStride<>(X.rows()) ); +// Block > U(X, fsupc, 0, nsupc, nrhs); //FIXME TODO Consider more RHS U = A.template triangularView().solve(U); // Matrix-vector product @@ -225,7 +227,7 @@ class SparseLU else { Map, 0, OuterStride<> > A( &(Lval[luptr]), nsupc, nsupc, OuterStride<>(nsupr) ); - Block U(X, fsupc, 0, nsupc, nrhs); + Map< Matrix, 0, OuterStride<> > U (&(X.data()[fsupc]), nsupc, nrhs, OuterStride<>(X.rows()) ); U = A.template triangularView().solve(U); } @@ -576,7 +578,7 @@ void SparseLU::factorize(const MatrixType& matrix) VectorBlock panel_lsubk(panel_lsub, k, m); VectorBlock repfnz_k(repfnz, k, m); info = LU_column_dfs(m, jj, m_perm_r.indices(), m_maxsuper, nseg, panel_lsubk, segrep, repfnz_k, xprune, marker, parent, xplore, m_glu); - if ( !info ) + if ( info ) { std::cerr << "UNABLE TO EXPAND MEMORY IN COLUMN_DFS() \n"; m_info = NumericalIssue; @@ -585,7 +587,7 @@ void SparseLU::factorize(const MatrixType& matrix) } // Numeric updates to this column VectorBlock dense_k(dense, k, m); - VectorBlock segrep_k(segrep, nseg1, m); + VectorBlock segrep_k(segrep, nseg1, m-nseg1); info = LU_column_bmod(jj, (nseg - nseg1), dense_k, tempv, segrep_k, repfnz_k, jcol, m_glu); if ( info ) {