[eigen3] 02/06: Port unsupported constrained CG to Eigen3. Thanks to Gael Guennebaud <gael.guennebaud at gmail.com>
Anton Gladky
gladk at moszumanska.debian.org
Wed Jan 15 22:12:16 UTC 2014
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository eigen3.
commit 38ab047b7c74a8a018d360c45223260b89c2554a
Author: Anton Gladky <gladk at debian.org>
Date: Wed Jan 15 22:15:42 2014 +0100
Port unsupported constrained CG to Eigen3. Thanks to Gael Guennebaud <gael.guennebaud at gmail.com>
---
.../patches/port_ConstrainedConjGrad_eigen3.patch | 41 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 42 insertions(+)
diff --git a/debian/patches/port_ConstrainedConjGrad_eigen3.patch b/debian/patches/port_ConstrainedConjGrad_eigen3.patch
new file mode 100644
index 0000000..b643cb4
--- /dev/null
+++ b/debian/patches/port_ConstrainedConjGrad_eigen3.patch
@@ -0,0 +1,41 @@
+Description: Port unsupported constrained CG to Eigen3
+Author: Anton Gladky <gladk at debian.org>
+Applied-Upstream: https://bitbucket.org/eigen/eigen/commits/387c04265505096fb9051d9c10408a3700c258ae
+Last-Update: 2014-01-15
+
+--- eigen3-3.2.0.orig/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h
++++ eigen3-3.2.0/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h
+@@ -58,7 +58,9 @@ void pseudo_inverse(const CMatrix &C, CI
+ Scalar rho, rho_1, alpha;
+ d.setZero();
+
+- CINV.startFill(); // FIXME estimate the number of non-zeros
++ typedef Triplet<double> T;
++ std::vector<T> tripletList;
++
+ for (Index i = 0; i < rows; ++i)
+ {
+ d[i] = 1.0;
+@@ -84,11 +86,12 @@ void pseudo_inverse(const CMatrix &C, CI
+ // FIXME add a generic "prune/filter" expression for both dense and sparse object to sparse
+ for (Index j=0; j<l.size(); ++j)
+ if (l[j]<1e-15)
+- CINV.fill(i,j) = l[j];
++ tripletList.push_back(T(i,j,l(j)));
+
++
+ d[i] = 0.0;
+ }
+- CINV.endFill();
++ CINV.setFromTriplets(tripletList.begin(), tripletList.end());
+ }
+
+
+@@ -103,6 +106,7 @@ template<typename TMatrix, typename CMat
+ void constrained_cg(const TMatrix& A, const CMatrix& C, VectorX& x,
+ const VectorB& b, const VectorF& f, IterationController &iter)
+ {
++ using std::sqrt;
+ typedef typename TMatrix::Scalar Scalar;
+ typedef typename TMatrix::Index Index;
+ typedef Matrix<Scalar,Dynamic,1> TmpVec;
diff --git a/debian/patches/series b/debian/patches/series
index 14e779a..de2cbdf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
removeBVH_example.patch
installFindEigen3.patch
+port_ConstrainedConjGrad_eigen3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/eigen3.git
More information about the debian-science-commits
mailing list