[sdpb] 117/233: Small documentation changes to SDP, some function renaming

Tobias Hansen thansen at moszumanska.debian.org
Thu Mar 9 04:06:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository sdpb.

commit 26ae2c52fa6f5481cd1e0cfc12403f755f653b0b
Author: David Simmons-Duffin <davidsd at gmail.com>
Date:   Sat Jan 3 21:13:24 2015 +1300

    Small documentation changes to SDP, some function renaming
---
 src/SDP.cpp   |  4 ++--
 src/SDP.h     | 13 ++++++++++---
 src/parse.cpp | 23 -----------------------
 3 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/src/SDP.cpp b/src/SDP.cpp
index aa01dc8..dc869c0 100644
--- a/src/SDP.cpp
+++ b/src/SDP.cpp
@@ -25,7 +25,7 @@ Matrix sampleBilinearBasis(const int maxDegree,
 }
 
 DualConstraintGroup
-polVecMatToDualConstraintGroup(const PolynomialVectorMatrix &m) {
+dualConstraintGroupFromPolVecMat(const PolynomialVectorMatrix &m) {
   DualConstraintGroup g;
 
   assert(m.rows == m.cols);
@@ -122,7 +122,7 @@ SDP bootstrapSDP(const Vector &affineObjective,
   vector<DualConstraintGroup> dualConstraintGroups;
   for (vector<PolynomialVectorMatrix>::const_iterator m = polVectorMatrices.begin();
        m != polVectorMatrices.end(); m++)
-    dualConstraintGroups.push_back(polVecMatToDualConstraintGroup(*m));
+    dualConstraintGroups.push_back(dualConstraintGroupFromPolVecMat(*m));
 
   Vector objective = affineObjective;
   objective.erase(objective.begin());
diff --git a/src/SDP.h b/src/SDP.h
index 77995ba..c2c0bc6 100644
--- a/src/SDP.h
+++ b/src/SDP.h
@@ -247,10 +247,13 @@ class DualConstraintGroup {
  public:
   int dim;
   int degree;
+
   // constraintMatrix = B, a P'xN Matrix
   Matrix constraintMatrix;
+
   // constraintConstants = c, a vector of length P'
   Vector constraintConstants;
+
   // bilinearBases is a vector of Matrices encoding the \chi_{b,k}
   // entering the constraint matrices A_p, as described
   // above. `bilinearBases' here has the structure of
@@ -269,8 +272,9 @@ class DualConstraintGroup {
 //   \vec P^{rs}(x) = (P^{rs}_{-1}(x), P^{rs}_0, ... , P^{rs}_{N-1}(x))
 //
 // Consider a vector y = (y_0, ..., y_{N-1}) of length N, and let
-// (1,y) denote the vector of length N+1 whose components are 1, given
-// by the components of y.  As explained in the manual, the constraint
+// (1,y) denote the vector of length N+1 whose components are 1,
+// followed by the components of y.  As explained in the manual, the
+// constraint
 //
 //   (1,y) . M(x) is positive semidefinite
 //
@@ -285,15 +289,18 @@ class PolynomialVectorMatrix {
  public:
   int rows; // rows of M
   int cols; // cols of M
+
   // elements of M, in row-major order
   vector<vector<Polynomial> > elements;
 
   // A list of real numbers x_k (0 <= k <= degree(M)) at which to
   // sample M(x) to construct the \chi_{b,k}.
   vector<Real> samplePoints;
+
   // A list of real numbers s_k (0 <= k <= degree(M)) to scale M(x_k)
   // and the corresponding \chi_{b,k}.
   vector<Real> sampleScalings;
+
   // bilinearBasis[m] = q_m(x) (0 <= m <= degree/2), where q_m is a
   // polynomial with degree deg(q_m) = m.
   vector<Polynomial> bilinearBasis;
@@ -318,7 +325,7 @@ class PolynomialVectorMatrix {
   }
 };
 
-DualConstraintGroup polVecMatToDualConstraintGroup(const PolynomialVectorMatrix &m);
+DualConstraintGroup dualConstraintGroupFromPolVecMat(const PolynomialVectorMatrix &m);
 
 SDP sdpFromConstraintGroups(const Vector &objective,
                             const Real &objectiveConst,
diff --git a/src/parse.cpp b/src/parse.cpp
index 85b61b2..692aa84 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -85,26 +85,3 @@ SDP readBootstrapSDP(const path sdpFile) {
   doc.LoadFile(sdpFile.c_str());
   return parseBootstrapSDP(doc.FirstChildElement("sdp"));
 }
-
-// Reading SDPs defined by DualConstraintGroups is not necessary --
-// remove this functionality?
-
-// DualConstraintGroup parseDualConstraintGroup(XMLElement *xml) {
-//   DualConstraintGroup g;
-//   g.dim                 = parseInt(xml->FirstChildElement("dim"));
-//   g.degree              = parseInt(xml->FirstChildElement("degree"));
-//   g.constraintMatrix    = parseMatrix(xml->FirstChildElement("constraintMatrix"));
-//   g.constraintConstants = parseVector(xml->FirstChildElement("constraintConstants"));
-//   g.bilinearBases       = parseMany("bilinearBasisMatrix",
-//                                     parseMatrix,
-//                                     xml->FirstChildElement("bilinearBases"));
-//   return g;
-// }
-
-// SDP parseBootstrapSDP(XMLElement *xml) {
-//   return sdpFromConstraintGroups(parseVector(xml->FirstChildElement("objective")),
-//                                  parseReal(xml->FirstChildElement("objectiveConst")),
-//                                  parseMany("dualConstraintGroup",
-//                                            parseDualConstraintGroup,
-//                                            xml->FirstChildElement("dualConstraintGroups")));
-// }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sdpb.git



More information about the debian-science-commits mailing list