MCPcopy Create free account
hub / github.com/WinVector/Logistic / LinFun

Class LinFun

test/com/winvector/opt/imp/TestOpt.java:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14public class TestOpt extends TestCase {
15
16 private static final class LinFun implements ScalarFn {
17 public final double sign;
18 public final double x0;
19
20 public LinFun(final double x0, final double sign) {
21 this.sign = sign;
22 this.x0 = x0;
23 }
24
25 @Override
26 public double eval(final double x) {
27 final double diff = x - x0;
28 return sign*diff*diff;
29 }
30 }
31
32 public void testLinMax() {
33 final LinFun f = new LinFun(3.2,-1.0);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected