@@ -314,6 +314,7 @@ using Aqua: Aqua
314
314
@inferred t1 ∘ t1
315
315
t_result = copy (t1)
316
316
@inferred butcher_product! (t_result, t1, t1)
317
+ @test @allocated (butcher_product! (t_result, t1, t1)) == 0
317
318
@test t_result == t1 ∘ t1
318
319
319
320
t2 = rootedtree ([1 , 2 ])
@@ -324,6 +325,7 @@ using Aqua: Aqua
324
325
@test β (t2) == α (t2) * γ (t2)
325
326
@test t2 == t1 ∘ t1
326
327
@inferred butcher_product! (t_result, t1, t1)
328
+ @test @allocated (butcher_product! (t_result, t1, t1)) == 0
327
329
@test t2 == t_result
328
330
@test butcher_representation (t2) == " [τ]"
329
331
latex_string = " \\ rootedtree[.[.]]"
@@ -341,6 +343,7 @@ using Aqua: Aqua
341
343
@test β (t3) == α (t3) * γ (t3)
342
344
@test t3 == t2 ∘ t1
343
345
@inferred butcher_product! (t_result, t2, t1)
346
+ @test @allocated (butcher_product! (t_result, t2, t1)) == 0
344
347
@test t3 == t_result
345
348
@test butcher_representation (t3) == " [τ²]"
346
349
latex_string = " \\ rootedtree[.[.][.]]"
@@ -358,6 +361,7 @@ using Aqua: Aqua
358
361
@test β (t4) == α (t4) * γ (t4)
359
362
@test t4 == t1 ∘ t2
360
363
@inferred butcher_product! (t_result, t1, t2)
364
+ @test @allocated (butcher_product! (t_result, t1, t2)) == 0
361
365
@test t4 == t_result
362
366
@test butcher_representation (t4) == " [[τ]]"
363
367
latex_string = " \\ rootedtree[.[.[.]]]"
@@ -375,6 +379,7 @@ using Aqua: Aqua
375
379
@test β (t5) == α (t5) * γ (t5)
376
380
@test t5 == t3 ∘ t1
377
381
@inferred butcher_product! (t_result, t3, t1)
382
+ @test @allocated (butcher_product! (t_result, t3, t1)) == 0
378
383
@test t5 == t_result
379
384
@test butcher_representation (t5) == " [τ³]"
380
385
@test RootedTrees. subtrees (t5) ==
@@ -392,8 +397,10 @@ using Aqua: Aqua
392
397
@test β (t6) == α (t6) * γ (t6)
393
398
@test t6 == t2 ∘ t2 == t4 ∘ t1
394
399
@inferred butcher_product! (t_result, t2, t2)
400
+ @test @allocated (butcher_product! (t_result, t2, t2)) == 0
395
401
@test t6 == t_result
396
402
@inferred butcher_product! (t_result, t4, t1)
403
+ @test @allocated (butcher_product! (t_result, t4, t1)) == 0
397
404
@test t6 == t_result
398
405
@test butcher_representation (t6) == " [[τ]τ]"
399
406
@test RootedTrees. subtrees (t6) == [rootedtree ([2 , 3 ]), rootedtree ([2 ])]
@@ -409,6 +416,7 @@ using Aqua: Aqua
409
416
@test β (t7) == α (t7) * γ (t7)
410
417
@test t7 == t1 ∘ t3
411
418
@inferred butcher_product! (t_result, t1, t3)
419
+ @test @allocated (butcher_product! (t_result, t1, t3)) == 0
412
420
@test t7 == t_result
413
421
@test butcher_representation (t7) == " [[τ²]]"
414
422
@test elementary_differential_latexstring (t7) ==
@@ -422,6 +430,7 @@ using Aqua: Aqua
422
430
@test α (t8) == 1
423
431
@test t8 == t1 ∘ t4
424
432
@inferred butcher_product! (t_result, t1, t4)
433
+ @test @allocated (butcher_product! (t_result, t1, t4)) == 0
425
434
@test t8 == t_result
426
435
@test butcher_representation (t8) == " [[[τ]]]"
427
436
@test elementary_differential_latexstring (t8) ==
@@ -437,6 +446,7 @@ using Aqua: Aqua
437
446
@test β (t9) == α (t9) * γ (t9)
438
447
@test t9 == t5 ∘ t1
439
448
@inferred butcher_product! (t_result, t5, t1)
449
+ @test @allocated (butcher_product! (t_result, t5, t1)) == 0
440
450
@test t9 == t_result
441
451
@test butcher_representation (t9) == " [τ⁴]"
442
452
@test elementary_differential_latexstring (t9) == L " $f^{(4)}(f, f, f, f)$"
@@ -450,8 +460,10 @@ using Aqua: Aqua
450
460
@test β (t10) == α (t10) * γ (t10)
451
461
@test t10 == t3 ∘ t2 == t6 ∘ t1
452
462
@inferred butcher_product! (t_result, t3, t2)
463
+ @test @allocated (butcher_product! (t_result, t3, t2)) == 0
453
464
@test t10 == t_result
454
465
@inferred butcher_product! (t_result, t6, t1)
466
+ @test @allocated (butcher_product! (t_result, t6, t1)) == 0
455
467
@test t10 == t_result
456
468
@test butcher_representation (t10) == " [[τ]τ²]"
457
469
@test elementary_differential_latexstring (t10) ==
@@ -466,8 +478,10 @@ using Aqua: Aqua
466
478
@test α (t11) == 4
467
479
@test t11 == t2 ∘ t3 == t7 ∘ t1
468
480
@inferred butcher_product! (t_result, t2, t3)
481
+ @test @allocated (butcher_product! (t_result, t2, t3)) == 0
469
482
@test t11 == t_result
470
483
@inferred butcher_product! (t_result, t7, t1)
484
+ @test @allocated (butcher_product! (t_result, t7, t1)) == 0
471
485
@test t11 == t_result
472
486
@test butcher_representation (t11) == " [[τ²]τ]"
473
487
@test elementary_differential_latexstring (t11) ==
@@ -483,8 +497,10 @@ using Aqua: Aqua
483
497
@test β (t12) == α (t12) * γ (t12)
484
498
@test t12 == t2 ∘ t4 == t8 ∘ t1
485
499
@inferred butcher_product! (t_result, t2, t4)
500
+ @test @allocated (butcher_product! (t_result, t2, t4)) == 0
486
501
@test t12 == t_result
487
502
@inferred butcher_product! (t_result, t8, t1)
503
+ @test @allocated (butcher_product! (t_result, t8, t1)) == 0
488
504
@test t12 == t_result
489
505
@test butcher_representation (t12) == " [[[τ]]τ]"
490
506
@test elementary_differential_latexstring (t12) ==
@@ -500,6 +516,7 @@ using Aqua: Aqua
500
516
@test β (t13) == α (t13) * γ (t13)
501
517
@test t13 == t4 ∘ t2
502
518
@inferred butcher_product! (t_result, t4, t2)
519
+ @test @allocated (butcher_product! (t_result, t4, t2)) == 0
503
520
@test t13 == t_result
504
521
@test butcher_representation (t13) == " [[τ][τ]]"
505
522
@test elementary_differential_latexstring (t13) ==
@@ -515,6 +532,7 @@ using Aqua: Aqua
515
532
@test β (t14) == α (t14) * γ (t14)
516
533
@test t14 == t1 ∘ t5
517
534
@inferred butcher_product! (t_result, t1, t5)
535
+ @test @allocated (butcher_product! (t_result, t1, t5)) == 0
518
536
@test t14 == t_result
519
537
@test butcher_representation (t14) == " [[τ³]]"
520
538
@test elementary_differential_latexstring (t14) ==
@@ -530,6 +548,7 @@ using Aqua: Aqua
530
548
@test β (t15) == α (t15) * γ (t15)
531
549
@test t15 == t1 ∘ t6
532
550
@inferred butcher_product! (t_result, t1, t6)
551
+ @test @allocated (butcher_product! (t_result, t1, t6)) == 0
533
552
@test t15 == t_result
534
553
@test butcher_representation (t15) == " [[[τ]τ]]"
535
554
@test elementary_differential_latexstring (t15) ==
@@ -545,6 +564,7 @@ using Aqua: Aqua
545
564
@test β (t16) == α (t16) * γ (t16)
546
565
@test t16 == t1 ∘ t7
547
566
@inferred butcher_product! (t_result, t1, t7)
567
+ @test @allocated (butcher_product! (t_result, t1, t7)) == 0
548
568
@test t16 == t_result
549
569
@test butcher_representation (t16) == " [[[τ²]]]"
550
570
@test elementary_differential_latexstring (t16) ==
@@ -560,6 +580,7 @@ using Aqua: Aqua
560
580
@test β (t17) == α (t17) * γ (t17)
561
581
@test t17 == t1 ∘ t8
562
582
@inferred butcher_product! (t_result, t1, t8)
583
+ @test @allocated (butcher_product! (t_result, t1, t8)) == 0
563
584
@test t17 == t_result
564
585
@test butcher_representation (t17) == " [[[[τ]]]]"
565
586
@test elementary_differential_latexstring (t17) ==
@@ -1095,6 +1116,39 @@ using Aqua: Aqua
1095
1116
end
1096
1117
end
1097
1118
1119
+ @testset " Butcher product" begin
1120
+ t1_0 = @inferred rootedtree ([1 ], Bool[0 ])
1121
+ t1_1 = @inferred rootedtree ([1 ], Bool[1 ])
1122
+ @inferred t1_0 ∘ t1_0
1123
+ t_result = copy (t1_0)
1124
+ @inferred butcher_product! (t_result, t1_0, t1_0)
1125
+ @test_broken @allocated (butcher_product! (t_result, t1_0, t1_0)) == 0
1126
+ @test t_result == t1_0 ∘ t1_0
1127
+ @test t_result == rootedtree ([1 , 2 ], Bool[0 , 0 ])
1128
+ @inferred butcher_product! (t_result, t1_1, t1_0)
1129
+ @test_broken @allocated (butcher_product! (t_result, t1_1, t1_0)) == 0
1130
+ @test t_result == t1_1 ∘ t1_0
1131
+ @test t_result == rootedtree ([1 , 2 ], Bool[1 , 0 ])
1132
+ @inferred butcher_product! (t_result, t1_0, t1_1)
1133
+ @test_broken @allocated (butcher_product! (t_result, t1_0, t1_1)) == 0
1134
+ @test t_result == t1_0 ∘ t1_1
1135
+ @test t_result == rootedtree ([1 , 2 ], Bool[0 , 1 ])
1136
+ @inferred butcher_product! (t_result, t1_1, t1_1)
1137
+ @test_broken @allocated (butcher_product! (t_result, t1_1, t1_1)) == 0
1138
+ @test t_result == t1_1 ∘ t1_1
1139
+ @test t_result == rootedtree ([1 , 2 ], Bool[1 , 1 ])
1140
+
1141
+ t2_0 = @inferred rootedtree ([1 , 2 ], Bool[0 , 0 ])
1142
+ @inferred butcher_product! (t_result, t2_0, t1_0)
1143
+ @test_broken @allocated (butcher_product! (t_result, t2_0, t1_0)) == 0
1144
+ @test t_result == t2_0 ∘ t1_0
1145
+ @test t_result == rootedtree ([1 , 2 , 2 ], Bool[0 , 0 , 0 ])
1146
+ @inferred butcher_product! (t_result, t2_0, t1_1)
1147
+ @test_broken @allocated (butcher_product! (t_result, t2_0, t1_1)) == 0
1148
+ @test t_result == t2_0 ∘ t1_1
1149
+ @test t_result == rootedtree ([1 , 2 , 2 ], Bool[0 , 0 , 1 ])
1150
+ end
1151
+
1098
1152
@testset " latexify" begin
1099
1153
@testset " default style" begin
1100
1154
let t = rootedtree (Int[], Bool[])
0 commit comments