Skip to content

Commit

Permalink
gfan 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed Oct 4, 2024
1 parent 48a482b commit f9df6a5
Showing 1 changed file with 322 additions and 27 deletions.
349 changes: 322 additions & 27 deletions Formula/gfan.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
class Gfan < Formula
desc "Grobner fans and tropical varieties"
homepage "https://users-math.au.dk/~jensen/software/gfan/gfan.html"
url "https://users-math.au.dk/~jensen/software/gfan/gfan0.6.2.tar.gz"
sha256 "a674d5e5dc43634397de0d55dd5da3c32bd358d05f72b73a50e62c1a1686f10a"
url "https://users-math.au.dk/~jensen/software/gfan/gfan0.7.tar.gz"
sha256 "ab833757e1e4d4a98662f4aa691394013ea9a226f6416b8f8565356d6fcc989e"
license "GPL-2.0-or-later"
revision 11

bottle do
root_url "https://ghcr.io/v2/macaulay2/tap"
Expand All @@ -25,11 +24,6 @@ class Gfan < Formula
depends_on "cddlib"
depends_on "gmp"

patch do
url "https://raw.githubusercontent.com/Macaulay2/M2/d51564127d757a3132684e9730f4085cb89297bb/M2/libraries/gfan/patch-0.6.2"
sha256 "9ebbf25e6de16baec877050bef69c85504e7bfa81e79407c2ab00ea4433e838c"
end

patch :DATA

def install

Check failure on line 29 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Monterey (12)!

409 | auto F=E.closure(); | ~~~~~~~~~^~ src/gfanlib_hypersurfaceintersection.cpp:1127:22: required from here 1127 | template class gfan::PolytopeIntersectionData<gfan::CircuitTableInt64>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:629:89: error: cannot convert 'gfan::my256s' to 'gfan::MyMakeUnsigned<__int128>::type' {aka '__int128 unsigned'} in initialization 629 | typename MyMakeUnsigned<longword>::type positiveResultBoundTimesD=extMul(negabs(s).v,boundA.v); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:656:54: error: invalid cast from type 'gfan::my256s' to type 'long long int' 656 | aa[i].v=((((word)((/*(uint64_t)*/(extMul(s.v,aa[i].v)))>>denominatorDivisor.shift)))*denominatorDivisor.multiplicativeInverse); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:682:81: error: cannot convert 'gfan::my256s' to '__int128' in initialization 682 | longword/*int64_t*/ temp=(extMul(s.v,aa[i].v))/denominatorDivisor.v; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:169:18: note: explicit conversion function was not considered 169 | explicit operator __int128()const | ^~~~~~~~ src/gfanlib_circuittableint.h: In instantiation of 'static gfan::CircuitTableIntPOD<word, longword> gfan::CircuitTableIntPOD<word, longword>::dotDivVector(gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>, Divisor, int, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>) [with word = long long int; longword = __int128]': src/gfanlib_tableau.h:468:27: required from 'void gfan::Tableau<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 468 | mvtyp::dotDivVector(&combinedMatrix[k][0],&combinedMatrix[i][0],combinedMatrix[i][j],temp,divisorObject,getWidth(),boundK,boundI); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_tableau.h:554:28: required from 'void gfan::GeneratedCone<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 554 | Tableau<mvtyp>::exchange(i,j); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ src/gfanlib_tableau.h:691:6: required from 'gfan::GeneratedCone<mvtyp>::GeneratedCone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 691 | exchange(a,i); | ^~~~~~~~ src/gfanlib_tableau.h:2453:4: required from 'gfan::Cone<mvtyp>::Cone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 2453 | dualCone(M,equations,mr,mr2) |

Check failure on line 29 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Ventura (13)!

409 | auto F=E.closure(); | ~~~~~~~~~^~ src/gfanlib_hypersurfaceintersection.cpp:1127:22: required from here 1127 | template class gfan::PolytopeIntersectionData<gfan::CircuitTableInt64>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:629:89: error: cannot convert 'gfan::my256s' to 'gfan::MyMakeUnsigned<__int128>::type' {aka '__int128 unsigned'} in initialization 629 | typename MyMakeUnsigned<longword>::type positiveResultBoundTimesD=extMul(negabs(s).v,boundA.v); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:656:54: error: invalid cast from type 'gfan::my256s' to type 'long long int' 656 | aa[i].v=((((word)((/*(uint64_t)*/(extMul(s.v,aa[i].v)))>>denominatorDivisor.shift)))*denominatorDivisor.multiplicativeInverse); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:682:81: error: cannot convert 'gfan::my256s' to '__int128' in initialization 682 | longword/*int64_t*/ temp=(extMul(s.v,aa[i].v))/denominatorDivisor.v; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:169:18: note: explicit conversion function was not considered 169 | explicit operator __int128()const | ^~~~~~~~ src/gfanlib_circuittableint.h: In instantiation of 'static gfan::CircuitTableIntPOD<word, longword> gfan::CircuitTableIntPOD<word, longword>::dotDivVector(gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>, Divisor, int, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>) [with word = long long int; longword = __int128]': src/gfanlib_tableau.h:468:27: required from 'void gfan::Tableau<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 468 | mvtyp::dotDivVector(&combinedMatrix[k][0],&combinedMatrix[i][0],combinedMatrix[i][j],temp,divisorObject,getWidth(),boundK,boundI); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_tableau.h:554:28: required from 'void gfan::GeneratedCone<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 554 | Tableau<mvtyp>::exchange(i,j); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ src/gfanlib_tableau.h:691:6: required from 'gfan::GeneratedCone<mvtyp>::GeneratedCone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 691 | exchange(a,i); | ^~~~~~~~ src/gfanlib_tableau.h:2453:4: required from 'gfan::Cone<mvtyp>::Cone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 2453 | dualCone(M,equations,mr,mr2) |

Check failure on line 29 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Sonoma (14) on Apple Silicon!

409 | auto F=E.closure(); | ~~~~~~~~~^~ src/gfanlib_hypersurfaceintersection.cpp:1127:22: required from here 1127 | template class gfan::PolytopeIntersectionData<gfan::CircuitTableInt64>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:629:89: error: cannot convert 'gfan::my256s' to 'gfan::MyMakeUnsigned<__int128>::type' {aka '__int128 unsigned'} in initialization 629 | typename MyMakeUnsigned<longword>::type positiveResultBoundTimesD=extMul(negabs(s).v,boundA.v); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:656:54: error: invalid cast from type 'gfan::my256s' to type 'long long int' 656 | aa[i].v=((((word)((/*(uint64_t)*/(extMul(s.v,aa[i].v)))>>denominatorDivisor.shift)))*denominatorDivisor.multiplicativeInverse); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:682:81: error: cannot convert 'gfan::my256s' to '__int128' in initialization 682 | longword/*int64_t*/ temp=(extMul(s.v,aa[i].v))/denominatorDivisor.v; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:169:18: note: explicit conversion function was not considered 169 | explicit operator __int128()const | ^~~~~~~~ src/gfanlib_circuittableint.h: In instantiation of 'static gfan::CircuitTableIntPOD<word, longword> gfan::CircuitTableIntPOD<word, longword>::dotDivVector(gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>, Divisor, int, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>) [with word = long long int; longword = __int128]': src/gfanlib_tableau.h:468:27: required from 'void gfan::Tableau<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 468 | mvtyp::dotDivVector(&combinedMatrix[k][0],&combinedMatrix[i][0],combinedMatrix[i][j],temp,divisorObject,getWidth(),boundK,boundI); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_tableau.h:554:28: required from 'void gfan::GeneratedCone<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 554 | Tableau<mvtyp>::exchange(i,j); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ src/gfanlib_tableau.h:691:6: required from 'gfan::GeneratedCone<mvtyp>::GeneratedCone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 691 | exchange(a,i); | ^~~~~~~~ src/gfanlib_tableau.h:2453:4: required from 'gfan::Cone<mvtyp>::Cone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 2453 | dualCone(M,equations,mr,mr2) |

Check warning on line 29 in Formula/gfan.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-15)

`brew install --verbose --formula --build-bottle macaulay2/tap/gfan` failed on macOS Sequoia (15) on Apple Silicon!

409 | auto F=E.closure(); | ~~~~~~~~~^~ src/gfanlib_hypersurfaceintersection.cpp:1127:22: required from here 1127 | template class gfan::PolytopeIntersectionData<gfan::CircuitTableInt64>; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:629:89: error: cannot convert 'gfan::my256s' to 'gfan::MyMakeUnsigned<__int128>::type' {aka '__int128 unsigned'} in initialization 629 | typename MyMakeUnsigned<longword>::type positiveResultBoundTimesD=extMul(negabs(s).v,boundA.v); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:656:54: error: invalid cast from type 'gfan::my256s' to type 'long long int' 656 | aa[i].v=((((word)((/*(uint64_t)*/(extMul(s.v,aa[i].v)))>>denominatorDivisor.shift)))*denominatorDivisor.multiplicativeInverse); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_circuittableint.h:682:81: error: cannot convert 'gfan::my256s' to '__int128' in initialization 682 | longword/*int64_t*/ temp=(extMul(s.v,aa[i].v))/denominatorDivisor.v; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | gfan::my256s src/gfanlib_circuittableint.h:169:18: note: explicit conversion function was not considered 169 | explicit operator __int128()const | ^~~~~~~~ src/gfanlib_circuittableint.h: In instantiation of 'static gfan::CircuitTableIntPOD<word, longword> gfan::CircuitTableIntPOD<word, longword>::dotDivVector(gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>*, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>, Divisor, int, gfan::CircuitTableIntPOD<word, longword>, gfan::CircuitTableIntPOD<word, longword>) [with word = long long int; longword = __int128]': src/gfanlib_tableau.h:468:27: required from 'void gfan::Tableau<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 468 | mvtyp::dotDivVector(&combinedMatrix[k][0],&combinedMatrix[i][0],combinedMatrix[i][j],temp,divisorObject,getWidth(),boundK,boundI); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/gfanlib_tableau.h:554:28: required from 'void gfan::GeneratedCone<mvtyp>::exchange(int, int) [with mvtyp = gfan::CircuitTableInt64]' 554 | Tableau<mvtyp>::exchange(i,j); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ src/gfanlib_tableau.h:691:6: required from 'gfan::GeneratedCone<mvtyp>::GeneratedCone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 691 | exchange(a,i); | ^~~~~~~~ src/gfanlib_tableau.h:2453:4: required from 'gfan::Cone<mvtyp>::Cone(const gfan::Matrix<otherTyp>&, const gfan::Matrix<otherTyp>&, MR*, MR*) [with mvtyp = gfan::CircuitTableInt64; MR = std::experimental::fundamentals_v2::pmr::memory_resource]' 2453 | dualCone(M,equations,mr,mr2) |
Expand All @@ -55,31 +49,332 @@ def install

__END__

diff --git a/Makefile-orig b/Makefile
index 737208abfb..52e010e0b3 100644
diff --git a/Makefile b/Makefile
index 67c8164..0c9bbf2 100644
--- a/Makefile
+++ b/Makefile
@@ -110,15 +110,15 @@ MKDIR=mkdir -p
PREFIX =
@@ -117,11 +117,6 @@ PREFIX =
SHELL = /bin/sh
#ARCH = LINUX

-CC = $(PREFIX)gcc
-CLINKER = $(CC)
-CXX = $(PREFIX)g++
-CCLINKER = $(CXX)
+#CC = $(PREFIX)gcc
+#CLINKER = $(CC)
+#CXX = $(PREFIX)g++
+#CCLINKER = $(CXX)
#OPTFLAGS = -O2 -DGMPRATIONAL -DNDEBUG
# Note that gcc produces wrong code with -O3
-OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O2 #-O3 -fno-guess-branch-probability #-DNDEBUG
+#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O2 #-O3 -fno-guess-branch-probability #-DNDEBUG
#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2 -finline-limit=1000 -ffast-math -Wuninitialized # -fno-guess-branch-probability #-DNDEBUG -ftree-vectorizer-verbose=2
-#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O1 -fno-guess-branch-probability
+OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O1 -fno-guess-branch-probability
#-DNDEBUG
#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2 -ftree-vectorizer-verbose=2 -finline-limit=1000 -ffast-math #-DNDEBUG
#OPTFLAGS = -DGMPRATIONAL -Wuninitialized -fno-omit-frame-pointer -O3 -mavx -msse2 -ftree-vectorizer-verbose=2 -march=native -unroll-loops --param max-unroll-times=4 -ffast-math #-DNDEBUG
-
#CC = $(PREFIX)gcc-8.1
#CLINKER = $(CC)
#CXX = $(PREFIX)g++-8.1
@@ -420,9 +415,9 @@ EXECS = $(MAIN)
# (compiling with gcc version 4.7.2 and running gfan _tropicaltraverse on a starting cone for Grassmann3_7)
# Either this is a bug in the code or in the compiler. The bug disappears by compiling with -fno-guess-branch-probability
src/symmetrictraversal.o: src/symmetrictraversal.cpp
- $(CXX) $(CFLAGS) -fno-guess-branch-probability -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
+# $(CXX) $(CFLAGS) -fno-guess-branch-probability -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
# If compiling with clang, use the line below instead:
-# $(CXX) $(CFLAGS) -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o
+ $(CXX) $(CFLAGS) -c src/symmetrictraversal.cpp -o src/symmetrictraversal.o

# Define suffixes to make the program compile on legolas.imf.au.dk :
.SUFFIXES: .o .cpp .c
diff --git a/src/application.cpp b/src/application.cpp
index 77f830b..baf3589 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -567,7 +567,7 @@ void Application::makeSymbolicLinks(const char *name, bool all, const char *path
if(strlen(p->name())>0)
{
char c[1024];
- sprintf(c,"ln -s %s%s %s%s%s\n",path,name,path,name,p->name());
+ sprintf(c,"ln -sf %s%s %s%s%s\n",path,name,path,name,p->name());
fprintf(stderr,"%s",c);
int err=system(c);
assert(err==0);
diff --git a/src/enumeration.cpp b/src/enumeration.cpp
index 44d0a4f..6d3870e 100644
--- a/src/enumeration.cpp
+++ b/src/enumeration.cpp
@@ -14,7 +14,7 @@ EnumerationFilePrinter::EnumerationFilePrinter():

EnumerationFilePrinter::~EnumerationFilePrinter()
{
- assert(file==0);
+ // assert(file==0);
}


diff --git a/src/enumeration.h b/src/enumeration.h
index b0bd187..d91c9ff 100644
--- a/src/enumeration.h
+++ b/src/enumeration.h
@@ -36,7 +36,7 @@ class EnumerationFilePrinter: public EnumerationPrinter
FILE *file;
public:
EnumerationFilePrinter();
- ~EnumerationFilePrinter();
+ virtual ~EnumerationFilePrinter();

void open(std::string filename);
void open(FILE *file);
diff --git a/src/field.h b/src/field.h
index 866be22..7df1600 100644
--- a/src/field.h
+++ b/src/field.h
@@ -208,6 +208,7 @@ class FieldElementImplementation
{
fprintf(stderr,"*this is not in Z/pZ.\n");
assert(0);
+ exit(0);
}
virtual bool isInteger()const
{
@@ -223,6 +224,7 @@ class FieldElementImplementation
Field& operator=(const Field& a)
{
assert(0);
+ exit(1);
}//assignment
};

@@ -271,7 +273,8 @@ class FieldImplementation
virtual FieldElement random()
{
assert(0);
- }
+ exit(1);
+ }
virtual int getCharacteristic()const=0;
virtual const char *name()=0;
virtual std::string toString()const=0;
diff --git a/src/field_rationalfunctions2.cpp b/src/field_rationalfunctions2.cpp
index 4e80c5a..ccc6ae9 100644
--- a/src/field_rationalfunctions2.cpp
+++ b/src/field_rationalfunctions2.cpp
@@ -524,6 +524,7 @@ class FieldElementRationalFunction2 : public FieldElementImplementation

return sign+string("{").append(s,startIndex,slashIndex-startIndex)+string("\\over ").append(s,slashIndex+1,s.length()-slashIndex-1)+string("}");
*/
+ exit(1);
}

std::string toString(bool writeIfOne=true, bool alwaysWriteSign=false, bool latexMode=false /*, bool mathMode=true*/) const
diff --git a/src/field_rationals.cpp b/src/field_rationals.cpp
index 30a92f6..06c95c9 100644
--- a/src/field_rationals.cpp
+++ b/src/field_rationals.cpp
@@ -398,7 +398,7 @@ const char *FieldRationalsImplementation::name()
/*FieldRationals::FieldRationals():
Field(new FieldRationalsImplementation())
{
- /* fprintf(Stderr,"Adding field rationals\n");
+ fprintf(Stderr,"Adding field rationals\n");
next=list;
list=this;
*/
diff --git a/src/gfanlib_circuittableint.h b/src/gfanlib_circuittableint.h
index 2b5ced4..609d2d2 100644
--- a/src/gfanlib_circuittableint.h
+++ b/src/gfanlib_circuittableint.h
@@ -25,6 +25,7 @@ namespace gfan{
template<typename> struct MyMakeUnsigned;
template <> struct MyMakeUnsigned<int>{typedef unsigned int type;};
template <> struct MyMakeUnsigned<long int>{typedef unsigned long int type;};
+ template <> struct MyMakeUnsigned<long long int>{typedef unsigned long long int type;};
template <> struct MyMakeUnsigned<__int128>{typedef unsigned __int128 type;};

class MVMachineIntegerOverflow: public std::exception
@@ -239,6 +240,17 @@ static my256s extMul(__int128_t a, __int128_t b)
return my256s(r);
}

+static my256s extMul(long long int a, long long int b)
+{
+// std::cerr<<"mul"<<toStr(a)<<"*"<<toStr(b)<<"\n";
+ auto temp=unsignedProd128(a,b);
+ my256s r(temp.lo,temp.hi);
+ if(a<0)r=r+my256s(0,-b);
+ if(b<0)r=r+my256s(0,-a);
+// std::cerr<<"result"<<toStr(r)<<"\n";
+ return my256s(r);
+}
+
/*
* The philosophy here is that if this class overflows, then the computation needs to be restarted. Therefore
* all overflows must be caught.
@@ -530,7 +542,7 @@ public:
*/
else
{
- if(0){
+#if 0
std::cerr<<toStr(positiveResultBoundTimesD)<<"\n"<<toStr(denominatorDivisor.v)<<"\n";
std::cerr<<"---\n";
std::cerr<<toStr(negabs(t).v)<<"\n";
@@ -542,7 +554,7 @@ public:
std::cerr<<"---\n";

// std::cerr<<this->)
- }
+#endif
int D=std::numeric_limits<word>::digits;
if(D==0){D=127;}//fixes bug in gcc-8.1
bool doesOverflow=(((word)t.v)==(word{1}<<(D-1)));// What is the purpose of this line. Do we really want to subtract 1? That seems wrong since word is signed. Look at comment below
diff --git a/src/gfanlib_z.h b/src/gfanlib_z.h
index f56597c..5a62076 100644
--- a/src/gfanlib_z.h
+++ b/src/gfanlib_z.h
@@ -8,6 +8,7 @@
#ifndef LIB_Z_H_
#define LIB_Z_H_

+#include <cstdint>
#include <string.h>
#include <ostream>
#include <iostream>
diff --git a/src/gmpallocator.cpp b/src/gmpallocator.cpp
index e308412..07c6b74 100644
--- a/src/gmpallocator.cpp
+++ b/src/gmpallocator.cpp
@@ -29,7 +29,7 @@ static inline int bufNum(int size)
{
ret++;
if(ret>=(NBUCKETSGMP))return -1;
- size>>1;
+ size>>=1;
}
return ret;
}
diff --git a/src/lp.cpp b/src/lp.cpp
index 744e2a9..420b853 100644
--- a/src/lp.cpp
+++ b/src/lp.cpp
@@ -59,6 +59,7 @@ bool LpSolver::hasInteriorPoint(const IntegerVectorList &g, bool strictlyPositiv
{
fprintf(stderr,"hasInteriorPoint method not supported in \"%s\" LP class\n",name());
assert(0);
+ exit(1);
}


@@ -119,6 +120,7 @@ bool LpSolver::hasHomogeneousSolution(int n, const IntegerVectorList &inequaliti
{
fprintf(stderr,"hasHomogeneousSolution method not supported in \"%s\" LP class\n",name());
assert(0);
+ exit(1);
}

static LpSolver *soplex,*soplexCddGmp,*huber,*cdd,*cddgmp,*default_;
diff --git a/src/nbody.cpp b/src/nbody.cpp
index e6d2e6e..3384bb0 100644
--- a/src/nbody.cpp
+++ b/src/nbody.cpp
@@ -17,6 +17,7 @@ static int rIndex(int i, int j, int N, bool withMasses)
r++;
}
assert(0);
+ exit(1);
}

static int sIndex(int i, int j, int N, bool withMasses)
diff --git a/src/packedmonomial.cpp b/src/packedmonomial.cpp
index 65a9242..37404e6 100644
--- a/src/packedmonomial.cpp
+++ b/src/packedmonomial.cpp
@@ -39,6 +39,7 @@ vector<MonomialType> minimized(vector<MonomialType> const &generators)

*g=ret;
*/
+ exit(1);
}


diff --git a/src/parser.cpp b/src/parser.cpp
index 8c09b1a..ed807f8 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -638,6 +638,7 @@ Field CharacterBasedParser::parseField()

parserError("field",c);
assert(0);
+ exit(1);
}


diff --git a/src/polyhedralfan.cpp b/src/polyhedralfan.cpp
index e62cae4..90eae40 100644
--- a/src/polyhedralfan.cpp
+++ b/src/polyhedralfan.cpp
@@ -1672,6 +1672,7 @@ PolyhedralCone PolyhedralFan::coneContaining(IntegerVector const &v)const
if(i->contains(v))return i->faceContaining(v);
debug<<"Vector "<<v<<" not contained in support of fan\n";
assert(0);
+ exit(1);
}


diff --git a/src/polymakefile.cpp b/src/polymakefile.cpp
index a7ea692..55d3d39 100644
--- a/src/polymakefile.cpp
+++ b/src/polymakefile.cpp
@@ -329,6 +329,7 @@ void PolymakeFile::writeMatrixProperty(const char *p, const IntegerMatrix &m, bo
IntegerMatrix PolymakeFile::readArrayArrayIntProperty(const char *p, int width)
{
assert(0);//Not implemented yet.
+ exit(1);
}


@@ -371,7 +372,7 @@ static list<int> readIntList(istream &s)
{
list<int> ret;
int c=s.peek();
- while((c>='0') && (c<='9')|| (c==' '))
+ while(((c>='0') && (c<='9'))|| (c==' '))
{
// fprintf(Stderr,"?\n");
int r;
diff --git a/src/polynomialgcd.cpp b/src/polynomialgcd.cpp
index 82aea06..14cb528 100644
--- a/src/polynomialgcd.cpp
+++ b/src/polynomialgcd.cpp
@@ -618,7 +618,7 @@ Polynomial NonMonomialPolynomialGCDForZ(PolynomialSet p)
if(1) {
static int i;
i++;
- if((i==1000))
+ if(i==1000)
{
// debug<<simplifyPolysViaHomogeneitySpace(p);
// debug<<"NonMon on:"<<p.getRing()<<p<<"\n";
diff --git a/src/timer.cpp b/src/timer.cpp
index 7421c41..b5d8741 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -1,10 +1,10 @@
#include "timer.h"
-#include "log.h"
-
#include "iostream"
#include <time.h>
#include <assert.h>

+#include "log.h" // include last, because it defines a macro "log2" also defined as a function in math.h
+
using namespace std;

Timer* Timer::timers;
diff --git a/src/vektor.cpp b/src/vektor.cpp
index d17579a..63e39f0 100644
--- a/src/vektor.cpp
+++ b/src/vektor.cpp
@@ -96,7 +96,7 @@ int gcdGFAN(int r, int s)
int gcdOfVector(IntegerVector const &v)
{
int ret=0;
- for(int i=0;i<v.size();i++)if(ret=v[i])break;
+ for(int i=0;i<v.size();i++)if((ret=v[i]))break;
if(ret<0)ret=-ret;
assert(ret!=0);
for(int i=0;i<v.size();i++)ret=gcdGFAN(ret,v[i]);
--
2.31.1
2.46.0

0 comments on commit f9df6a5

Please sign in to comment.