Skip to content

Commit

Permalink
MATH-1623: Remove duplicate unit tests.
Browse files Browse the repository at this point in the history
Standard test functions are now handled by class "SimplexOptimizerTest".
  • Loading branch information
Gilles Sadowski committed Aug 9, 2021
1 parent fdbb8b9 commit 858ecda
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 246 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,38 +120,6 @@ public void testFourExtremaMaximize2() {
1e-6);
}

@Test
public void testRosenbrock() {
final int dim = 2;
doTest(TestFunction.ROSENBROCK.withDimension(dim),
OptimTestUtils.point(new double[] { -1.2, 1 }, 1e-1),
GoalType.MINIMIZE,
190,
new PointValuePair(OptimTestUtils.point(dim, 1.0), 0.0),
1e-4);
}

@Test
public void testPowell() {
final int dim = 4;
doTest(TestFunction.POWELL.withDimension(dim),
OptimTestUtils.point(new double[] { 3, -1, 0, 1 }, 1e-1),
GoalType.MINIMIZE,
420,
new PointValuePair(OptimTestUtils.point(dim, 0.0), 0.0),
2e-4);
}

@Ignore("See MATH-1552")@Test
public void testEllipse() {
doTest(TestFunction.ELLI.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
911,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-9);
}

@Ignore("See MATH-1552")@Test
public void testElliRotated() {
doTest(new OptimTestUtils.ElliRotated(),
Expand All @@ -162,97 +130,6 @@ public void testElliRotated() {
1e-9);
}

@Test
public void testCigar() {
doTest(TestFunction.CIGAR.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
7000,
new PointValuePair(OptimTestUtils.point(DIM,0.0), 0.0),
1e-6);
}

@Ignore("See MATH-1552")@Test
public void testTwoAxes() {
doTest(TestFunction.TWO_AXES.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
1219,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-12);
}

@Ignore("See MATH-1552")@Test
public void testCigTab() {
doTest(TestFunction.CIG_TAB.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
827,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-8);
}

@Test
public void testSphere() {
doTest(TestFunction.SPHERE.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
2580,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-6);
}

@Ignore("See MATH-1552")@Test
public void testTablet() {
doTest(TestFunction.TABLET.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
911,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-9);
}

@Ignore("See MATH-1552")@Test
public void testDiffPow() {
doTest(TestFunction.DIFF_POW.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
631,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-14);
}

@Test
public void testSsDiffPow() {
final int dim = DIM / 2;
doTest(TestFunction.SS_DIFF_POW.withDimension(dim),
OptimTestUtils.point(dim, 1.0, 1e-1),
GoalType.MINIMIZE,
4000,
new PointValuePair(OptimTestUtils.point(dim, 0.0), 0.0),
1e-3);
}

@Ignore("See MATH-1552")@Test
public void testAckley() {
doTest(TestFunction.ACKLEY.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
7900,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0d),
1e-11);
}

@Ignore("See MATH-1552")@Test
public void testRastrigin() {
doTest(TestFunction.RASTRIGIN.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 2e-1),
GoalType.MINIMIZE,
4600,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0d),
1e-6);
}

/**
* @param func Function to optimize.
* @param startPoint Starting point.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,38 +204,6 @@ public void testFourExtremaMaximize2() {
1e-6);
}

@Test
public void testRosenbrock() {
final int dim = 2;
doTest(TestFunction.ROSENBROCK.withDimension(dim),
OptimTestUtils.point(new double[] { -1.2, 1 }, 1e-1),
GoalType.MINIMIZE,
180,
new PointValuePair(OptimTestUtils.point(dim, 1.0), 0.0),
1e-4);
}

@Test
public void testPowell() {
final int dim = 4;
doTest(TestFunction.POWELL.withDimension(dim),
OptimTestUtils.point(new double[] { 3, -1, 0, 1 }, 1e-1),
GoalType.MINIMIZE,
420,
new PointValuePair(OptimTestUtils.point(dim, 0.0), 0.0),
2e-4);
}

@Ignore("See MATH-1552")@Test
public void testEllipse() {
doTest(TestFunction.ELLI.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 2e-1),
GoalType.MINIMIZE,
15000,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-6);
}

@Ignore("See MATH-1552")@Test
public void testElliRotated() {
doTest(new OptimTestUtils.ElliRotated(),
Expand All @@ -246,97 +214,6 @@ public void testElliRotated() {
1e-14);
}

@Test
public void testCigar() {
doTest(TestFunction.CIGAR.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 2e-1),
GoalType.MINIMIZE,
7000,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-6);
}

@Ignore("See MATH-1552")@Test
public void testTwoAxes() {
doTest(TestFunction.TWO_AXES.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
3451,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-14);
}

@Ignore("See MATH-1552")@Test
public void testCigTab() {
doTest(TestFunction.CIG_TAB.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
7000,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-4);
}

@Test
public void testSphere() {
doTest(TestFunction.SPHERE.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
3000,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-6);
}

@Ignore("See MATH-1552")@Test
public void testTablet() {
doTest(TestFunction.TABLET.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 1e-1),
GoalType.MINIMIZE,
10000,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-14);
}

@Ignore("See MATH-1552")@Test
public void testDiffPow() {
doTest(TestFunction.DIFF_POW.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 2e-1),
GoalType.MINIMIZE,
7000,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-6);
}

@Test
public void testSsDiffPow() {
final int dim = DIM / 2;
doTest(TestFunction.SS_DIFF_POW.withDimension(dim),
OptimTestUtils.point(dim, 1.0, 2e-1),
GoalType.MINIMIZE,
4000,
new PointValuePair(OptimTestUtils.point(dim, 0.0), 0.0),
1e-3);
}

@Ignore("See MATH-1552")@Test
public void testAckley() {
doTest(TestFunction.ACKLEY.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 2e-1),
GoalType.MINIMIZE,
7900,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
1e-11);
}

@Ignore("See MATH-1552")@Test
public void testRastrigin() {
doTest(TestFunction.RASTRIGIN.withDimension(DIM),
OptimTestUtils.point(DIM, 1.0, 2e-1),
GoalType.MINIMIZE,
4600,
new PointValuePair(OptimTestUtils.point(DIM, 0.0), 0.0),
0);
}

/**
* @param func Function to optimize.
* @param startPoint Starting point.
Expand Down

0 comments on commit 858ecda

Please sign in to comment.