/** * Computes the graident of the penalized log likelihood * of the ACRF, and returns it in buf[]. */ public void getValueGradient(double[] buf) { if (cachedGradientStale) { /* This will fill in the expectations */ if (cachedValueStale) getValue (); computeGradient (); cachedGradientStale = false; } if (buf.length != numParameters) throw new IllegalArgumentException ("Incorrect length buffer to getValueGradient(). Expected " + numParameters + ", received " + buf.length); System.arraycopy (cachedGradient, 0, buf, 0, cachedGradient.length); }
/** * Computes the graident of the penalized log likelihood * of the ACRF, and returns it in buf[]. */ public void getValueGradient(double[] buf) { if (cachedGradientStale) { /* This will fill in the expectations */ if (cachedValueStale) getValue (); computeGradient (); cachedGradientStale = false; } if (buf.length != numParameters) throw new IllegalArgumentException ("Incorrect length buffer to getValueGradient(). Expected " + numParameters + ", received " + buf.length); System.arraycopy (cachedGradient, 0, buf, 0, cachedGradient.length); }
/** * Computes the graident of the penalized log likelihood * of the ACRF, and returns it in buf[]. */ public void getValueGradient(double[] buf) { if (cachedGradientStale) { /* This will fill in the expectations */ if (cachedValueStale) getValue (); computeGradient (); cachedGradientStale = false; } if (buf.length != numParameters) throw new IllegalArgumentException ("Incorrect length buffer to getValueGradient(). Expected " + numParameters + ", received " + buf.length); System.arraycopy (cachedGradient, 0, buf, 0, cachedGradient.length); }