Skip to content

Commit 23f0256

Browse files
Fix empty tree
1 parent 5733fc8 commit 23f0256

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Integreat/BTrees.wl

+5-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SetAttributes[tree, Listable];
4141
(*N-Trees*)
4242

4343

44-
treeN[0, n_] := \[FormalY];
44+
treeN[0, n_] := {\[FormalY]};
4545
treeN[1, n_] := Table[Subscript[\[FormalF], i], {i, n}];
4646
treeN[p_, n_] := treeN[p, n] = Flatten[Outer[Construct, treeN[1, n], branches[treeN[#, n] &, p - 1]]];
4747
SetAttributes[treeN, Listable];
@@ -51,16 +51,15 @@ SetAttributes[treeN, Listable];
5151
(*DAE-Trees*)
5252

5353

54-
treeDiffAlg[0] := \[FormalY];
54+
treeDiffAlg[0] := {\[FormalY]};
5555
treeDiffAlg[p_] := Join[treeDiff[p], treeAlg[p]];
5656

57-
treeDiff[0] := \[FormalY];
57+
treeDiff[0] := {\[FormalY]};
5858
treeDiff[1] := {\[FormalF]};
5959
treeDiff[p_] := treeDiff[p] = Map[\[FormalF], branches[treeDiffAlg, p - 1]];
6060

61-
treeAlg[0] := \[FormalY];
62-
treeAlg[1] := {\[FormalG][\[FormalF]]};
63-
treeAlg[p_] := treeAlg[k] = Map[\[FormalG], Join[branches[treeDiffAlg, p, {2, p}], treeDiff[p]]];
61+
treeAlg[0] := {\[FormalY]};
62+
treeAlg[p_] := treeAlg[p] = Map[\[FormalG], Join[branches[treeDiffAlg, p, {2, p}], treeDiff[p]]];
6463
SetAttributes[{treeDiffAlg, treeDiff, treeAlg} , Listable];
6564

6665

0 commit comments

Comments
 (0)