1 // Copyright (c) 2010-2015 Anna M. Bigatti, Christof Soeger 2 // Authors: 2010-2015 Anna M. Bigatti, Christof Soeger 3 4 // This file is part of the source of CoCoALib, the CoCoA Library. 5 6 // CoCoALib is free software: you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation, either version 3 of the License, or 9 // (at your option) any later version. 10 11 // CoCoALib is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 16 // You should have received a copy of the GNU General Public License 17 // along with CoCoALib. If not, see <http://www.gnu.org/licenses/>. 18 19 20 // Source code for Normaliz integration 21 22 #include "CoCoA/ExternalLibs-Normaliz.H" 23 24 #ifdef CoCoA_WITH_NORMALIZ 25 26 #include "CoCoA/BigIntOps.H" 27 #include "CoCoA/BigRat.H" 28 #include "CoCoA/TmpPPVector.H" 29 #include "CoCoA/convert.H" 30 #include "CoCoA/error.H" 31 #include "CoCoA/matrix.H" 32 #include "CoCoA/SparsePolyRing.H" 33 #include "CoCoA/symbol.H" 34 #include "CoCoA/QuasiPoly.H" 35 36 #include "CoCoA/VectorOps.H" // just for debugging 37 38 //#include "libnormaliz/libnormaliz.h" 39 using libnormaliz::Cone; 40 using libnormaliz::ConeProperties; 41 42 43 44 // #include <list> 45 // using std::list; 46 #include <map> 47 using std::map; 48 #include <vector> 49 using std::vector; 50 #include <ostream> 51 using std::ostream; 52 using std::endl; 53 #include <sstream> // for ErrorMessage 54 55 56 namespace CoCoA 57 { 58 59 namespace Normaliz 60 { 61 ToInputType(const std::string & TypeString)62 libnormaliz::InputType ToInputType(const std::string& TypeString) 63 { 64 return libnormaliz::to_type(TypeString); 65 } 66 67 class ConeImpl: protected IntrusiveReferenceCount 68 { 69 friend class SmartPtrIRC<const ConeImpl>; // Morally "friend Cone", so it can alter reference count. 70 71 public: 72 ConeImpl(libnormaliz::Type::InputType InputType, const std::vector<std::vector<BigInt> >& v); 73 ConeImpl(const std::map< libnormaliz::InputType, std::vector<std::vector<BigInt> > >& m); 74 ConeImpl(libnormaliz::Type::InputType InputType, const PPVector& v); 75 friend void SetVerbosityLevel(cone& c, long n); // 0 off/ >1 on 76 friend long VerbosityLevel(cone& c); 77 friend std::vector<std::vector<BigInt> > HilbertBasis(const cone& c); 78 friend std::vector<std::vector<BigInt> > ModuleGenerators(const cone& c); 79 friend std::vector<std::vector<BigInt> > TriangulationGenerators(const cone& c); 80 friend std::vector<std::vector<BigInt> > ExtremeRays(const cone& c); 81 friend std::vector<std::vector<BigInt> > VerticesOfPolyhedron(const cone& c); 82 friend std::vector<std::vector<BigInt> > Deg1Elements(const cone& c); 83 friend std::vector<std::vector<BigInt> > GeneratorsOfToricRing(const cone& c); 84 friend std::vector<std::vector<BigInt> > SupportHyperplanes(const cone& c); 85 friend std::vector<std::vector<BigInt> > Equations(const cone& c); 86 friend std::vector<std::vector<BigInt> > Congruences(const cone& c); 87 friend std::vector<std::vector<BigInt> > ExcludedFaces(const cone& c); 88 //friend std::vector<BigInt> HVector(const cone& c); 89 friend HPSeries HilbertSeries(const cone& c); 90 friend RingElem HilbertPoly(const cone& c); 91 friend QuasiPoly HilbertQuasiPoly(const cone& c); 92 friend BigRat multiplicity(const cone& c); 93 friend std::vector<BigRat> grading(const cone& c); 94 friend bool IsPointed(const cone& c); 95 friend bool IsInhomogeneous(const cone& c); 96 friend bool IsIntegrallyClosed(const cone& c); 97 friend bool IsDeg1HilbertBasis(const cone& c); 98 friend long EmbeddingDim(const cone& c); 99 friend long rank(const cone& c); 100 friend long RecessionRank(const cone& c); 101 friend long AffineDim(const cone& c); 102 friend long ModuleRank(const cone& c); 103 friend std::vector<BigInt> dehomogenization(const cone& c); 104 105 public: 106 void myComputation(const libnormaliz::ConeProperties& CPs) const; 107 void myComputation(libnormaliz::ConeProperty::Enum CP) const; 108 void myComputation(libnormaliz::ConeProperty::Enum CP1, libnormaliz::ConeProperty::Enum CP2) const; 109 void myComputation() const; //default: compute everything possible 110 bool isComputed(libnormaliz::ConeProperty::Enum CP) const; 111 bool isComputed(libnormaliz::ConeProperty::Enum CP1, libnormaliz::ConeProperty::Enum CP2) const; 112 113 private: 114 mutable libnormaliz::Cone<mpz_class> myConeMPZ; // need "mutable" to cater for Normaliz interpretation of "const" (namely, they take it to mean that the repr is const, and not just the object being represented). 115 }; 116 117 118 // implementation of cone 119 cone(libnormaliz::Type::InputType InputType,const std::vector<std::vector<BigInt>> & v)120 cone::cone(libnormaliz::Type::InputType InputType, const std::vector<std::vector<BigInt> >& v) : mySmartPtr(new ConeImpl(InputType, v)) {} 121 cone(const std::map<libnormaliz::InputType,std::vector<std::vector<BigInt>>> & m)122 cone::cone(const std::map< libnormaliz::InputType, std::vector<std::vector<BigInt> > >& m) : mySmartPtr(new ConeImpl(m)) {} 123 cone(libnormaliz::Type::InputType InputType,ConstMatrixView M)124 cone::cone(libnormaliz::Type::InputType InputType, ConstMatrixView M) : mySmartPtr(new ConeImpl(InputType, MatrixToVecVecBigInt(M))) {} 125 cone(const ConeImpl * ptr)126 cone::cone(const ConeImpl* ptr): mySmartPtr(ptr) {} cone(const cone & c)127 cone::cone(const cone& c) : mySmartPtr(c.mySmartPtr) {} ~cone()128 cone::~cone() {} 129 130 131 // printing 132 ostream& operator<< (ostream& out, const cone& C) 133 { 134 if (!out) return out; // short-cut for bad ostreams 135 using namespace libnormaliz; 136 out << "cone(EmbeddingDim = " << EmbeddingDim(C); 137 if (C.isComputed(ConeProperty::ExtremeRays)) { 138 out << ", rank = " << rank(C); 139 out << ", pointed = " << IsPointed(C); 140 } 141 if (C.isComputed(ConeProperty::Generators)) 142 out << ", NumGenerators = " << TriangulationGenerators(C).size(); 143 if (C.isComputed(ConeProperty::SupportHyperplanes)) 144 out << ", NumSupportHyperplanes = " << SupportHyperplanes(C).size(); 145 out << ")"; 146 return out; 147 } 148 149 // letVerbose(Default) sets the verbosity, and returns the old value SetVerbosityLevel(long n)150 void SetVerbosityLevel(long n) { 151 libnormaliz::setVerboseDefault(n!=0); 152 } 153 VerbosityLevel()154 long VerbosityLevel() { 155 const bool b = libnormaliz::setVerboseDefault(0); 156 libnormaliz::setVerboseDefault(b); 157 return b; 158 } 159 SetVerbosityLevel(cone & c,long n)160 void SetVerbosityLevel(cone& c, long n) { 161 c->myConeMPZ.setVerbose(n!=0); 162 } 163 VerbosityLevel(cone & c)164 long VerbosityLevel(cone& c) { 165 const bool b = c->myConeMPZ.setVerbose(0); 166 c->myConeMPZ.setVerbose(b); 167 return b; 168 } 169 170 // computations myComputation(const libnormaliz::ConeProperties & CPs)171 void cone::myComputation(const libnormaliz::ConeProperties& CPs) const { mySmartPtr->myComputation(CPs); } myComputation(libnormaliz::ConeProperty::Enum CP)172 void cone::myComputation(libnormaliz::ConeProperty::Enum CP) const { mySmartPtr->myComputation(CP); } myComputation(libnormaliz::ConeProperty::Enum CP1,libnormaliz::ConeProperty::Enum CP2)173 void cone::myComputation(libnormaliz::ConeProperty::Enum CP1, libnormaliz::ConeProperty::Enum CP2) const { mySmartPtr->myComputation(CP1, CP2); } myComputation()174 void cone::myComputation() const { mySmartPtr->myComputation(); } isComputed(libnormaliz::ConeProperty::Enum CP)175 bool cone::isComputed(libnormaliz::ConeProperty::Enum CP) const { return mySmartPtr->isComputed(CP); } isComputed(libnormaliz::ConeProperty::Enum CP1,libnormaliz::ConeProperty::Enum CP2)176 bool cone::isComputed(libnormaliz::ConeProperty::Enum CP1, libnormaliz::ConeProperty::Enum CP2) const { return mySmartPtr->isComputed(CP1, CP2); } 177 const ConeImpl* cone::operator->() const { return mySmartPtr.operator->(); } 178 179 namespace // conversion functions, implementation at the end of the file 180 { 181 // std::vector<BigInt> LongVToBigIntV(const std::vector<long>& VIn); 182 std::vector<BigInt> MPZ_classVToBigIntV(const std::vector<mpz_class>& VIn); 183 // std::vector<BigRat> LongVToBigRatV(const std::vector<long>& VIn, const BigInt& denom); 184 std::vector<BigRat> MPZ_classVToBigRatV(const std::vector<mpz_class>& VIn, const BigInt& denom); 185 // std::vector<long> BigIntVToLongV(const std::vector<BigInt>& VIn); 186 std::vector<mpz_class> BigIntVToMPZ_classV(const std::vector<BigInt>& VIn); 187 // void ConvertFromNormaliz(std::vector<std::vector<BigInt> >& v, const std::vector<std::vector<long> >& l); 188 void ConvertFromNormaliz(std::vector<std::vector<BigInt> >& v, const std::vector<std::vector<mpz_class> >& l); 189 // std::vector<std::vector<long> > ReturnVecVecLong(const std::vector<std::vector<BigInt> >& v); 190 // map< libnormaliz::InputType, vector<vector<long> > > ReturnMapVecVecLong(const map< libnormaliz::InputType, vector<vector<BigInt> > >& m); 191 std::vector<std::vector<mpz_class> > ReturnVecVecMPZ_class(const std::vector<std::vector<BigInt> >& v); 192 map< libnormaliz::InputType, vector<vector<mpz_class> > > ReturnMapVecVecMPZ_class(const map< libnormaliz::InputType, vector<vector<BigInt> > >& m); 193 std::vector<std::vector<BigInt> > PPVectorToVecVecBigInt(const PPVector& ppv); 194 void VecVecBigIntToPPVector(PPVector& ppv, const std::vector<std::vector<BigInt> >& M); 195 } // end of anonymous namespace 196 197 198 // implementation of ConeImpl ConeImpl(libnormaliz::Type::InputType InputType,const std::vector<std::vector<BigInt>> & v)199 ConeImpl::ConeImpl(libnormaliz::Type::InputType InputType, const std::vector<std::vector<BigInt> >& v): 200 myConeMPZ(InputType, ReturnVecVecMPZ_class(v)) 201 { 202 } 203 ConeImpl(const std::map<libnormaliz::InputType,std::vector<std::vector<BigInt>>> & m)204 ConeImpl::ConeImpl(const std::map< libnormaliz::InputType, std::vector<std::vector<BigInt> > >& m): 205 myConeMPZ(ReturnMapVecVecMPZ_class(m)) 206 { 207 } 208 myComputation(const libnormaliz::ConeProperties & CPs)209 void ConeImpl::myComputation(const libnormaliz::ConeProperties& CPs) const 210 { 211 libnormaliz::ConeProperties missing = myConeMPZ.compute(CPs); 212 if (missing.any()) 213 { 214 std::ostringstream os; 215 os << missing; 216 CoCoA_THROW_ERROR("Normaliz cannot compute "+ os.str(), "myComputation MPZ"); 217 } 218 } 219 myComputation(libnormaliz::ConeProperty::Enum CP)220 void ConeImpl::myComputation(libnormaliz::ConeProperty::Enum CP) const 221 { 222 myComputation(ConeProperties(CP)); 223 } 224 myComputation(libnormaliz::ConeProperty::Enum CP1,libnormaliz::ConeProperty::Enum CP2)225 void ConeImpl::myComputation(libnormaliz::ConeProperty::Enum CP1, 226 libnormaliz::ConeProperty::Enum CP2) const 227 { 228 myComputation(ConeProperties(CP1, CP2)); 229 } 230 myComputation()231 void ConeImpl::myComputation() const 232 { 233 myComputation(ConeProperties(libnormaliz::ConeProperty::DefaultMode)); 234 } 235 isComputed(libnormaliz::ConeProperty::Enum CP)236 bool ConeImpl::isComputed(libnormaliz::ConeProperty::Enum CP) const 237 { 238 return myConeMPZ.isComputed(CP); 239 } 240 isComputed(libnormaliz::ConeProperty::Enum CP1,libnormaliz::ConeProperty::Enum CP2)241 bool ConeImpl::isComputed(libnormaliz::ConeProperty::Enum CP1, 242 libnormaliz::ConeProperty::Enum CP2) const 243 { 244 return isComputed(CP1) && isComputed(CP2); 245 } 246 247 // friend functions which are the interface to the user HilbertBasis(const cone & c)248 std::vector<std::vector<BigInt> > HilbertBasis(const cone& c) 249 { 250 std::vector<std::vector<BigInt> > v; 251 c->myComputation(libnormaliz::ConeProperty::HilbertBasis); 252 ConvertFromNormaliz(v, c->myConeMPZ.getHilbertBasis()); 253 return v; 254 } 255 ModuleGenerators(const cone & c)256 std::vector<std::vector<BigInt> > ModuleGenerators(const cone& c) 257 { 258 std::vector<std::vector<BigInt> > v; 259 c->myComputation(libnormaliz::ConeProperty::ModuleGenerators); 260 ConvertFromNormaliz(v, c->myConeMPZ.getModuleGenerators()); 261 return v; 262 } 263 Deg1Elements(const cone & c)264 std::vector<std::vector<BigInt> > Deg1Elements(const cone& c) 265 { 266 std::vector<std::vector<BigInt> > v; 267 c->myComputation(libnormaliz::ConeProperty::Deg1Elements); 268 ConvertFromNormaliz(v, c->myConeMPZ.getDeg1Elements()); 269 return v; 270 } 271 TriangulationGenerators(const cone & c)272 std::vector<std::vector<BigInt> > TriangulationGenerators(const cone& c) 273 { 274 std::vector<std::vector<BigInt> > v; 275 c->myComputation(libnormaliz::ConeProperty::Generators); 276 ConvertFromNormaliz(v, c->myConeMPZ.getTriangulationGenerators()); 277 return v; 278 } 279 ExtremeRays(const cone & c)280 std::vector<std::vector<BigInt> > ExtremeRays(const cone& c) 281 { 282 std::vector<std::vector<BigInt> > v; 283 c->myComputation(libnormaliz::ConeProperty::ExtremeRays); 284 ConvertFromNormaliz(v, c->myConeMPZ.getExtremeRays()); 285 return v; 286 } 287 VerticesOfPolyhedron(const cone & c)288 std::vector<std::vector<BigInt> > VerticesOfPolyhedron(const cone& c) 289 { 290 std::vector<std::vector<BigInt> > v; 291 c->myComputation(libnormaliz::ConeProperty::VerticesOfPolyhedron); 292 ConvertFromNormaliz(v, c->myConeMPZ.getVerticesOfPolyhedron()); 293 return v; 294 } 295 GeneratorsOfToricRing(const cone & c)296 std::vector<std::vector<BigInt> > GeneratorsOfToricRing(const cone& c) 297 { 298 std::vector<std::vector<BigInt> > v; 299 c->myComputation(libnormaliz::ConeProperty::OriginalMonoidGenerators); 300 ConvertFromNormaliz(v, c->myConeMPZ.getOriginalMonoidGenerators()); 301 return v; 302 } 303 304 305 // The following constraints depend all on ConeProperty::SupportHyperplanes SupportHyperplanes(const cone & c)306 std::vector<std::vector<BigInt> > SupportHyperplanes(const cone& c) 307 { 308 std::vector<std::vector<BigInt> > v; 309 c->myComputation(libnormaliz::ConeProperty::SupportHyperplanes); 310 ConvertFromNormaliz(v, c->myConeMPZ.getSupportHyperplanes()); 311 return v; 312 } 313 Equations(const cone & c)314 std::vector<std::vector<BigInt> > Equations(const cone& c) 315 { 316 std::vector<std::vector<BigInt> > v; 317 c->myComputation(libnormaliz::ConeProperty::Sublattice); 318 ConvertFromNormaliz(v, c->myConeMPZ.getSublattice().getEquations()); 319 return v; 320 } 321 Congruences(const cone & c)322 std::vector<std::vector<BigInt> > Congruences(const cone& c) 323 { 324 std::vector<std::vector<BigInt> > v; 325 c->myComputation(libnormaliz::ConeProperty::Sublattice); 326 ConvertFromNormaliz(v, c->myConeMPZ.getSublattice().getCongruences()); 327 return v; 328 } 329 330 // excluded faces are only available if they were explicitly given ExcludedFaces(const cone & c)331 std::vector<std::vector<BigInt> > ExcludedFaces(const cone& c) 332 { 333 std::vector<std::vector<BigInt> > v; 334 c->myComputation(libnormaliz::ConeProperty::ExcludedFaces); 335 ConvertFromNormaliz(v, c->myConeMPZ.getExcludedFaces()); 336 return v; 337 } 338 HilbertSeries(const cone & c)339 HPSeries HilbertSeries(const cone& c) 340 { 341 c->myComputation(libnormaliz::ConeProperty::HilbertSeries); 342 const libnormaliz::HilbertSeries& HS = c->myConeMPZ.getHilbertSeries(); 343 344 return HPSeries(MPZ_classVToBigIntV(HS.getNum()), 345 libnormaliz::to_vector(HS.getDenom()), HS.getShift()); 346 } 347 HilbertPoly(const cone & c)348 RingElem HilbertPoly(const cone& c) 349 { 350 c->myComputation(libnormaliz::ConeProperty::HilbertSeries); 351 const libnormaliz::HilbertSeries& HS = c->myConeMPZ.getHilbertSeries(); 352 if (HS.getPeriod() != 1) 353 { 354 CoCoA_THROW_ERROR("Hilbert function is a quasi-polynomial of period > 1. This function works for regular polynomials only.", "HilbertPoly"); 355 } 356 const vector<BigRat> coeffs = MPZ_classVToBigRatV( HS.getHilbertQuasiPolynomial()[0], 357 BigIntFromMPZ(HS.getHilbertQuasiPolynomialDenom().get_mpz_t())); 358 PolyRing QQt = RingQQt(1); 359 const RingElem t = indet(QQt,0); 360 RingElem tpower = one(QQt); 361 RingElem hpoly(QQt); 362 for (long i=0; i<len(coeffs); ++i) 363 { 364 hpoly += coeffs[i] * tpower; // NB tpower = t^i 365 tpower *= t; 366 } 367 368 return hpoly; 369 } 370 HilbertQuasiPoly(const cone & c)371 QuasiPoly HilbertQuasiPoly(const cone& c) 372 { 373 c->myComputation(libnormaliz::ConeProperty::HilbertSeries); 374 const libnormaliz::HilbertSeries& HS = c->myConeMPZ.getHilbertSeries(); 375 const long period = HS.getPeriod(); 376 if (period < 1) 377 { 378 CoCoA_THROW_ERROR("Hilbert function not computed.", "HilbertQuasiPoly"); 379 } 380 381 const PolyRing QQt = RingQQt(1); 382 const RingElem t = indet(QQt,0); 383 RingElem tpower; 384 vector<BigRat> coeffs; 385 vector<RingElem> qp = vector<RingElem>(period, RingElem(QQt)); 386 for (long j=0; j<period; ++j) 387 { 388 coeffs = MPZ_classVToBigRatV( HS.getHilbertQuasiPolynomial()[j], 389 BigIntFromMPZ(HS.getHilbertQuasiPolynomialDenom().get_mpz_t())); 390 tpower = one(QQt); 391 for (long i=0; i<len(coeffs); ++i) 392 { 393 qp[j] += coeffs[i] * tpower; // NB tpower = t^i 394 tpower *= t; 395 } 396 } 397 398 return QuasiPoly(qp); 399 } 400 multiplicity(const cone & c)401 BigRat multiplicity(const cone& c) 402 { 403 c->myComputation(libnormaliz::ConeProperty::Multiplicity); 404 return BigRatFromMPQ(c->myConeMPZ.getMultiplicity().get_mpq_t()); 405 } 406 407 408 IsPointed(const cone & c)409 bool IsPointed(const cone& c) 410 { 411 c->myComputation(libnormaliz::ConeProperty::ExtremeRays); 412 return c->myConeMPZ.isPointed(); 413 } 414 IsInhomogeneous(const cone & c)415 bool IsInhomogeneous(const cone& c) 416 { 417 // is always known 418 return c->myConeMPZ.isInhomogeneous(); 419 } 420 IsIntegrallyClosed(const cone & c)421 bool IsIntegrallyClosed(const cone& c) 422 { 423 c->myComputation(libnormaliz::ConeProperty::HilbertBasis); 424 return c->myConeMPZ.isIntegrallyClosed(); 425 } 426 IsDeg1HilbertBasis(const cone & c)427 bool IsDeg1HilbertBasis(const cone& c) 428 { 429 c->myComputation(libnormaliz::ConeProperty::HilbertBasis, libnormaliz::ConeProperty::Grading); 430 return c->myConeMPZ.isDeg1HilbertBasis(); 431 } 432 433 434 435 // dimension and rank invariants EmbeddingDim(const cone & c)436 long EmbeddingDim(const cone& c) 437 { 438 // is always known 439 return c->myConeMPZ.getEmbeddingDim(); 440 } 441 rank(const cone & c)442 long rank(const cone& c) 443 { 444 c->myComputation(libnormaliz::ConeProperty::ExtremeRays); 445 return c->myConeMPZ.getRank(); 446 } 447 grading(const cone & c)448 std::vector<BigRat> grading(const cone& c) 449 { 450 c->myComputation(libnormaliz::ConeProperty::Grading); 451 return MPZ_classVToBigRatV(c->myConeMPZ.getGrading(), BigIntFromMPZ(c->myConeMPZ.getGradingDenom().get_mpz_t())); 452 } 453 454 // only for inhomogeneous case: RecessionRank(const cone & c)455 long RecessionRank(const cone& c) 456 { 457 c->myComputation(libnormaliz::ConeProperty::RecessionRank); 458 return c->myConeMPZ.getRecessionRank(); 459 } 460 AffineDim(const cone & c)461 long AffineDim(const cone& c) 462 { 463 c->myComputation(libnormaliz::ConeProperty::ExtremeRays); 464 return c->myConeMPZ.getRank(); 465 } 466 ModuleRank(const cone & c)467 long ModuleRank(const cone& c) 468 { 469 c->myComputation(libnormaliz::ConeProperty::ModuleRank); 470 return c->myConeMPZ.getModuleRank(); 471 } 472 dehomogenization(const cone & c)473 std::vector<BigInt> dehomogenization(const cone& c) 474 { 475 c->myComputation(libnormaliz::ConeProperty::Dehomogenization); 476 return MPZ_classVToBigIntV(c->myConeMPZ.getDehomogenization()); 477 } 478 479 // not so important in this library 480 // size_t getTriangulationSize() const; 481 // Integer getTriangulationDetSum() const; 482 483 484 /************** applications to monomials **************/ 485 486 namespace // anonymous for file local fns 487 { HilbertBasis_PPVector(libnormaliz::InputType t,const PPVector & ppv)488 PPVector HilbertBasis_PPVector(libnormaliz::InputType t, const PPVector& ppv) 489 { 490 cone c (t, PPVectorToVecVecBigInt(ppv)); 491 std::vector<std::vector<BigInt> > res = HilbertBasis(c); 492 //create an emptyPPVector with the same PPMonoid 493 PPVector ppv_res(PPM(ppv), DMR(ppv)); 494 VecVecBigIntToPPVector(ppv_res,res); 495 return ppv_res; 496 } 497 498 //only for modes where normaliz adds a component, like polytope or rees_algebra HilbertBasis_PPVector(libnormaliz::Type::InputType t,const PPVector & ppv,long sym_pos)499 PPVector HilbertBasis_PPVector(libnormaliz::Type::InputType t, const PPVector& ppv, long sym_pos) 500 { 501 const long dim = NumIndets(PPM(ppv)); 502 if (sym_pos < 0 || sym_pos >= dim) 503 CoCoA_THROW_ERROR("Symbol position not valid", "HilbertBasis_PPVector"); 504 505 vector< vector<BigInt> > vv_input = PPVectorToVecVecBigInt(ppv); 506 if (sym_pos != dim-1) 507 CoCoA_THROW_ERROR("Symbol needs to be the last symbol of the PPMonoid (other implementations are missing)", 508 "HilbertBasis_PPVector (with extra symbol)"); 509 for (long i=0; i < len(vv_input); ++i) 510 { 511 if (vv_input[i][sym_pos] != 0) 512 CoCoA_THROW_ERROR("Symbol must not be used in the power products", "HilbertBasis_PPVector (with extra symbol)"); 513 vv_input[i].erase(vv_input[i].begin()+sym_pos); 514 } 515 if (t != libnormaliz::Type::polytope && t != libnormaliz::Type::rees_algebra) 516 CoCoA_THROW_ERROR("Invalid InputType for this method", "HilbertBasis_PPVector (with extra symbol)"); 517 518 519 cone c (t, vv_input); 520 vector<vector<BigInt> > res = HilbertBasis(c); 521 if (sym_pos != dim-1) 522 { 523 for (long i=0; i < dim; ++i) 524 { 525 swap(res[i][dim],res[i][sym_pos]); 526 } 527 } 528 //create an emptyPPVector with the same PPMonoid 529 PPVector ppv_res(PPM(ppv), DMR(ppv)); 530 VecVecBigIntToPPVector(ppv_res,res); 531 532 return ppv_res; 533 } 534 HilbertBasis_PPVector(libnormaliz::InputType t,const std::vector<std::vector<BigInt>> & Mat,PPMonoid ppm)535 PPVector HilbertBasis_PPVector(libnormaliz::InputType t, const std::vector<std::vector<BigInt> >& Mat, PPMonoid ppm) 536 { 537 cone c (t, Mat); 538 std::vector<std::vector<BigInt> > res = HilbertBasis(c); 539 //create an empty PPVector with the same PPMonoid 540 PPVector ppv_res(ppm,NewDivMaskNull()); 541 VecVecBigIntToPPVector(ppv_res,res); 542 return ppv_res; 543 } 544 HilbertBasis_PPVector(const cone & C,PPMonoid ppm)545 PPVector HilbertBasis_PPVector(const cone& C, PPMonoid ppm) 546 { 547 std::vector<std::vector<BigInt> > res = HilbertBasis(C); 548 //create an empty PPVector with the same PPMonoid 549 PPVector ppv_res(ppm,NewDivMaskNull()); 550 VecVecBigIntToPPVector(ppv_res,res); 551 return ppv_res; 552 } 553 } // end anonymous namespace 554 NormalToricRing(const PPVector & ppv)555 PPVector NormalToricRing(const PPVector& ppv) 556 { 557 return HilbertBasis_PPVector(libnormaliz::Type::normalization, ppv); 558 } 559 IntClosureToricRing(const PPVector & ppv)560 PPVector IntClosureToricRing(const PPVector& ppv) 561 { 562 return HilbertBasis_PPVector(libnormaliz::Type::integral_closure, ppv); 563 } 564 IntClosureMonIdeal(const PPVector & ppv)565 PPVector IntClosureMonIdeal(const PPVector& ppv) 566 { 567 cone c (libnormaliz::Type::rees_algebra, PPVectorToVecVecBigInt(ppv)); 568 // const vector<vector<BigInt> > res = HilbertBasis(c); 569 vector<vector<BigInt> > res1; 570 // for (vector<vector<BigInt> >::const_iterator it=res.begin(); it!=res.end(); ++it) 571 for (const auto& v: HilbertBasis(c)) 572 { 573 //BigInt tmp = it->back(); 574 if (v.back() == 1 ) { 575 res1.push_back(v); 576 res1.back().pop_back(); 577 } 578 } 579 580 //create an empty PPVector with the same PPMonoid 581 PPVector ppv_res1(PPM(ppv), DMR(ppv)); 582 VecVecBigIntToPPVector(ppv_res1,res1); 583 return ppv_res1; 584 } 585 586 /* If you want also the whole normalization of the rees algebra then the 587 * ring must have an unused symbol that we can use for homogenization. 588 * You have to specify its position. 589 */ IntClosureMonIdeal(const PPVector & ppv,long sym_pos)590 PPVector IntClosureMonIdeal(const PPVector& ppv, long sym_pos) 591 { 592 return HilbertBasis_PPVector(libnormaliz::Type::rees_algebra, ppv, sym_pos); 593 } 594 EhrhartRing(const PPVector & ppv,long sym_pos)595 PPVector EhrhartRing(const PPVector& ppv, long sym_pos) 596 { 597 return HilbertBasis_PPVector(libnormaliz::Type::polytope, ppv, sym_pos); 598 } 599 600 /************** torus invariants and valuation rings **************/ TorusInvariants(const vector<vector<BigInt>> & T,const PPMonoid & ppm)601 PPVector TorusInvariants(const vector< vector<BigInt> >& T, const PPMonoid& ppm) 602 { 603 if (T.empty()) 604 { 605 CoCoA_THROW_ERROR("Matrix should be non-empty", "TorusInvariants"); 606 } 607 if (NumIndets(ppm) != len(T[0])) 608 { 609 CoCoA_THROW_ERROR("Number of columns in matrix does not match number of variables in ring", "TorusInvariants"); 610 } 611 return HilbertBasis_PPVector(libnormaliz::Type::equations, T, ppm); 612 } 613 FiniteDiagInvariants(const vector<vector<BigInt>> & Cong,const PPMonoid & ppm)614 PPVector FiniteDiagInvariants(const vector< vector<BigInt> >& Cong, const PPMonoid& ppm) 615 { 616 if (Cong.empty()) 617 { 618 CoCoA_THROW_ERROR("Matrix should be non-empty", "FiniteDiagInvariants"); 619 } 620 if (NumIndets(ppm) != len(Cong[0])-1) 621 { 622 CoCoA_THROW_ERROR("Number of columns in matrix -1 does not match number of variables in ring", "FiniteDiagInvariants"); 623 } 624 return HilbertBasis_PPVector(libnormaliz::Type::congruences, Cong, ppm); 625 } 626 DiagInvariants(const vector<vector<BigInt>> & T,const vector<vector<BigInt>> & Cong,const PPMonoid & ppm)627 PPVector DiagInvariants(const vector< vector<BigInt> >& T, const vector< vector<BigInt> >& Cong, const PPMonoid& ppm) 628 { 629 if (T.empty() && Cong.empty()) 630 { 631 CoCoA_THROW_ERROR("At least one Matrix should be non-empty", "DiagInvariants"); 632 } 633 if (T.empty()) 634 return FiniteDiagInvariants(Cong, ppm); 635 if (Cong.empty()) 636 return TorusInvariants(T, ppm); 637 638 if (NumIndets(ppm) != len(T[0])) 639 { 640 CoCoA_THROW_ERROR("Number of columns in matrix does not match number of variables in ring", "DiagInvariants"); 641 } 642 if (NumIndets(ppm) != len(Cong[0])-1) 643 { 644 CoCoA_THROW_ERROR("Number of columns in matrix -1 does not match number of variables in ring", "DiagInvariants"); 645 } 646 std::map< libnormaliz::InputType, std::vector<std::vector<BigInt> > > cone_input; 647 cone_input[libnormaliz::Type::equations] = T; 648 cone_input[libnormaliz::Type::congruences] = Cong; 649 cone C(cone_input); 650 return HilbertBasis_PPVector(C, ppm); 651 } 652 653 IntersectionValRings(const vector<vector<BigInt>> & V,const PPMonoid & ppm)654 PPVector IntersectionValRings (const vector< vector<BigInt> >& V, const PPMonoid& ppm) 655 { 656 const long dim = len(V[0]); 657 std::map< libnormaliz::InputType, std::vector<std::vector<BigInt> > > cone_input; 658 cone_input[libnormaliz::Type::inequalities] = V; 659 const vector< vector<BigInt> > positive_signs = vector< vector<BigInt> >(1,vector<BigInt>(dim,BigInt(1))); 660 cone_input[libnormaliz::Type::signs] = positive_signs; 661 cone C(cone_input); 662 return HilbertBasis_PPVector(C, ppm); 663 } 664 665 666 /******************************************************** 667 *** conversion functions *** 668 ********************************************************/ 669 670 namespace // conversion functions 671 { 672 673 // Compiler says this is never used 674 // std::vector<BigInt> LongVToBigIntV(const std::vector<long>& VIn) 675 // { 676 // std::vector<BigInt> v; 677 // v.reserve(VIn.size()); 678 // for (vector<long>::const_iterator it=VIn.begin(); it!=VIn.end(); ++it) 679 // v.push_back(BigInt(*it)); 680 // return v; 681 // } 682 MPZ_classVToBigIntV(const std::vector<mpz_class> & VIn)683 std::vector<BigInt> MPZ_classVToBigIntV(const std::vector<mpz_class>& VIn) 684 { 685 std::vector<BigInt> v; v.reserve(VIn.size()); 686 // for (vector<mpz_class>::const_iterator it=VIn.begin(); it!=VIn.end(); ++it) 687 for (const mpz_class& N: VIn) 688 v.push_back(BigIntFromMPZ(N.get_mpz_t())); 689 return v; 690 } 691 692 // Compiler says this is never used 693 // std::vector<BigRat> LongVToBigRatV(const std::vector<long>& VIn, const BigInt& denom) 694 // { 695 // std::vector<BigRat> v; 696 // v.reserve(VIn.size()); 697 // for (vector<long>::const_iterator it=VIn.begin(); it!=VIn.end(); ++it) 698 // v.push_back(BigRat(BigInt(*it),denom)); 699 // return v; 700 // } 701 MPZ_classVToBigRatV(const std::vector<mpz_class> & VIn,const BigInt & denom)702 std::vector<BigRat> MPZ_classVToBigRatV(const std::vector<mpz_class>& VIn, const BigInt& denom) 703 { 704 std::vector<BigRat> v; 705 v.reserve(VIn.size()); 706 // for (vector<mpz_class>::const_iterator it=VIn.begin(); it!=VIn.end(); ++it) 707 for(const mpz_class& N: VIn) 708 v.push_back(BigRat(BigIntFromMPZ(N.get_mpz_t()), denom)); 709 return v; 710 } 711 712 713 // Compiler says this is never used 714 // std::vector<long> BigIntVToLongV(const std::vector<BigInt>& VIn) 715 // { 716 // std::vector<long> v; 717 // long n; 718 // v.reserve(VIn.size()); 719 // for (vector<BigInt>::const_iterator it=VIn.begin(); it!=VIn.end(); ++it) 720 // if (IsConvertible(n, *it)) v.push_back(n); 721 // else CoCoA_THROW_ERROR(ERR::BadConvert, "normaliz: BigIntVToLongV"); 722 // return v; 723 // } 724 725 BigIntVToMPZ_classV(const std::vector<BigInt> & VIn)726 std::vector<mpz_class> BigIntVToMPZ_classV(const std::vector<BigInt>& VIn) 727 { 728 std::vector<mpz_class> v; 729 v.reserve(VIn.size()); 730 // for (vector<BigInt>::const_iterator it=VIn.begin(); it!=VIn.end(); ++it) 731 for (const BigInt& N: VIn) 732 v.push_back(mpz_class(mpzref(N))); 733 return v; 734 } 735 736 737 // Compiler says this is never used 738 // void ConvertFromNormaliz(std::vector<std::vector<BigInt> >& v, const std::vector<std::vector<long> >& l) 739 // { 740 // v.clear(); // not exception safe 741 // v.reserve(l.size()); 742 // // transform(l.begin(), l.end(), v.begin(), LongVToBigIntV); 743 // for (vector<vector<long> >::const_iterator it=l.begin(); it!=l.end(); ++it) 744 // v.push_back(LongVToBigIntV(*it)); 745 // } 746 747 ConvertFromNormaliz(std::vector<std::vector<BigInt>> & v,const std::vector<std::vector<mpz_class>> & L)748 void ConvertFromNormaliz(std::vector<std::vector<BigInt> >& v, const std::vector<std::vector<mpz_class> >& L) 749 { 750 v.clear(); // not exception safe 751 v.reserve(L.size()); 752 // transform(L.begin(), L.end(), v.begin(), LongVToBigIntV); 753 // for (vector<vector<mpz_class> >::const_iterator it=L.begin(); it!=L.end(); ++it) 754 for (const auto& vec: L) 755 v.push_back(MPZ_classVToBigIntV(vec)); 756 } 757 758 759 // Compiler says this is never used 760 // std::vector<std::vector<long> > ReturnVecVecLong(const std::vector<std::vector<BigInt> >& v) 761 // { 762 // std::vector<std::vector<long> > l; 763 // // transform(v.begin(), v.end(), l.begin(), BigIntVToLongV); 764 // try 765 // { 766 // for (vector<vector<BigInt> >::const_iterator it=v.begin(); it!=v.end(); ++it) 767 // l.push_back(BigIntVToLongV(*it)); 768 // } catch (...) {l.clear();} 769 // return l; 770 // } 771 772 773 // Compiler says this is never used 774 // map< libnormaliz::InputType, vector<vector<long> > > ReturnMapVecVecLong(const map< libnormaliz::InputType, vector<vector<BigInt> > >& m) 775 // { 776 // map< libnormaliz::InputType, vector<vector<long> > > ret; 777 // for (map<libnormaliz::InputType, vector<vector<BigInt> > >::const_iterator it=m.begin(); it!=m.end(); ++it) 778 // ret.insert(make_pair((*it).first, ReturnVecVecLong((*it).second))); 779 // return ret; 780 // } 781 782 ReturnVecVecMPZ_class(const std::vector<std::vector<BigInt>> & vlist)783 std::vector<std::vector<mpz_class> > ReturnVecVecMPZ_class(const std::vector<std::vector<BigInt> >& vlist) 784 { 785 std::vector<std::vector<mpz_class> > L; L.reserve(vlist.size()); 786 // transform(v.begin(), v.end(), L.begin(), BigIntVToLongV); 787 // for (vector<vector<BigInt> >::const_iterator it=v.begin(); it!=v.end(); ++it) 788 for (const auto& vec: vlist) 789 L.push_back(BigIntVToMPZ_classV(vec)); 790 return L; 791 } 792 793 ReturnMapVecVecMPZ_class(const map<libnormaliz::InputType,vector<vector<BigInt>>> & mlist)794 map< libnormaliz::InputType, vector<vector<mpz_class> > > ReturnMapVecVecMPZ_class(const map< libnormaliz::InputType, vector<vector<BigInt> > >& mlist) 795 { 796 map< libnormaliz::InputType, vector<vector<mpz_class> > > ret; 797 // for (map<libnormaliz::InputType, vector<vector<BigInt> > >::const_iterator it=m.begin(); it!=m.end(); ++it) 798 for (const auto& m: mlist) 799 ret.insert(make_pair(m.first, ReturnVecVecMPZ_class(m.second))); 800 return ret; 801 } 802 803 PPVectorToVecVecBigInt(const PPVector & ppv)804 std::vector<std::vector<BigInt> > PPVectorToVecVecBigInt(const PPVector& ppv) 805 { 806 vector<BigInt> tmp; 807 const long n = len(ppv); 808 vector<vector<BigInt> > v(n); 809 for (long i=0; i<n; ++i) 810 { 811 BigExponents(tmp,PP(ppv[i])); 812 v[i]=tmp; 813 } 814 return v; 815 } 816 VecVecBigIntToPPVector(PPVector & ppv,const std::vector<std::vector<BigInt>> & M)817 void VecVecBigIntToPPVector(PPVector& ppv, const std::vector<std::vector<BigInt> >& M) 818 { 819 PPMonoid ppm = PPM(ppv); 820 const long n = len(M); 821 for (long i=0; i < n; ++i) 822 { 823 ppv.myPushBack(PPMonoidElem(ppm, M[i])); 824 } 825 } 826 827 } // end of anonymous namespace 828 MatrixToVecVecBigInt(ConstMatrixView M)829 std::vector<std::vector<BigInt> > MatrixToVecVecBigInt(ConstMatrixView M) 830 { 831 const ErrorInfo ErrMesg("Matrix entries must be integer", "MatrixToVecVecBigInt (cone ctor)"); 832 833 vector<vector<BigInt> > v; 834 for (long i=0; i<NumRows(M); ++i) 835 { 836 v.push_back(vector<BigInt>()); 837 for (long j=0; j<NumCols(M); ++j) 838 v[i].push_back(ConvertTo<BigInt>(M(i,j), ErrMesg)); 839 } 840 return v; 841 } 842 MonomialsToPPV(const std::vector<RingElem> & v)843 PPVector MonomialsToPPV(const std::vector<RingElem>& v) 844 { 845 if(!AreMonomials(v)) { 846 CoCoA_THROW_ERROR("Expected list of monomials","MonomialsToPPV"); 847 } 848 if(v.empty()) { 849 CoCoA_THROW_ERROR("List of monomials has to be non-empty","MonomialsToPPV"); 850 } 851 //convert it to a PPVector 852 PPVector ppv(PPM(owner(v[0])), NewDivMaskNull()); 853 convert(ppv,v); 854 return ppv; 855 } 856 857 858 } // namespace Normaliz 859 } // namespace CoCoA 860 861 // RCS header/log in the next few lines 862 // $Header: /Volumes/Home_1/cocoa/cvs-repository/CoCoALib-0.99/src/AlgebraicCore/ExternalLibs-Normaliz.C,v 1.46 2020/10/02 18:46:41 abbott Exp $ 863 // $Log: ExternalLibs-Normaliz.C,v $ 864 // Revision 1.46 2020/10/02 18:46:41 abbott 865 // Summary: Cleaned (actually removed) include directive; renamed Generators to TriangulationGenerators 866 // 867 // Revision 1.45 2020/06/17 15:49:22 abbott 868 // Summary: Changed CoCoA_ERROR into CoCoA_THROW_ERROR 869 // 870 // Revision 1.44 2020/02/18 11:27:04 abbott 871 // Summary: redmine 1346: new for loop syntax 872 // 873 // Revision 1.43 2019/11/14 17:56:07 abbott 874 // Summary: Removed commented out use of clog 875 // 876 // Revision 1.42 2018/05/22 14:16:39 abbott 877 // Summary: Split BigRat into BigRat (class defn + ctors) and BigRatOps 878 // 879 // Revision 1.41 2018/05/18 12:13:36 bigatti 880 // -- renamed IntOperations --> BigIntOps 881 // 882 // Revision 1.40 2018/05/17 15:44:36 bigatti 883 // -- renamed VectorOperations --> VectorOps 884 // 885 // Revision 1.39 2018/04/20 18:51:25 abbott 886 // Summary: Changed ctors for BigInt/BigRat from string or from MPZ/MPQ 887 // 888 // Revision 1.38 2018/04/18 14:36:21 abbott 889 // Summary: Commented out fns reported as unused by compiler 890 // 891 // Revision 1.37 2018/03/15 14:38:56 bigatti 892 // -- new file SparsePolyOps-ideal.H 893 // 894 // Revision 1.36 2018/01/17 10:29:05 abbott 895 // Summary: Several minor changes (e.g. adding const) 896 // 897 // Revision 1.35 2017/04/28 18:20:58 bigatti 898 // ++ verbosity for Normaliz: now as for cocoa, NmzSetVerbosityLevel 899 // 900 // Revision 1.34 2017/03/13 12:30:37 abbott 901 // Summary: Move #ifdef guard to after inclusion of header file (so that defns from PREPROCESSOR_DEFNS.H are visible) 902 // 903 // Revision 1.33 2016/11/11 14:15:32 abbott 904 // Summary: Added short-cut to operator<< when ostream is in bad state 905 // 906 // Revision 1.32 2015/09/10 16:04:48 abbott 907 // Summary: Improved a vague comment 908 // 909 // Revision 1.31 2015/09/03 10:18:41 bigatti 910 // -- changes by Christof Soeger (in Aarhus) 911 // 912 // Revision 1.30 2015/05/20 15:48:05 abbott 913 // Summary: Added commented out line about setting the verbose flag (just not to forget) 914 // Author: JAA 915 // 916 // Revision 1.29 2014/07/31 14:45:17 abbott 917 // Summary: Merged io.H and UtilsTemplate.H into new header VectorOperations.H 918 // Author: JAA 919 // 920 // Revision 1.28 2014/07/14 10:02:56 abbott 921 // Summary: Christof has added some fns which use quasi polys 922 // Author: JAA 923 // 924 // Revision 1.27 2014/07/11 10:12:51 abbott 925 // Summary: Christof added printing for cones 926 // Author: JAA 927 // 928 // Revision 1.26 2014/07/07 12:13:53 abbott 929 // Summary: Christof's updates (& removed AsSparsePolyRing) 930 // Author: JAA 931 // 932 // Revision 1.25 2014/07/01 15:31:21 bigatti 933 // -- fix by Christof Soeger 934 // 935 // Revision 1.24 2014/06/17 10:06:44 abbott 936 // Summary: Removed pointless AsPolyRing 937 // Author: JAA 938 // 939 // Revision 1.23 2014/05/12 14:33:51 bigatti 940 // -- updated from Christof Soeger 941 // 942 // Revision 1.22 2014/05/09 14:56:30 bigatti 943 // -- new fn by Christof Soeger 944 // 945 // Revision 1.21 2014/01/30 09:56:49 bigatti 946 // -- removed DOS newlines 947 // 948 // Revision 1.20 2014/01/29 17:38:35 bigatti 949 // -- added HilbertSeries (by Christof Soeger) 950 // -- added multiplicity (by Christof Soeger) 951 // 952 // Revision 1.19 2014/01/28 09:44:42 abbott 953 // Tidier impl of MatrixToVecVecBigInt using new ConvertTo syntax. 954 // 955 // Revision 1.18 2013/07/12 14:53:32 abbott 956 // Improved indentation. 957 // 958 // Revision 1.17 2013/03/15 17:49:17 abbott 959 // Minor cleaning; removed an out-of-date TODO comment. 960 // 961 // Revision 1.16 2012/10/08 13:52:02 bigatti 962 // -- more cleaning and updates by Christof Soeger 963 // 964 // Revision 1.15 2012/10/05 10:17:04 bigatti 965 // by Christof Soeger 966 // * Made the NewCone functions to constructors of cone. 967 // * Introduced some abbreviation in the method names: 968 // IntegralClosure -> IntClosure 969 // MonomialIdeal -> MonIdeal 970 // Normaliz -> Nmz (the prefix for CoCoA5 functions) 971 // * New function IntClosureMonIdeal 972 // 973 // Revision 1.14 2012/09/28 13:56:36 abbott 974 // Cleaned up code with Christof's help -- now cleaner & more symmetrical. 975 // Also fixed a subtle bug where mySmallConeIsGood was not updated as it should have been. 976 // 977 // Revision 1.13 2012/08/03 16:31:22 bigatti 978 // -- changed: procedural --> functional (by C.Soeger) 979 // 980 // Revision 1.12 2012/07/25 12:46:27 bigatti 981 // -- merged with C.Soeger changes for NormalizComputation (init from map, etc) 982 // 983 // Revision 1.11 2012/07/19 17:12:05 abbott 984 // Added NewCone -- unified pseudo-ctor so user does not have to choose between long and BigInt. 985 // 986 // Revision 1.10 2012/06/19 14:44:41 bigatti 987 // -- changed Ht1 --> Deg1, changed def of HVector (by C.Soeger) 988 // 989 // Revision 1.9 2011/11/07 11:09:32 bigatti 990 // -- new ctors taking ConstRefRingElem 991 // -- added PPVector NormalToricRing(const PPVector& ppv) 992 // -- removed void HilbertBasis(std::vector<std::vector<BigInt> >& v, const cone& c) 993 // 994 // Revision 1.8 2011/10/04 13:03:02 bigatti 995 // -- new logo for gui 996 // 997 // Revision 1.7 2011/09/30 12:55:44 bigatti 998 // -- introduced namespace "Normaliz" and removed Normaliz from function names 999 // -- input of Normaliz functions in CoCoA-5 is now a matrix instead of 1000 // vector<vector<BigInt>> 1001 // 1002 // Revision 1.6 2011/08/14 15:52:17 abbott 1003 // Changed ZZ into BigInt (phase 1: just the library sources). 1004 // 1005 // Revision 1.5 2011/07/20 15:31:21 bigatti 1006 // -- fixed InputType in (undefined) functions 1007 // 1008 // Revision 1.4 2011/07/20 13:49:37 bigatti 1009 // -- added "Normaliz" postfix to Normaliz function calls 1010 // 1011 // Revision 1.3 2011/07/20 12:45:12 bigatti 1012 // -- new normaliz interface (not yet public) 1013 // 1014 // Revision 1.2 2011/02/17 16:50:04 bigatti 1015 // -- getting ready for new official veson on Normaliz: added HVector, removed Triangulation 1016 // 1017 // Revision 1.1 2010/11/05 14:27:18 bigatti 1018 // -- was TmpNormaliz** 1019 // 1020 // Revision 1.6 2010/10/12 11:22:54 bigatti 1021 // -- TmpNormaliz.H simplified: 1022 // now cone is a smart pointer to ConeBase 1023 // and the concrete classes are entirely in the .C file 1024 // -- added Ht1Elements, SupportHyperplanes, Triangulation 1025 // -- added some text in ex-Normaliz1 and 2 1026 // 1027 // Revision 1.5 2010/10/08 13:40:37 bigatti 1028 // -- moved inclusion of libnormaliz.cpp and instantiation of types 1029 // into TmpNormalizTypes.C 1030 // 1031 // Revision 1.4 2010/10/08 10:39:32 bigatti 1032 // -- extended interface for normaliz 1033 // 1034 1035 #endif 1036