Skip to content

Commit

Permalink
Merge pull request #30 from mahrud/Msolve
Browse files Browse the repository at this point in the history
  • Loading branch information
antonleykin authored Aug 1, 2024
2 parents dcaafc4 + 5676d5c commit 2a4bac5
Show file tree
Hide file tree
Showing 9 changed files with 358 additions and 264 deletions.
11 changes: 7 additions & 4 deletions M2/Macaulay2/e/unit-tests/MatrixIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ TEST(MatrixIO, readPolynomialErrors)
TEST(MatrixIO, readMsolve)
{
std::string filename { EXAMPLE_DIR"eg2-gb.ms" };
std::string contents = R"(#Reduced Groebner basis for input in characteristic 1235952427
#for variable order x, y, z
#w.r.t. grevlex monomial ordering
#consisting of 4 elements:
std::string contents = R"(#Reduced Groebner basis data
#---
#field characteristic: 1235952427
#variable order: x, y, z
#monomial order: graded reverse lexicographical
#length of basis: 4 elements sorted by increasing leading monomials
#---
[1*x^1+2*y^1+2*z^1+1235952426,
1*y^1*z^1+494380972*z^2+370785728*y^1+247190485*z^1,
1*y^2+988761941*z^2+741571456*y^1+494380971*z^1,
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/m2/exports.m2
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ export {
"Test",
"TestInput",
"Thing",
"Threads",
"Time",
"Tor",
"Toric",
Expand Down
3 changes: 2 additions & 1 deletion M2/Macaulay2/m2/monoids.m2
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,13 @@ monoidSymbol = (M, x) -> ( b := try baseName x;
and M.indexStrings#?x then M.indexSymbols#x else
error("expected an index, symbol, or name of variable of the ring or monoid: ", toString x))

-- also used in Elimination
-- also used in Elimination and Msolve
monoidIndices = (M, v) -> apply(v, monoidIndex_M)
monoidIndex = (M, x) -> ( b := try baseName x;
if instance(x, ZZ) then x else
if instance(x, List) then monoidIndices(M, x) else
if M.index#?b then M.index#b else
try index x else -- last ditch attempt for ring elements
error("expected an integer or variable of the ring or monoid: ", toString x))

-----------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions M2/Macaulay2/m2/shared.m2
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ protect Base
protect Jacobian

protect Iterate

protect Threads
10 changes: 4 additions & 6 deletions M2/Macaulay2/packages/FastMinors.m2
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export{
"Rank", --a value for Strategy in isRankAtLeast
-- "MutableSmallest",
-- "MutableLargest",
"Threads",
"MinorsCache",
"Modulus",
-- "MaxMinorsFunction",
Expand Down Expand Up @@ -1698,7 +1697,6 @@ doc ///
isRankAtLeast
(isRankAtLeast, ZZ, Matrix)
[isRankAtLeast, Verbose]
[isRankAtLeast, Threads]
Headline
determines if the matrix has rank at least a number
Usage
Expand Down Expand Up @@ -1734,7 +1732,6 @@ doc ///
getSubmatrixOfRank
(getSubmatrixOfRank, ZZ, Matrix)
[getSubmatrixOfRank, Verbose]
[getSubmatrixOfRank, Threads]
Headline
tries to find a submatrix of the given rank
Usage
Expand Down Expand Up @@ -1998,7 +1995,6 @@ doc ///
recursiveMinors
(recursiveMinors, ZZ, Matrix)
[recursiveMinors, MinorsCache]
[recursiveMinors, Threads]
[recursiveMinors,Verbose]
MinorsCache
Headline
Expand Down Expand Up @@ -2106,12 +2102,14 @@ doc ///

doc ///
Key
Threads
[isRankAtLeast, Threads]
[getSubmatrixOfRank, Threads]
[recursiveMinors, Threads]
Headline
an option for various functions
Description
Text
Increasing this function may tell various functions to multithread their operations. You may also want to increase {\tt allowableThreads}.
Increasing this option may tell various functions to multithread their operations. You may also want to increase {\tt allowableThreads}.
SeeAlso
isRankAtLeast
getSubmatrixOfRank
Expand Down
1 change: 1 addition & 0 deletions M2/Macaulay2/packages/Macaulay2Doc/options.m2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ opts = unique opts;

optionalNames := select(unique \\ flatten \\ keys \ opts, s -> instance(s, Symbol) and isGlobalSymbol toString s and
not isUndocumented(d := makeDocumentTag s) and (isMissingDoc d or headline d === "an optional argument"))
optionalNames = unique join({ Threads }, optionalNames)

optionalValues := unique(flatten \\ values \ opts
| { Prune, Binomial, Test, Center, Right, Left, Flexible, Postfix } -- for manually added Symbols
Expand Down
Loading

0 comments on commit 2a4bac5

Please sign in to comment.