Sparse module: add experimental support for TAUCS and CHOLMOD with:

* bidirectionnal mapping
 * full cholesky factorization
This commit is contained in:
Gael Guennebaud
2008-10-05 13:38:38 +00:00
parent a930dfb229
commit b730c6f57d
6 changed files with 312 additions and 18 deletions

View File

@@ -28,7 +28,8 @@
/** Stores a sparse set of values as a list of values and a list of indices.
*
*/
template<typename Scalar> class SparseArray
template<typename Scalar>
class SparseArray
{
public:
SparseArray()
@@ -105,6 +106,15 @@ template<typename Scalar> class SparseArray
int& index(int i) { return m_indices[i]; }
const int& index(int i) const { return m_indices[i]; }
static SparseArray Map(int* indices, Scalar* values, int size)
{
SparseArray res;
res.m_indices = indices;
res.m_values = values;
res.m_allocatedSize = res.m_size = size;
return res;
}
protected:
void reallocate(int size)