mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-30 07:54:05 +08:00
30 lines
739 B
Java
30 lines
739 B
Java
package com.thealgorithms.maths;
|
|
|
|
import static com.thealgorithms.maths.Gaussian.gaussian;
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import java.util.ArrayList;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
public class GaussianTest {
|
|
|
|
// easy pass test for the whole class. Matrix of 2*3.
|
|
@Test
|
|
void passTest1() {
|
|
ArrayList<Double> list = new ArrayList<Double>();
|
|
ArrayList<Double> answer = new ArrayList<Double>();
|
|
answer.add(0.0);
|
|
answer.add(1.0);
|
|
|
|
int matrixSize = 2;
|
|
list.add(1.0);
|
|
list.add(1.0);
|
|
list.add(1.0);
|
|
list.add(2.0);
|
|
list.add(1.0);
|
|
list.add(1.0);
|
|
|
|
assertEquals(answer, gaussian(matrixSize, list));
|
|
}
|
|
}
|