aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sparse_solvers.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-05-04 14:25:12 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-05-04 14:25:12 +0000
commit28293142842c525eec1adde377999b065dea8cbf (patch)
tree22a6b32d00f507afaaa6a20c712ecd70c8b6ffb7 /test/sparse_solvers.cpp
parentddb6e96d48e353099911cf4179ea6285dce40d4c (diff)
new simplified API to fill sparse matrices (the old functions are
deprecated). Basically there are now only 2 functions to set a coefficient: 1) mat.coeffRef(row,col) = value; 2) mat.insert(row,col) = value; coeffRef has no limitation, insert assumes the coeff has not already been set, and raises an assert otherwise. In addition I added a much lower level, but more efficient filling mechanism for internal use only.
Diffstat (limited to 'test/sparse_solvers.cpp')
-rw-r--r--test/sparse_solvers.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sparse_solvers.cpp b/test/sparse_solvers.cpp
index e1ec1ef35..ce19153ff 100644
--- a/test/sparse_solvers.cpp
+++ b/test/sparse_solvers.cpp
@@ -37,12 +37,12 @@ initSPD(double density,
initSparse(density,aux,sparseMat,ForceNonZeroDiag);
refMat += aux * aux.adjoint();
}
- sparseMat.startFill();
+ sparseMat.setZero();
for (int j=0 ; j<sparseMat.cols(); ++j)
for (int i=j ; i<sparseMat.rows(); ++i)
if (refMat(i,j)!=Scalar(0))
- sparseMat.fill(i,j) = refMat(i,j);
- sparseMat.endFill();
+ sparseMat.insert(i,j) = refMat(i,j);
+ sparseMat.finalize();
}
template<typename Scalar> void sparse_solvers(int rows, int cols)