1
1
using JetBrains . Annotations ;
2
2
using Perfolizer . Mathematics . Cpd ;
3
3
using Perfolizer . Mathematics . Distributions . ContinuousDistributions ;
4
- using Perfolizer . Tests . Common ;
5
- using Perfolizer . Tests . Mathematics . Cpd . TestDataSets ;
4
+ using Perfolizer . SimulationTests . Cpd . TestDataSets ;
5
+ using Perfolizer . Tests . Infra ;
6
+ using Xunit . Abstractions ;
6
7
7
- namespace Perfolizer . Tests . Mathematics . Cpd ;
8
+ namespace Perfolizer . SimulationTests . Cpd ;
8
9
9
- public class RqqPeltTests
10
+ public class RqqPeltTests ( ITestOutputHelper output )
10
11
{
11
- private readonly ITestOutputHelper output ;
12
12
private readonly PeltChangePointDetector detector = RqqPeltChangePointDetector . Instance ;
13
13
14
- public RqqPeltTests ( ITestOutputHelper output )
15
- {
16
- this . output = output ;
17
- }
18
-
19
14
[ AssertionMethod ]
20
15
private void Check ( double [ ] data , int minDistance , int [ ] expectedChangePoints )
21
16
{
@@ -31,13 +26,13 @@ private void Check(double[] data, int minDistance, int[] expectedChangePoints)
31
26
public void Tie01 ( ) => Check ( new double [ ]
32
27
{
33
28
0 , 0 , 0 , 0 , 0 , 100 , 100 , 100 , 100
34
- } , 1 , new [ ] { 4 } ) ;
29
+ } , 1 , new [ ] { 4 } ) ;
35
30
36
31
[ Fact ]
37
32
public void Tie02 ( ) => Check ( new double [ ]
38
33
{
39
34
0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 2 , 2
40
- } , 1 , new [ ] { 5 , 11 } ) ;
35
+ } , 1 , new [ ] { 5 , 11 } ) ;
41
36
42
37
[ Fact ]
43
38
public void Check_WhenTwoMinDistanceLessThanDataLength_ReturnEmptyArray ( ) => Check ( new double [ ]
@@ -47,7 +42,7 @@ public void Check_WhenTwoMinDistanceLessThanDataLength_ReturnEmptyArray() => Che
47
42
48
43
[ Fact ]
49
44
[ Trait ( TraitConstants . Category , TraitConstants . Slow ) ]
50
- public void ArithmeticProgression ( ) => Check ( Enumerable . Range ( 1 , 500 ) . Select ( it => ( double ) it ) . ToArray ( ) , 10 , new [ ]
45
+ public void ArithmeticProgression ( ) => Check ( Enumerable . Range ( 1 , 500 ) . Select ( it => ( double ) it ) . ToArray ( ) , 10 , new [ ]
51
46
{
52
47
9 , 19 , 29 , 39 , 49 , 59 , 69 , 79 , 89 , 99 , 109 , 119 , 129 , 139 , 149 , 159 , 169 , 179 , 189 , 199 , 209 , 219 , 229 , 239 ,
53
48
249 , 259 , 269 , 279 , 289 , 299 , 309 , 319 , 329 , 339 , 349 , 359 , 369 , 379 , 389 , 399 , 409 , 419 , 429 , 439 , 449 ,
@@ -91,11 +86,13 @@ public void GaussianStdDevProgression(int error, string stdDevValuesString)
91
86
var indexes = detector . GetChangePointIndexes ( data . ToArray ( ) , 20 ) ;
92
87
Check100 ( stdDevValues . Length , error , indexes ) ;
93
88
}
94
-
95
- private static readonly IReadOnlyList < CpdTestData > ReferenceDataSet = CpdReferenceDataSet . Generate ( new Random ( 42 ) , 1 ) ;
89
+
90
+ private static readonly IReadOnlyList < CpdTestData > ReferenceDataSet =
91
+ CpdReferenceDataSet . Generate ( new Random ( 42 ) , 1 ) ;
96
92
97
93
[ UsedImplicitly ]
98
- public static TheoryData < string > ReferenceDataSetNames = TheoryDataHelper . Create ( ReferenceDataSet . Select ( d => d . Name ) ) ;
94
+ public static TheoryData < string > ReferenceDataSetNames =
95
+ TheoryDataHelper . Create ( ReferenceDataSet . Select ( d => d . Name ) ) ;
99
96
100
97
[ Theory ]
101
98
[ MemberData ( nameof ( ReferenceDataSetNames ) ) ]
0 commit comments