Skip to content

Commit e99eed2

Browse files
committed
Remove redundant listZ function & use listZZ instead
Also stop calling it from Matrix_List & Matrix^List; it's called later down the line by submatrixFree.
1 parent 6fe892c commit e99eed2

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

M2/Macaulay2/m2/engine.m2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ isSmall := i -> class i === ZZ and i < 2^15 and i > -2^15
5353
isCount := i -> class i === ZZ and i >= 0 and i < 2^15
5454
isListOfIntegers = x -> instance(x, List) and all(x,i -> class i === ZZ)
5555
isListOfListsOfIntegers = x -> instance(x, List) and all(x,isListOfIntegers)
56-
listZ = listZZ = v -> if isListOfIntegers(v = toList splice v) then v else error "expected a list of integers"
56+
listZZ = v -> if isListOfIntegers(v = toList splice v) then v else error "expected a list of integers"
5757
checkCount := i -> if not isCount i then error "expected a small positive integer"
5858

5959
fixup1 := method(Dispatch => Thing) -- stage 1, everything except Tiny and Small

M2/Macaulay2/m2/matrix.m2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ Matrix || Number := (f,g) -> concatRows(f,g*id_(source f))
431431
-----------------------------------------------------------------------------
432432
-- submatrix, submatrixByDegrees
433433
-----------------------------------------------------------------------------
434-
Matrix _ List := Matrix => (f,v) -> submatrix(f,listZ splice v) -- get some columns
435-
Matrix ^ List := Matrix => (f,v) -> submatrix(f,listZ splice v,) -- get some rows
434+
Matrix _ List := Matrix => (f,v) -> submatrix(f, v) -- get some columns
435+
Matrix ^ List := Matrix => (f,v) -> submatrix(f, v,) -- get some rows
436436

437437
Matrix _ ZZ := Vector => (m,i) -> (
438438
R := ring m;

M2/Macaulay2/m2/matrix2.m2

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,9 @@ support Ideal := I -> support generators I
525525
--------------------
526526
homogenize = method()
527527

528-
listZ := v -> (
529-
if not all(v,i -> class i === ZZ) then error "expected list of integers";
530-
)
531-
532528
homogCheck := (R, f, v, wts) -> (
533529
if R =!= ring v then error "homogenization requires variable in the same ring";
534-
listZ wts;
530+
wts = listZZ wts;
535531
if degreeLength R =!= 1 then error "homogenization requires degrees of length 1";
536532
-- if # wts != numgens ring f then error "homogenization weight vector has incorrect length";
537533
i := index v;

0 commit comments

Comments
 (0)