/** {@inheritDoc} */ @Override public int getRowDimension() { return diag.getDimension(); }
/** {@inheritDoc} */ @Override public int getColumnDimension() { return diag.getDimension(); }
/** * Construct a vector by appending one vector to another vector. * @param v1 First vector (will be put in front of the new vector). * @param v2 Second vector (will be put at back of the new vector). */ public ArrayRealVector(ArrayRealVector v1, double[] v2) { final int l1 = v1.getDimension(); final int l2 = v2.length; data = new double[l1 + l2]; System.arraycopy(v1.data, 0, data, 0, l1); System.arraycopy(v2, 0, data, l1, l2); }
/** * Construct a vector by appending one vector to another vector. * @param v1 First vector (will be put in front of the new vector). * @param v2 Second vector (will be put at back of the new vector). */ public ArrayRealVector(double[] v1, ArrayRealVector v2) { final int l1 = v1.length; final int l2 = v2.getDimension(); data = new double[l1 + l2]; System.arraycopy(v1, 0, data, 0, l1); System.arraycopy(v2.data, 0, data, l1, l2); }
/** {@inheritDoc} */ @Override public double getEntry(int index) throws OutOfRangeException { try { return data[index]; } catch (IndexOutOfBoundsException e) { throw new OutOfRangeException(LocalizedFormats.INDEX, index, 0, getDimension() - 1); } }
@Override public int getCount() { return values.getDimension(); }
/** * Get the rth threshold. * * @param thresholdIndex The index of the threshold * @return the rth threshold. */ public double getThreshold(int thresholdIndex) { double tr = t1; if(thresholdIndex < 0) { return Double.NEGATIVE_INFINITY; } else if(thresholdIndex == 0){ return tr; } else if(thresholdIndex > beta.getDimension()) { return Double.POSITIVE_INFINITY; } else { for(int k = 0; k < thresholdIndex; k++) { tr += Math.exp(beta.getEntry(k)); } return tr; } }
@Override public int index(double val) { final int n = values.getDimension(); assert n > 0; int closest = -1; double closev = Double.MAX_VALUE; for (int i = 0; i < n; i++) { double diff = Math.abs(val - values.getEntry(i)); if (diff <= closev) { // <= to round up closev = diff; closest = i; } } if (closest < 0) { throw new IllegalArgumentException("could not quantize value"); } else { return closest; } }
final int n = currentBest.getDimension();
final int n = currentBest.getDimension();
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints; final int nptm = npt - n - 1;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints; final int nptm = npt - n - 1;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints; final int ndim = bMatrix.getRowDimension();
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints; final int ndim = bMatrix.getRowDimension();
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints; final int np = n + 1;
final int n = currentBest.getDimension(); final int npt = numberOfInterpolationPoints; final int np = n + 1;