Skip to content

Commit

Permalink
renamed and moved IM2_kernel_of_GB -> rawKernelOfGB
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud authored and mikestillman committed Mar 13, 2023
1 parent 59e56c5 commit 3f00e40
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 27 deletions.
2 changes: 1 addition & 1 deletion M2/Macaulay2/d/interface.dd
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
13 changes: 13 additions & 0 deletions M2/Macaulay2/e/interface/groebner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <limits>
#include <sstream>

#include "Eschreyer.hpp"
#include "hilb.hpp"
#include "comp-gb.hpp"
#include "comp-res.hpp"
Expand Down Expand Up @@ -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
/////////////
Expand Down
5 changes: 5 additions & 0 deletions M2/Macaulay2/e/interface/groebner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ///////
///////////////////////////////////////////////////////////////////////////////
Expand Down
14 changes: 0 additions & 14 deletions M2/Macaulay2/e/interface/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions M2/Macaulay2/e/interface/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f00e40

Please sign in to comment.