@@ -4552,122 +4552,6 @@ export rawZZfactor(e:Expr):Expr := (
45524552 );
45534553setupfun("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:
0 commit comments