Skip to content

MonomialOrder refactor + monoids with torsion #3924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 22 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4965f72
removed one non-thread-safe function, many to go!
Sep 4, 2024
f9247d8
REMOVE ME: enabled testing on GitHub Actions
mahrud Feb 11, 2021
64c1f21
TODO: degree of elements of rings with torsion in degree group
mahrud Aug 20, 2022
fdd4776
TODO: fixed degreesMonoid and degreesRing of a monoid with torsion de…
mahrud Aug 20, 2022
8750695
wip: subquotient modules as degree groups
mahrud Nov 21, 2022
8a9250c
refactored top-level monomial ordering code
mahrud Sep 21, 2022
3c26b43
added call to reduceDegree to degree and Ring^List
mahrud Nov 25, 2023
5f15f5f
TODO: small fixes to degree types in engine
mahrud Oct 2, 2023
1cfd6b3
TODO: remove duplicate interface functions
mahrud Jan 10, 2023
2f889b4
change monordering.hpp -> MonomialOrder.hpp in unit-tests/NCGroebnerT…
mahrud Jan 10, 2023
2dcb78f
(MIKE) wip: reorganized monomial order engine code
mikestillman Sep 22, 2022
93fe7af
(MIKE) wip: starting to move all functions using MO_* to MonomialOrder
mikestillman Sep 23, 2022
8d81869
(MIKE) reorganized monomial order code, part1, and started writing a …
mikestillman Oct 8, 2022
1f510b1
(MIKE) refactor to separate MonomialOrder and MonomialEncoder
mikestillman Oct 10, 2022
c05c121
(MIKE) added more MonomialOrder interface routines
mikestillman Oct 19, 2022
8c54f5f
TODO: remove Ring::initialize_ring, use constructors
mahrud Jan 10, 2023
aefaada
TODO: remove interpreter types from the engine
mahrud Jan 10, 2023
7bd136a
TODO: reconciled memory allocation for exponents
mahrud Jan 2, 2023
b4fec80
TODO: select_by_degrees with arbitrary cone boxes
mahrud Jan 5, 2023
fa859a1
include iostream for factory_streamio test
mahrud Jun 22, 2023
7f88679
wip
mahrud Sep 4, 2023
399790c
wip
mahrud Jul 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,21 @@ name: Build and Test Macaulay2

on:
workflow_dispatch:
pull_request:
push:
branches:
- stable
- Dmodules
- Truncations
- Varieties
- development
schedule:
- cron: '0 6 * * SUN' # runs tests on the main branch every Sunday at 06:00 UTC
- feature/functors
- feature/monoids
- feature/torsion
- feature/varieties
- refactor/Core
- refactor/engine
- refactor/monoids
- research

concurrency:
# Cancel in-progress runs when a new workflow with the same group name is triggered
Expand All @@ -28,7 +37,6 @@ defaults:

jobs:
build:
if: github.repository == 'Macaulay2/M2' || contains(github.ref, 'global')
name: ${{ matrix.build-system }}-${{ matrix.os }}-${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down
2 changes: 1 addition & 1 deletion M2/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: Inner
NamespaceIndentation: All
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
Expand Down
4 changes: 4 additions & 0 deletions M2/Macaulay2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ add_subdirectory(m2) # rename to Core?
add_subdirectory(packages)
add_subdirectory(editors)

# uncomment when developing
#set_target_properties(M2-engine PROPERTIES C_INCLUDE_WHAT_YOU_USE "${IWYU};--transitive_includes_only")
#set_target_properties(M2-engine PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${IWYU};--transitive_includes_only")

if(BUILD_TESTING)
add_subdirectory(tests)
endif()
Expand Down
2 changes: 0 additions & 2 deletions M2/Macaulay2/d/Makefile.files.in
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ interface.o : \
@srcdir@/../e/buffer.hpp \
@srcdir@/../e/mem.hpp \
@srcdir@/../e/../system/mutex.h \
@srcdir@/../e/imonorder.hpp \
@srcdir@/../e/aring.hpp \
@srcdir@/../e/exceptions.hpp \
@srcdir@/../e/ZZ.hpp \
Expand Down Expand Up @@ -246,7 +245,6 @@ engine.o : \
@srcdir@/../e/ZZ.hpp \
@srcdir@/../e/matrix.hpp \
@srcdir@/../e/monoid.hpp \
@srcdir@/../e/imonorder.hpp \
@srcdir@/../e/interface/monomial-ordering.h \
@srcdir@/../e/freemod.hpp \
@srcdir@/../e/schorder.hpp \
Expand Down
13 changes: 7 additions & 6 deletions M2/Macaulay2/d/interface.dd
Original file line number Diff line number Diff line change
Expand Up @@ -957,12 +957,13 @@ export rawInverse(e:Expr):Expr := (
setupfun("rawInverse",rawInverse);

export rawMultiDegree(e:Expr):Expr := (
when e
is x:RawRingElementCell do toExpr( Ccode(RawArrayIntOrNull, "IM2_RingElement_multidegree(", x.p, ")" ) )
is x:RawFreeModuleCell do toExpr( Ccode(RawArrayIntOrNull, "IM2_FreeModule_get_degrees(", x.p, ")" ) )
is x:RawMatrixCell do toExpr( Ccode(RawArrayIntOrNull, "IM2_Matrix_get_degree(", x.p, ")" ) )
else WrongArg("a raw ring element, matrix, or free module"));
setupfun("rawMultiDegree",rawMultiDegree);
when e
-- TODO: unify these function names
is x:RawRingElementCell do toExpr( Ccode(RawArrayIntOrNull, "IM2_RingElement_multidegree(", x.p, ")" ) )
is x:RawFreeModuleCell do toExpr( Ccode(RawArrayIntOrNull, "IM2_FreeModule_get_degrees(", x.p, ")" ) )
is x:RawMatrixCell do toExpr( Ccode(RawArrayIntOrNull, "IM2_Matrix_get_degree(", x.p, ")" ) )
else WrongArg("a raw ring element, matrix, or free module"));
setupfun("rawMultiDegree", rawMultiDegree);

export rawDiscreteLog(e:Expr):Expr := (
when e
Expand Down
5 changes: 4 additions & 1 deletion M2/Macaulay2/e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ set(CPPONLYFILES
# these files all have .hpp and .cpp files
# MES TODO: put these NCAlgebra files (and friends) into alpha order in list
set(SRCLIST
MonomialOrder
MonomialOrderOld
BasicPoly
BasicPolyList
BasicPolyListParser
Expand Down Expand Up @@ -231,7 +233,6 @@ set(SRCLIST
gbweight
hermite
hilb
imonorder
int-bag
interreduce
interrupted
Expand Down Expand Up @@ -463,6 +464,8 @@ if(BUILD_TESTING)
unit-tests/basics-test.cpp

unit-tests/MatrixIOTest.cpp
unit-tests/MonomialOrderTest.cpp

unit-tests/fromStream.cpp
unit-tests/testMain.cpp # not needed, except for GC_INIT
)
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/e/ExponentList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class ExponentList
static void mult(ConstExponents a, ConstExponents b, Vector& result);
// compute the quotient a:b
static void quotient(ConstExponents a, ConstExponents b, Vector& result);
static void quotient(ConstExponents a, ConstExponents b, Exponents result);
static void power(ConstExponents a, Exponent n, Vector& result);

static void monsyz(ConstExponents a,
Expand Down
3 changes: 2 additions & 1 deletion M2/Macaulay2/e/Makefile.files
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ INTERFACE2 = interrupted
# NCAlgebras/SuffixTree \

INTERFACE = \
MonomialOrder \
MonomialOrderOld \
myalloc \
BasicPoly \
BasicPolyList \
Expand Down Expand Up @@ -104,7 +106,6 @@ INTERFACE = \
SLP \
overflow \
memory-status \
imonorder \
sagbi \
monideal-minprimes \
lapack \
Expand Down
Loading