Skip to content

Commit 9113a8b

Browse files
committed
Revert "Add some normaliz, some cytools (lattice points, via Nate MacFadden's box_enum.h, and Andres Rios-Tascon's computeGV), and one call to GLPK for determining if a cone is full dimensional."
This reverts commit f9219f8.
1 parent 7d72938 commit 9113a8b

23 files changed

Lines changed: 12 additions & 4788 deletions

M2/Macaulay2/d/interface.dd

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -4552,122 +4552,6 @@ export rawZZfactor(e:Expr):Expr := (
45524552
);
45534553
setupfun("rawZZfactor",rawZZfactor);
45544554

4555-
export rawGVInvariants(e:Expr):Expr := (
4556-
when e is s:Sequence do (
4557-
if length(s) == 7 then (
4558-
if isSequenceOfSmallIntegers(s.0) then (curves := getSequenceOfSmallIntegers(s.0);
4559-
if isSequenceOfSmallIntegers(s.1) then (lightcone := getSequenceOfSmallIntegers(s.1);
4560-
if isSequenceOfSmallIntegers(s.2) then (grading := getSequenceOfSmallIntegers(s.2);
4561-
if isSequenceOfSmallIntegers(s.3) then (Q := getSequenceOfSmallIntegers(s.3);
4562-
if isSequenceOfSmallIntegers(s.4) then (nefPartition := getSequenceOfSmallIntegers(s.4);
4563-
if isSequenceOfSmallIntegers(s.5) then (intnums := getSequenceOfSmallIntegers(s.5);
4564-
if isSequenceOfSmallIntegers(s.6) then (settings := getSequenceOfSmallIntegers(s.6);
4565-
toExpr(Ccode(RawMutableMatrixOrNull,
4566-
"rawGVInvariants(",
4567-
curves, ",", lightcone, ",", grading, ",", Q, ",", nefPartition, ",", intnums, ",", settings,
4568-
")"
4569-
))
4570-
) else WrongArg(6, "a sequence of small integers")
4571-
) else WrongArg(5, "a sequence of small integers")
4572-
) else WrongArg(4, "a sequence of small integers")
4573-
) else WrongArg(3, "a sequence of small integers")
4574-
) else WrongArg(2, "a sequence of small integers")
4575-
) else WrongArg(1, "a sequence of small integers")
4576-
) else WrongArg(0, "a sequence of small integers")
4577-
) else WrongNumArgs(7)
4578-
) else WrongNumArgs(7)
4579-
);
4580-
setupfun("rawGVInvariants",rawGVInvariants);
4581-
4582-
-- Compute lattice points in a polyhedron, up to given bound.
4583-
-- rawLatticePoints(A, b, B, N1, N2)
4584-
-- A: RawMatrix over ZZ, m rows x d columns
4585-
-- b: RawMatrix over ZZ, m rows x 1 column.
4586-
-- the i-th constraint is (row i of A).(x1...xd) <= b_(i,0)
4587-
-- B: bound: only find lattice points whose coordinates xi satisfy -B <= xi <= B.
4588-
-- N1: maximum number of points to be found
4589-
-- N2: maximum number of nodes to visit in the underlying search tree.
4590-
-- returns: a MutableMatrix with d = #cols(A) rows, one column per lattice
4591-
-- point satisfying the constraints above.
4592-
-- TODO:
4593-
-- - A and result should have the same type (both MutableMatrix)?
4594-
export rawLatticePoints(e:Expr):Expr := (
4595-
when e is s:Sequence do (
4596-
if length(s) == 5 then (
4597-
when s.0 is wa:RawMatrixCell do (a := wa.p;
4598-
when s.1 is wb:RawMatrixCell do (b := wb.p;
4599-
when s.2 is wc:ZZcell do (
4600-
if isInt(wc) then (c := toInt(wc);
4601-
when s.3 is wd:ZZcell do (
4602-
if isLong(wd) then (d := toLong(wd);
4603-
when s.4 is wf:ZZcell do (
4604-
if isLong(wf) then (f := toLong(wf);
4605-
toExpr(Ccode(RawMutableMatrixOrNull,
4606-
"rawLatticePoints(",
4607-
a, ",", b, ",", c, ",", d, ",", f,
4608-
")"
4609-
))
4610-
) else WrongArgSmallInteger(4)
4611-
) else WrongArgZZ(4)
4612-
) else WrongArgSmallInteger(3)
4613-
) else WrongArgZZ(3)
4614-
) else WrongArgSmallInteger(2)
4615-
) else WrongArgZZ(2)
4616-
) else WrongArg(1, "a raw matrix")
4617-
) else WrongArg(0, "a raw matrix")
4618-
) else WrongNumArgs(5)
4619-
) else WrongNumArgs(5)
4620-
);
4621-
setupfun("rawLatticePoints",rawLatticePoints);
4622-
4623-
-- Compute ALL lattice points in a (bounded) polyhedron, via libnormaliz.
4624-
-- rawLatticePointsNormaliz(A, b)
4625-
-- A: RawMatrix over ZZ, m rows x d columns
4626-
-- b: RawMatrix over ZZ, m rows x 1 column.
4627-
-- the i-th constraint is (row i of A).(x1...xd) <= b_(i,0)
4628-
-- returns: a MutableMatrix with d = #cols(A) rows, one column per lattice
4629-
-- point satisfying the constraints above. The polyhedron must be bounded;
4630-
-- otherwise an engine error is reported. Big-integer entries in A and b
4631-
-- are supported.
4632-
export rawLatticePointsNormaliz(e:Expr):Expr := (
4633-
when e is s:Sequence do (
4634-
if length(s) == 2 then (
4635-
when s.0 is wa:RawMatrixCell do (a := wa.p;
4636-
when s.1 is wb:RawMatrixCell do (b := wb.p;
4637-
toExpr(Ccode(RawMutableMatrixOrNull,
4638-
"rawLatticePointsNormaliz(",
4639-
a, ",", b,
4640-
")"
4641-
))
4642-
) else WrongArg(1, "a raw matrix")
4643-
) else WrongArg(0, "a raw matrix")
4644-
) else WrongNumArgs(2)
4645-
) else WrongNumArgs(2)
4646-
);
4647-
setupfun("rawLatticePointsNormaliz",rawLatticePointsNormaliz);
4648-
4649-
-- rawConeInteriorPoint(A): test whether the cone {x : A*x <= 0} is
4650-
-- full-dimensional, returning either a witness interior point or a
4651-
-- dual certificate of degeneracy.
4652-
-- A: RawMatrix over ZZ with m rows (inequalities) and n columns
4653-
-- (ambient dimension); entries must fit in a C int.
4654-
-- Returns: a 1-row MutableMatrix over RR_53.
4655-
-- if full-dimensional: 2 + n columns, [1.0, tStar, x_1, ..., x_n]
4656-
-- where tStar > 0 and A*x <= 0 strictly (componentwise).
4657-
-- else : 2 + m columns, [0.0, tStar, y_1, ..., y_m]
4658-
-- where tStar == 0 and y >= 0, y^T A = 0
4659-
-- (a Farkas certificate of non-full-dimensionality).
4660-
export rawConeInteriorPoint(e:Expr):Expr := (
4661-
when e is wC:RawMatrixCell do (C := wC.p;
4662-
toExpr(Ccode(RawMutableMatrixOrNull,
4663-
"rawConeInteriorPoint(",
4664-
C,
4665-
")"
4666-
))
4667-
) else WrongArg("a raw matrix")
4668-
);
4669-
setupfun("rawConeInteriorPoint",rawConeInteriorPoint);
4670-
46714555
-- Local Variables:
46724556
-- compile-command: "echo \"make: Entering directory \\`$M2BUILDDIR/Macaulay2/d'\" && make -C $M2BUILDDIR/Macaulay2/d interface.o "
46734557
-- End:

M2/Macaulay2/e/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ set(CFILES
3939
error.c
4040
exptable.c
4141
table.c
42-
cytools/box_enum.c
4342
)
4443
# h files
4544
set(HFILES
@@ -160,10 +159,6 @@ set(CPPONLYFILES
160159
# these files all have .hpp and .cpp files
161160
# MES TODO: put these NCAlgebra files (and friends) into alpha order in list
162161
set(SRCLIST
163-
cytools/computeGV
164-
cytools/lattice_points
165-
cytools/lattice-points-normaliz
166-
cytools/cone-interior-point
167162
BasicPoly
168163
BasicPolyList
169164
BasicPolyListParser
@@ -487,7 +482,6 @@ if(BUILD_TESTING)
487482

488483
unit-tests/MatrixIOTest.cpp
489484
unit-tests/fromStream.cpp
490-
unit-tests/LatticePointsTest.cpp
491485
unit-tests/testMain.cpp # not needed, except for GC_INIT
492486
)
493487

M2/Macaulay2/e/Makefile.common.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ COMPILE.cpp = $(COMPILE.cc)
7171
%.dep: %.c
7272
# $(WHY)
7373
$(SHOW)"MKDEP $*.c"
74-
$(HIDE)$(MKDIR_P) `dirname "$@"`
7574
$(HIDE)@CC@ -MT $@ -MT $*.o -MM -MP $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(MORE_OPTIONS) $< >$*.dep
7675

7776
@pre_librariesdir@/libengine.so: $(LOFILES)

M2/Macaulay2/e/Makefile.files.in

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ INTERFACE2 = interrupted
1010
1111
INTERFACE = \
1212
myalloc \
13-
cytools/computeGV \
14-
cytools/lattice_points \
15-
cytools/lattice-points-normaliz \
16-
cytools/cone-interior-point \
1713
BasicPoly \
1814
BasicPolyList \
1915
BasicPolyListParser \
@@ -228,7 +224,7 @@ NAMES_H = \
228224
f4/varpower-monomial \
229225
res-a0-pair
230226

231-
C_FILES = error table exptable complex cytools/box_enum # interface/m2-types interface/m2-mem
227+
C_FILES = error table exptable complex # interface/m2-types interface/m2-mem
232228

233229
D_FILES =
234230
DD_FILES = #test

M2/Macaulay2/e/cytools/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

M2/Macaulay2/e/cytools/box_enum.c

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)