@@ -3684,76 +3684,6 @@ def test_count_foreminima():
3684
3684
assert Perm ((3 , 2 , 1 , 0 )).count_foreminima () == 0
3685
3685
3686
3686
3687
- def test_slope_between ():
3688
- assert Perm ((0 , 1 , 2 )).slope_between (0 , 2 ) == 1.0
3689
- assert Perm ((0 , 2 , 1 )).slope_between (1 , 2 ) == - 1.0
3690
- assert Perm ((1 , 0 , 2 )).slope_between (1 , 2 ) == 2.0
3691
- assert Perm ((1 , 2 , 0 )).slope_between (0 , 2 ) == - 0.5
3692
- assert Perm ((2 , 0 , 1 )).slope_between (1 , 2 ) == 1.0
3693
- assert Perm ((2 , 1 , 0 )).slope_between (1 , 2 ) == - 1.0
3694
- assert Perm ((0 , 1 , 2 , 3 )).slope_between (0 , 1 ) == 1.0
3695
- assert Perm ((0 , 1 , 3 , 2 )).slope_between (1 , 2 ) == 2.0
3696
- assert Perm ((0 , 2 , 1 , 3 )).slope_between (1 , 2 ) == - 1.0
3697
- assert Perm ((0 , 2 , 3 , 1 )).slope_between (2 , 3 ) == - 2.0
3698
- assert Perm ((0 , 3 , 1 , 2 )).slope_between (2 , 3 ) == 1.0
3699
- assert Perm ((0 , 3 , 2 , 1 )).slope_between (2 , 3 ) == - 1.0
3700
- assert Perm ((1 , 0 , 2 , 3 )).slope_between (2 , 3 ) == 1.0
3701
- assert Perm ((1 , 0 , 3 , 2 )).slope_between (0 , 3 ) == 0.3333333333333333
3702
- assert Perm ((1 , 2 , 0 , 3 )).slope_between (0 , 3 ) == 0.6666666666666666
3703
- assert Perm ((1 , 2 , 3 , 0 )).slope_between (0 , 1 ) == 1.0
3704
- assert Perm ((1 , 3 , 0 , 2 )).slope_between (2 , 3 ) == 2.0
3705
- assert Perm ((1 , 3 , 2 , 0 )).slope_between (1 , 2 ) == - 1.0
3706
- assert Perm ((2 , 0 , 1 , 3 )).slope_between (1 , 2 ) == 1.0
3707
- assert Perm ((2 , 0 , 3 , 1 )).slope_between (1 , 2 ) == 3.0
3708
- assert Perm ((2 , 1 , 0 , 3 )).slope_between (0 , 1 ) == - 1.0
3709
- assert Perm ((2 , 1 , 3 , 0 )).slope_between (2 , 3 ) == - 3.0
3710
- assert Perm ((2 , 3 , 0 , 1 )).slope_between (1 , 3 ) == - 1.0
3711
- assert Perm ((2 , 3 , 1 , 0 )).slope_between (0 , 1 ) == 1.0
3712
- assert Perm ((3 , 0 , 1 , 2 )).slope_between (1 , 3 ) == 1.0
3713
- assert Perm ((3 , 0 , 2 , 1 )).slope_between (1 , 2 ) == 2.0
3714
- assert Perm ((3 , 1 , 0 , 2 )).slope_between (0 , 2 ) == - 1.5
3715
- assert Perm ((3 , 1 , 2 , 0 )).slope_between (2 , 3 ) == - 2.0
3716
- assert Perm ((3 , 2 , 0 , 1 )).slope_between (1 , 3 ) == - 0.5
3717
- assert Perm ((3 , 2 , 1 , 0 )).slope_between (2 , 3 ) == - 1.0
3718
-
3719
-
3720
- def test_is_costas ():
3721
- assert Perm (()).is_costas () == 1
3722
- assert Perm ((0 ,)).is_costas () == 1
3723
- assert Perm ((0 , 1 )).is_costas () == 1
3724
- assert Perm ((1 , 0 )).is_costas () == 1
3725
- assert Perm ((0 , 1 , 2 )).is_costas () == 0
3726
- assert Perm ((0 , 2 , 1 )).is_costas () == 1
3727
- assert Perm ((1 , 0 , 2 )).is_costas () == 1
3728
- assert Perm ((1 , 2 , 0 )).is_costas () == 1
3729
- assert Perm ((2 , 0 , 1 )).is_costas () == 1
3730
- assert Perm ((2 , 1 , 0 )).is_costas () == 0
3731
- assert Perm ((0 , 1 , 2 , 3 )).is_costas () == 0
3732
- assert Perm ((0 , 1 , 3 , 2 )).is_costas () == 1
3733
- assert Perm ((0 , 2 , 1 , 3 )).is_costas () == 0
3734
- assert Perm ((0 , 2 , 3 , 1 )).is_costas () == 1
3735
- assert Perm ((0 , 3 , 1 , 2 )).is_costas () == 1
3736
- assert Perm ((0 , 3 , 2 , 1 )).is_costas () == 0
3737
- assert Perm ((1 , 0 , 2 , 3 )).is_costas () == 1
3738
- assert Perm ((1 , 0 , 3 , 2 )).is_costas () == 0
3739
- assert Perm ((1 , 2 , 0 , 3 )).is_costas () == 1
3740
- assert Perm ((1 , 2 , 3 , 0 )).is_costas () == 0
3741
- assert Perm ((1 , 3 , 0 , 2 )).is_costas () == 0
3742
- assert Perm ((1 , 3 , 2 , 0 )).is_costas () == 1
3743
- assert Perm ((2 , 0 , 1 , 3 )).is_costas () == 1
3744
- assert Perm ((2 , 0 , 3 , 1 )).is_costas () == 0
3745
- assert Perm ((2 , 1 , 0 , 3 )).is_costas () == 0
3746
- assert Perm ((2 , 1 , 3 , 0 )).is_costas () == 1
3747
- assert Perm ((2 , 3 , 0 , 1 )).is_costas () == 0
3748
- assert Perm ((2 , 3 , 1 , 0 )).is_costas () == 1
3749
- assert Perm ((3 , 0 , 1 , 2 )).is_costas () == 0
3750
- assert Perm ((3 , 0 , 2 , 1 )).is_costas () == 1
3751
- assert Perm ((3 , 1 , 0 , 2 )).is_costas () == 1
3752
- assert Perm ((3 , 1 , 2 , 0 )).is_costas () == 0
3753
- assert Perm ((3 , 2 , 0 , 1 )).is_costas () == 1
3754
- assert Perm ((3 , 2 , 1 , 0 )).is_costas () == 0
3755
-
3756
-
3757
3687
def test_matrix_class ():
3758
3688
assert Matrix (0 ) == Matrix (0 )
3759
3689
matrix = Matrix (size = 3 , elements = {(0 , 0 ): 1 , (1 , 1 ): 1 , (2 , 2 ): 1 })
0 commit comments