diff --git a/M2/Macaulay2/d/interface.dd b/M2/Macaulay2/d/interface.dd index 43303585c1b..2fc972a4c1a 100644 --- a/M2/Macaulay2/d/interface.dd +++ b/M2/Macaulay2/d/interface.dd @@ -2997,7 +2997,7 @@ setupfun("rawReduceByPivots",rawReduceByPivots); export rawKernelOfGB(e:Expr):Expr := ( when e is m:RawMatrixCell - do toExpr(Ccode(RawMatrixOrNull, "IM2_kernel_of_GB(", m.p, ")" )) + do toExpr(Ccode(RawMatrixOrNull, "rawKernelOfGB(", m.p, ")" )) else WrongArgMatrix()); setupfun("rawKernelOfGB",rawKernelOfGB); diff --git a/M2/Macaulay2/e/interface/groebner.cpp b/M2/Macaulay2/e/interface/groebner.cpp index 9dbf95e776c..95b232e28e2 100644 --- a/M2/Macaulay2/e/interface/groebner.cpp +++ b/M2/Macaulay2/e/interface/groebner.cpp @@ -6,6 +6,7 @@ #include #include +#include "Eschreyer.hpp" #include "hilb.hpp" #include "comp-gb.hpp" #include "comp-res.hpp" @@ -70,6 +71,18 @@ const RingElement /* or null */ *IM2_Matrix_Hilbert(const Matrix *M) } } +const Matrix *rawKernelOfGB(const Matrix *M) +/* Assuming that the columns of G form a GB, this routine computes + a Groebner basis of the kernel of these elements, using an + appropriate Schreyer order on the source of G. */ +{ + GBMatrix *N = new GBMatrix(M); + GBKernelComputation G(N); + G.calc(); + GBMatrix *syz = G.get_syzygies(); + return syz->to_matrix(); +} + /////////////////////////////////////////////////////////////////////////////////// ///////// The following will be removed once the new code is functional ///////////// diff --git a/M2/Macaulay2/e/interface/groebner.h b/M2/Macaulay2/e/interface/groebner.h index 7c1e12cda13..61c76673586 100644 --- a/M2/Macaulay2/e/interface/groebner.h +++ b/M2/Macaulay2/e/interface/groebner.h @@ -52,6 +52,11 @@ const RingElement /* or null */ *IM2_Matrix_Hilbert(const Matrix *M); NULL is returned if the ring is not appropriate for computing Hilbert series, or the computation was interrupted. */ +const Matrix *rawKernelOfGB(const Matrix *M); +/* Assuming that the columns of M form a GB, this routine computes + a Groebner basis of the kernel of these elements, using an + appropriate Schreyer order on the source of M. */ + /////////////////////////////////////////////////////////////////////////////// /////// The following will be removed once the new code is functional /////// /////////////////////////////////////////////////////////////////////////////// diff --git a/M2/Macaulay2/e/interface/matrix.cpp b/M2/Macaulay2/e/interface/matrix.cpp index 9b95952f248..64288b6cb6c 100644 --- a/M2/Macaulay2/e/interface/matrix.cpp +++ b/M2/Macaulay2/e/interface/matrix.cpp @@ -616,20 +616,6 @@ engine_RawMatrixAndInt IM2_Matrix_divide_by_var(const Matrix *M, } const Matrix *rawMatrixCompress(const Matrix *M) { return M->compress(); } -#include "Eschreyer.hpp" - -const Matrix *IM2_kernel_of_GB(const Matrix *m) -/* Assuming that the columns of G form a GB, this computes - a Groebner basis of the kernel of these elements, using an appropriate - Schreyer order on the - source of G. */ -{ - GBMatrix *n = new GBMatrix(m); - GBKernelComputation G(n); - G.calc(); - GBMatrix *syz = G.get_syzygies(); - return syz->to_matrix(); -} const Matrix *rawRemoveMonomialFactors(const Matrix *m, M2_bool make_squarefree_only) diff --git a/M2/Macaulay2/e/interface/matrix.h b/M2/Macaulay2/e/interface/matrix.h index 2c844963a5c..54c97668912 100644 --- a/M2/Macaulay2/e/interface/matrix.h +++ b/M2/Macaulay2/e/interface/matrix.h @@ -418,18 +418,6 @@ const Matrix /* or null */ *rawBasis( int IM2_Matrix_dimension(const Matrix *M); /* TODO */ -const RingElement /* or null */ *IM2_Matrix_Hilbert( - const Matrix *M); /* drg: connected rawHilbert*/ -/* This routine computes the numerator of the Hilbert series - for coker leadterms(M), using the degrees of the rows of M. - NULL is returned if the ring is not appropriate for - computing Hilbert series, or the computation was interrupted. */ - -const Matrix *IM2_kernel_of_GB(const Matrix *G); /* connected rawKernelOfGB */ -/* Assuming that the columns of G form a GB, this computes - a Groebner basis of the kernel of these elements, using an appropriate - Schreyer order on the source of G. */ - # if defined(__cplusplus) } # endif