[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323

Bernhard R. Link brlink at debian.org
Tue Apr 24 15:54:25 UTC 2012


The following commit has been merged in the cleanedupstream branch:
commit a77a4cd18567e173229b28505fb1775a0ac36085
Author: Yue Ren <ren at mathematik.uni-kl.de>
Date:   Tue Mar 27 14:12:37 2012 +0200

    fix,chg: bug in minimal/maximalFace, removed redundant code in gfanlib

diff --git a/callpolymake/polymake_wrapper.cc b/callpolymake/polymake_wrapper.cc
index 6134d46..f8dca15 100644
--- a/callpolymake/polymake_wrapper.cc
+++ b/callpolymake/polymake_wrapper.cc
@@ -1283,10 +1283,10 @@ BOOLEAN PMminkowskiSum(leftv res, leftv args)
 }
 
 
-polymake::Matrix<polymake::Integer> raysOf(const polymake::perl::Object* zf, 
-                                           const polymake::Set<polymake::Integer>* s)
+polymake::Matrix<polymake::Integer> verticesOf(const polymake::perl::Object* p, 
+                                               const polymake::Set<polymake::Integer>* s)
 {
-  polymake::Matrix<polymake::Integer> allrays = zf->give("RAYS");
+  polymake::Matrix<polymake::Integer> allrays = p->give("VERTICES");
   polymake::Matrix<polymake::Integer> wantedrays;
   bool ok = true;
   for(Entire<Set<Integer> >::const_iterator i=polymake::entire(*s); !i.at_end(); i++)
@@ -1320,9 +1320,9 @@ BOOLEAN PMmaximalFace(leftv res, leftv args)
         o.take("LINEAR_OBJECTIVE") << Intvec2PmVectorInteger(iv);
         p->take("LP") << o;
         polymake::Set<polymake::Integer> mf = p->give("LP.MAXIMAL_FACE");
+        polymake::Matrix<polymake::Integer> vertices = verticesOf(p,&mf);
         delete p;
-        polymake::Matrix<polymake::Integer> rays = raysOf(p,&mf);
-        maxface = new intvec(PmMatrixInteger2Intvec(&rays,ok));
+        maxface = new intvec(PmMatrixInteger2Intvec(&vertices,ok));
       }
       catch (const std::exception& ex) 
       {
@@ -1363,9 +1363,9 @@ BOOLEAN PMminimalFace(leftv res, leftv args)
         o.take("LINEAR_OBJECTIVE") << Intvec2PmVectorInteger(iv);
         p->take("LP") << o;
         polymake::Set<polymake::Integer> mf = p->give("LP.MINIMAL_FACE");
+        polymake::Matrix<polymake::Integer> vertices = verticesOf(p,&mf);
         delete p;
-        polymake::Matrix<polymake::Integer> rays = raysOf(p,&mf);
-        minface = new intvec(PmMatrixInteger2Intvec(&rays,ok));
+        minface = new intvec(PmMatrixInteger2Intvec(&vertices,ok));
       }
       catch (const std::exception& ex) 
       {
diff --git a/gfanlib/gfanlib_zcone.cpp b/gfanlib/gfanlib_zcone.cpp
index 9b60e70..2f46a49 100644
--- a/gfanlib/gfanlib_zcone.cpp
+++ b/gfanlib/gfanlib_zcone.cpp
@@ -952,28 +952,12 @@ ZCone ZCone::positiveOrthant(int dimension)
 
 ZCone ZCone::givenByRays(ZMatrix const &generators, ZMatrix const &linealitySpace)
 {
-  //rewrite modulo lineality space
-  ZMatrix newGenerators(generators.getHeight(),generators.getWidth());
-  {
-    QMatrix l=ZToQMatrix(linealitySpace);
-    l.reduce();
-    for(int i=0;i<generators.getHeight();i++)
-      newGenerators[i]=QToZVectorPrimitive(l.canonicalize(ZToQVector(generators[i])));
-  }
-
   ZCone dual(newGenerators,linealitySpace);
-  dual.findFacets();
-  dual.canonicalize();
   ZMatrix inequalities=dual.extremeRays();
   // because extremeRays was called, the following is already in canonical form
   ZMatrix extremeRays=dual.getInequalities();
   ZMatrix linSpace=dual.getEquations();
-
-  ZMatrix span=generators;
-  span.append(linealitySpace);
-  QMatrix m2Q=ZToQMatrix(span);
-  ZMatrix equations=QToZMatrixPrimitive(m2Q.reduceAndComputeKernel());
-  // ZMatrix equations=dual.generatorsOfLinealitySpace();
+  ZMatrix equations=dual.generatorsOfLinealitySpace();
 
   //nothing of the span is known, passed empty matrix will be ignored
   ZMatrix sspan;

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list