From 136ad651664092bc1418eb8a074c520eb4e3f2d3 Mon Sep 17 00:00:00 2001 From: Ricardo Fabbri Date: Tue, 12 Mar 2024 13:41:24 -0300 Subject: [PATCH] Fixed warnings in M2 1.23 per issue #1 Just changed variable names and double-checked with their conflicting versions and where they are used to be sure to use the right one. The warnings are simple but verbose. --- CODE/common.m2 | 18 +++++++++--------- CODE/monodromy_example.m2 | 2 +- CODE/numerical-problem-builder.m2 | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CODE/common.m2 b/CODE/common.m2 index aa04951..34c2e89 100644 --- a/CODE/common.m2 +++ b/CODE/common.m2 @@ -384,8 +384,8 @@ leverageScores = M -> ( -- indexes subsystem giving Jacobian rank -rowSelector = method(Options=>{Threshold=>1e-4}) -rowSelector Matrix := o -> J0 -> ( +rowSelectorPLMP = method(Options=>{Threshold=>1e-4}) +rowSelectorPLMP Matrix := o -> J0 -> ( (m , n) := size J0; J0' := J0^{0}; -- should technically check this is not identically zero i := 1; @@ -405,7 +405,7 @@ rowSelector Matrix := o -> J0 -> ( leverageScoreRowSelector = J0 -> ( sortedRows := (leverageScores J0)/last; - r := rowSelector J0^(sortedRows); + r := rowSelectorPLMP J0^(sortedRows); sort(r/(i->sortedRows#i)) ) @@ -493,13 +493,13 @@ cpMatrix = t -> matrix{{0,-t_(2,0),t_(1,0)},{t_(2,0),0,-t_(0,0)},{-t_(1,0),t_(0, essential = (R,t) -> R * cpMatrix t -pCompose = method() -pCompose (MutableHashTable, MutableHashTable) := (H1, H2) -> ( +pCompose2 = method() +pCompose2 (MutableHashTable, MutableHashTable) := (H1, H2) -> ( new MutableHashTable from apply(keys H1,k-> if H2#?(H1#k) then k=> H2#(H1#k)) ) -writePermutations = method(Options=>{}) -writePermutations (HomotopyNode, String) := o -> (V, filename) -> ( +writePermutationsPLMP = method(Options=>{}) +writePermutationsPLMP (HomotopyNode, String) := o -> (V, filename) -> ( -- assume for now that G has 2 nodes G := V.Graph; V1 := first G.Vertices; @@ -507,10 +507,10 @@ writePermutations (HomotopyNode, String) := o -> (V, filename) -> ( E1 := toList V1.Edges; -- "petal loops" based at V1 e1 := first E1; - perms := apply(drop(E1,1),e->values pCompose(e1.Correspondence12,e.Correspondence21)); + perms := apply(drop(E1,1),e->values pCompose2(e1.Correspondence12,e.Correspondence21)); writePermutations(perms,filename); ) -writePermutations (List, String) := o -> (L, filename) -> ( +writePermutationsPLMP (List, String) := o -> (L, filename) -> ( perms := L/(P->P/(i->i+1)); -- increment letters by 1 for GAP file := openOut (currentFileDirectory | filename); for i from 0 to #perms-1 do file << "p" << i << ":= PermList(" << toString(new Array from perms#i) << ");" << endl; diff --git a/CODE/monodromy_example.m2 b/CODE/monodromy_example.m2 index 514af64..08a5a00 100644 --- a/CODE/monodromy_example.m2 +++ b/CODE/monodromy_example.m2 @@ -77,4 +77,4 @@ concatenate ts -- post-process the output of monodromySolver -writePermutations(V, "example" | ".txt") +writePermutationsPLMP(V, "example" | ".txt") diff --git a/CODE/numerical-problem-builder.m2 b/CODE/numerical-problem-builder.m2 index f62c88c..b4af9a9 100644 --- a/CODE/numerical-problem-builder.m2 +++ b/CODE/numerical-problem-builder.m2 @@ -174,7 +174,7 @@ if (instance(Jpivots, Symbol) and JACOBIAN) then ( (M,N) = size J; elapsedTime JGS = gateSystem(paramMatrix, varMatrix, transpose matrix{flatten entries J}); elapsedTime J0 = matrix(transpose evaluate(JGS,y,c),M,N); - elapsedTime Jpivots = rowSelector(J0,Threshold=>1e-6); + elapsedTime Jpivots = rowSelectorPLMP(J0,Threshold=>1e-6); elapsedTime S = first SVD J0^Jpivots; << "pivot indices are " << toString Jpivots << endl; )