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

Method eval

src/com/winvector/opt/impl/SFun.java:54–71  ·  view source on GitHub ↗
(final double s)

Source from the content-addressed store, hash-verified

52 }
53
54 @Override
55 public double eval(final double s) {
56 VEval fx = cache.get(s);
57 if(null==fx) {
58 final double[] newX = newX(x0,dir,s,boxBound);
59 fx = f.eval(newX,false,false);
60 if((!Double.isInfinite(fx.fx))&&(!Double.isNaN(fx.fx))) {
61 if((min==null)||(fx.fx<min.fx)) {
62 min = fx;
63 }
64 if((max==null)||(fx.fx>max.fx)) {
65 max = fx;
66 }
67 }
68 cache.put(s,fx);
69 }
70 return fx.fx;
71 }
72
73 static double[] newX(final double[] oldX, final double[] delta, final double scale, final double boxBound) {
74 final int dim = oldX.length;

Callers

nothing calls this directly

Calls 3

newXMethod · 0.95
evalMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected