1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.hipparchus.optim.nonlinear.vector.constrained;
18
19
20 import org.junit.Assert;
21 import org.junit.Test;
22
23 public class SQPOptionTest {
24
25 @Test
26 public void testSettersDouble() {
27
28 final SQPOption option = new SQPOption();
29
30 final double expectedValue = 1.;
31 option.setB(expectedValue);
32 option.setEps(expectedValue);
33 option.setMu(expectedValue);
34 option.setRhoCons(expectedValue);
35 option.setSigmaMax(expectedValue);
36
37 final double tolerance = 0.;
38 Assert.assertEquals(expectedValue, option.getB(), tolerance);
39 Assert.assertEquals(expectedValue, option.getEps(), tolerance);
40 Assert.assertEquals(expectedValue, option.getMu(), tolerance);
41 Assert.assertEquals(expectedValue, option.getRhoCons(), tolerance);
42 Assert.assertEquals(expectedValue, option.getSigmaMax(), tolerance);
43 }
44
45 @Test
46 public void testSettersBoolean() {
47
48 final SQPOption option = new SQPOption();
49
50 final boolean expectedValue = true;
51 option.setUseFunHessian(expectedValue);
52
53 Assert.assertEquals(expectedValue, option.useFunHessian());
54 }
55
56 @Test
57 public void testSettersIntegers() {
58
59 final SQPOption option = new SQPOption();
60
61 final int expectedValue = 10;
62 option.setConvCriteria(expectedValue);
63 option.setMaxLineSearchIteration(expectedValue);
64 option.setQpMaxLoop(expectedValue);
65
66 Assert.assertEquals(expectedValue, option.getConvCriteria());
67 Assert.assertEquals(expectedValue, option.getMaxLineSearchIteration());
68 Assert.assertEquals(expectedValue, option.getQpMaxLoop());
69 }
70
71 }