[Rcpp-commits] r3162 - pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 29 00:55:48 CEST 2011


Author: dmbates
Date: 2011-07-29 00:55:48 +0200 (Fri, 29 Jul 2011)
New Revision: 3162

Modified:
   pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/CholmodSupport.h
Log:
Added a solveType member - there will be better ways of doing this

Modified: pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/CholmodSupport.h
===================================================================
--- pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/CholmodSupport.h	2011-07-28 22:53:25 UTC (rev 3161)
+++ pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/CholmodSupport.h	2011-07-28 22:55:48 UTC (rev 3162)
@@ -197,7 +197,7 @@
 	
 	inline Index cols() const { return m_cholmodFactor->n; }
 	inline Index rows() const { return m_cholmodFactor->n; }
-	
+	inline bool  isInitialized() const {return m_isInitialized;}
 	void setMode(CholmodMode mode)
 	{
 	    switch(mode)
@@ -224,6 +224,8 @@
 	    }
 	}
 	
+	void setSolveType(int type) {m_solveType = type;}
+
 	/** \brief Reports whether previous computation was successful.
 	 *
 	 * \returns \c Success if computation was succesful,
@@ -361,7 +363,7 @@
 	    
 	    // note: cd stands for Cholmod Dense
 	    cholmod_dense b_cd = viewAsCholmod(b.const_cast_derived());
-	    cholmod_dense* x_cd = M_cholmod_solve(CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod);
+	    cholmod_dense* x_cd = M_cholmod_solve(m_solveType, m_cholmodFactor, &b_cd, &m_cholmod);
 	    if(!x_cd)
 	    {
 		this->m_info = NumericalIssue;
@@ -381,7 +383,7 @@
 	    
 	    // note: cs stands for Cholmod Sparse
 	    cholmod_sparse b_cs = viewAsCholmod(b);
-	    cholmod_sparse* x_cs = M_cholmod_spsolve(CHOLMOD_A, m_cholmodFactor, &b_cs, &m_cholmod);
+	    cholmod_sparse* x_cs = M_cholmod_spsolve(m_solveType, m_cholmodFactor, &b_cs, &m_cholmod);
 	    if(!x_cs)
 	    {
 		this->m_info = NumericalIssue;
@@ -400,6 +402,7 @@
 	mutable cholmod_common m_cholmod;
 	cholmod_factor* m_cholmodFactor;
 	mutable ComputationInfo m_info;
+	mutable int m_solveType;
 	bool m_isInitialized;
 	int m_factorizationIsOk;
 	int m_analysisIsOk;



More information about the Rcpp-commits mailing list