MCPcopy Index your code
hub / github.com/WinVector/Logistic / ObsHolder

Class ObsHolder

src/com/winvector/opt/impl/DataFn.java:16–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 private final LinearContribution<T> underlying;
15
16 private final class ObsHolder implements ReducibleObserver<T,ObsHolder> {
17 private final VEval r;
18 private final double[] pscratch = new double[underlying.noutcomes()];
19
20 public ObsHolder(final double[] x, final boolean wantGrad, final boolean wantHessian) {
21 r = new VEval(x,wantGrad,wantHessian);
22 }
23
24 @Override
25 public void observe(final T t) {
26 underlying.addTerm(r.x,r.gx!=null,r.hx!=null,t,r,pscratch);
27 }
28
29 @Override
30 public void observe(final ObsHolder o) {
31 r.add(o.r);
32 }
33
34 @Override
35 public ObsHolder newObserver() {
36 return new ObsHolder(r.x,r.gx!=null,r.hx!=null);
37 }
38
39 }
40
41
42

Callers

nothing calls this directly

Calls 1

noutcomesMethod · 0.65

Tested by

no test coverage detected