Skip to content

Commit

Permalink
moved randomLam to main
Browse files Browse the repository at this point in the history
  • Loading branch information
aryamanmaithani committed Jun 2, 2024
1 parent 48e6c9d commit 9a8af42
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 14 additions & 1 deletion GLIdeals.m2
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,20 @@ detLam = (X,lam) -> (
return C
)


randomLam = method();
randomLam(ZZ, ZZ) := (n,k) -> (
L=new MutableList from {};
sumsofar = 0;
for i from 0 to (n-2) do(
x = random(0, k-sumsofar);
L#i=x;
sumsofar = sumsofar + x;
);
L#(n-1) = k - sumsofar;
L=toList L;
L=rsort L;
return delete(0,L)
)

idealILambda = method()
idealILambda(Matrix,List) := (X,lam) -> (
Expand Down
15 changes: 1 addition & 14 deletions randomLam.m2
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
randomLam = method();
randomLam(ZZ, ZZ) := (n,k) -> (
L=new MutableList from {};
sumsofar = 0;
for i from 0 to (n-2) do(
x = random(0, k-sumsofar);
L#i=x;
sumsofar = sumsofar + x;
);
L#(n-1) = k - sumsofar;
L=toList L;
L=rsort L;
return delete(0,L)
)

0 comments on commit 9a8af42

Please sign in to comment.