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

Method VEval

src/com/winvector/opt/def/VEval.java:15–32  ·  view source on GitHub ↗
(final double[] x, final boolean wantGrad, final boolean wantHessian)

Source from the content-addressed store, hash-verified

13 public double[][] hx;
14
15 public VEval(final double[] x, final boolean wantGrad, final boolean wantHessian) {
16 final int dim = x.length;
17 this.x = new double[dim];
18 fx = 0.0;
19 if(wantGrad) {
20 gx = new double[dim];
21 } else {
22 gx = null;
23 }
24 if(wantHessian) {
25 hx = new double[dim][dim];
26 } else {
27 hx = null;
28 }
29 for(int i=0;i<dim;++i) {
30 this.x[i] = x[i];
31 }
32 }
33
34 protected VEval() {
35 x = null;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected