Skip to content

Commit 114f0e6

Browse files
authored
Merge pull request #1037 from mathics/CombinatoricaV0.9
Add Combinatorica V 0.9ish
2 parents fe5bf84 + a930bb1 commit 114f0e6

3 files changed

Lines changed: 3418 additions & 1 deletion

File tree

mathics/packages/DiscreteMath/CombinatoricaV0.6.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
5757
*)
5858

59+
(* :Mathematica Version: 0.6.0 for Mathics
60+
This is Mathematica Version 0.6 adapted for Mathics.
61+
*)
62+
63+
5964
BeginPackage["DiscreteMath`CombinatoricaV0.6`"]
6065

6166
Graph::usage = "Graph[g,v] is the header for a graph object where g is an adjacency matrix and v is a list of vertices."
@@ -378,7 +383,9 @@
378383

379384
NumberOfSpanningTrees::usage = "NumberOfSpanningTrees[g] computes the number of distinct labeled spanning trees of graph g."
380385

386+
(* Not yet
381387
NumberOfTableaux::usage = "NumberOfTableaux[p] uses the hook length formula to count the number of Young tableaux with shape defined by partition p."
388+
*)
382389

383390
OrientGraph::usage = "OrientGraph[g] assigns a direction to each edge of a bridgeless, undirected graph g, so that the graph is strongly connected."
384391

@@ -420,13 +427,16 @@
420427

421428
RandomKSubset::usage = "RandomKSubset[l,k] returns a random subset of set l with exactly k elements."
422429

430+
(* Not yet...
423431
RandomPartition::usage = "RandomPartition[n] constructs a random partition of integer n."
424432
425433
RandomPermutation1::usage = "RandomPermutation1[n] sorts random numbers to generate a random permutation."
426434
427435
RandomPermutation2::usage = "RandomPermutation2[n] uses random transpositions to generate random permutations."
428436
437+
429438
RandomPermutation::usage = "RandomPermutation[n] returns a random permutation of length n."
439+
*)
430440

431441
RandomSubset::usage = "RandomSubset[l] creates a random subset of set l."
432442

@@ -500,7 +510,9 @@
500510

501511
TableauClasses::usage = "TableauClasses[p] partitions the elements of permutation p into classes according to their initial columns during Young tableaux construction."
502512

513+
(*
503514
TableauQ::usage = "TableauQ[t] returns True if and only if t represents a Young tableau."
515+
*)
504516

505517
TableauxToPermutation::usage = "TableauxToPermutation[t1,t2] constructs the unique permutation associated with Young tableaux t1 and t2, where both tableaux have the same shape. "
506518

@@ -1156,6 +1168,7 @@
11561168
NextComposition[l_List] :=
11571169
Join[{Apply[Plus,l]},Table[0,{Length[l]-1}]] /; Last[l]==Apply[Plus,l]
11581170

1171+
(* Not yet
11591172
TableauQ[{}] = True
11601173
TableauQ[t_List] :=
11611174
And [
@@ -1164,6 +1177,7 @@
11641177
Apply[ GreaterEqual, Map[Length,t] ],
11651178
Apply[ GreaterEqual, Map[Length,TransposeTableau[t]] ]
11661179
]
1180+
*)
11671181

11681182
TransposeTableau[tb_List] :=
11691183
Block[{t=Select[tb,(Length[#]>=1)&],row},
@@ -1280,6 +1294,7 @@
12801294
y
12811295
]
12821296

1297+
(* Not yet
12831298
NumberOfTableaux[{}] := 1
12841299
NumberOfTableaux[s_List] :=
12851300
Block[{row,col,transpose=TransposePartition[s]},
@@ -1291,6 +1306,7 @@
12911306
]
12921307
12931308
NumberOfTableaux[n_Integer] := Apply[Plus, Map[NumberOfTableaux, Partitions[n]]]
1309+
*)
12941310

12951311
CatalanNumber[n_] := Binomial[2n,n]/(n+1) /; (n>=0)
12961312

@@ -3315,9 +3331,11 @@
33153331
StronglyConnectedComponents,
33163332
Subsets,
33173333
TableauClasses,
3334+
(*
33183335
TableauQ,
33193336
TableauxToPermutation,
33203337
Tableaux,
3338+
*)
33213339
ToAdjacencyLists,
33223340
ToCycles,
33233341
ToInversionVector,

0 commit comments

Comments
 (0)