-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ad253b
commit df43802
Showing
1 changed file
with
9 additions
and
6 deletions.
There are no files selected for viewing
15 changes: 9 additions & 6 deletions
15
src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
package neqsim.statistics.dataanalysis.datasmoothing; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import Jama.Matrix; | ||
|
||
public class DataSmootherTest { | ||
|
||
@Test | ||
void testgetSmoothedNumbers(String[] args) { | ||
void testgetSmoothedNumbers() { | ||
double[] numbers = {10, 11, 12, 13, 14, 15, 15.5, 15, 19, 14, 14, 13, 12, 12, 11, 10, 9, 8}; | ||
DataSmoother test = new DataSmoother(numbers, 3, 3, 0, 4); | ||
Matrix data = new Matrix(test.getSmoothedNumbers(), 1); | ||
data.print(10, 2); | ||
Assertions.assertArrayEquals(numbers, test.getSmoothedNumbers()); | ||
|
||
double[] expected = {10.000000, 11.000000, 12.000000, 12.567099567099579, 13.567099567099582, | ||
14.556277056277072, 15.305194805194823, 15.389610389610409, 16.66233766233768, | ||
17.149350649350666, 13.350649350649375, 13.627705627705646, 12.432900432900452, | ||
11.89177489177491, 11.541125541125552, 10.000000, 9.000000, 8.000000}; | ||
test.runSmoothing(); | ||
data = new Matrix(test.getSmoothedNumbers(), 1); | ||
data.print(10, 2); | ||
Assertions.assertArrayEquals(expected, test.getSmoothedNumbers()); | ||
} | ||
} |