@Override public void add(int aTimes, Vector aVector) { vector.add(aTimes, aVector); }
@Override public void increment( final int index, final double value) { this.internalVector.add(index, value); }
@Override public void add(int aTimes, Vector aVector) { vector.add(aTimes, aVector); }
@Override public void add(int aTimes, Vector aVector) { vector.add(aTimes, aVector); }
/** * Inline addition of this and the other vector * * @param other * Vector to which to add the elements of this, must be the * same dimension as this */ public void plusEquals( final AbstractMTJVector other ) { this.internalVector.add( other.internalVector ); }
/** * Inline addition of this and the other vector * * @param other * Vector to which to add the elements of this, must be the * same dimension as this */ public void plusEquals( final AbstractMTJVector other ) { this.internalVector.add( other.internalVector ); }
/** * Inline addition of this and the other vector * * @param other * Vector to which to add the elements of this, must be the * same dimension as this */ public void plusEquals( final AbstractMTJVector other ) { this.internalVector.add( other.internalVector ); }
@Override public double add(int aParamInt, double aParamDouble) { wrapped.add(aParamInt, aParamDouble); return wrapped.get(aParamInt); }
@Override public Vector multAdd(double alpha, Vector x, Vector y) { checkMultAdd(x, y); for (int i = 0; i < numRows; ++i) y.add(i, alpha * rowD[i].dot(x)); return y; }
@Override public Vector multAdd(double alpha, Vector x, Vector y) { checkMultAdd(x, y); if (alpha == 0) return y; Node node = links.head; while (node != null) { y.add(node.row, alpha * node.val * x.get(node.col)); node = node.rowTail; } return y; }
@Override public Vector transMultAdd(final double alpha, final Vector x, final Vector y) { checkTransMultAdd(x, y); for (int i = 0; i < numColumns; ++i) y.add(i, alpha * colD[i].dot(x)); return y; }
@Override public Vector multAdd(double alpha, Vector x, Vector y) { checkMultAdd(x, y); if (alpha == 0) return y; Node node = links.head; while (node != null) { y.add(node.row, alpha * node.val * x.get(node.col)); node = node.rowTail; } return y; }
@Override public Vector transMultAdd(double alpha, Vector x, Vector y) { checkTransMultAdd(x, y); if (alpha == 0) return y; Node node = links.head; while (node != null) { y.add(node.col, alpha * node.val * x.get(node.row)); node = node.colTail; } return y; }
/** * Returns the log of the density value for the given vector. * * @param valuePassed input vector * @return log density based on given distribution */ @Override public double logDensity(double[] valuePassed) { // calculate mean subtractions Vector x = new DenseVector(valuePassed); return lnconstant - 0.5 * x.dot(covarianceInverse.mult(x.add(-1.0, mean), new DenseVector(x.size()))); }
public Vector multAdd(double alpha, Vector x, Vector y) { checkMultAdd(x, y); if (alpha != 0) for (MatrixEntry e : this) y.add(e.row(), alpha * e.get() * x.get(e.column())); return y; }
public Vector multAdd(double alpha, Vector x, Vector y) { checkMultAdd(x, y); if (alpha != 0) for (MatrixEntry e : this) y.add(e.row(), alpha * e.get() * x.get(e.column())); return y; }
public Vector transMultAdd(double alpha, Vector x, Vector y) { checkTransMultAdd(x, y); if (alpha != 0) for (MatrixEntry e : this) y.add(e.column(), alpha * e.get() * x.get(e.row())); return y; }
public Vector transMultAdd(double alpha, Vector x, Vector y) { checkTransMultAdd(x, y); if (alpha != 0) for (MatrixEntry e : this) y.add(e.column(), alpha * e.get() * x.get(e.row())); return y; }
public Vector solve(Matrix A, Vector b, Vector x) throws IterativeSolverNotConvergedException { checkSizes(A, b, x); A.multAdd(-1, x, r.set(b)); for (iter.setFirst(); !iter.converged(r, x); iter.next()) { M.apply(r, z); x.add(z); A.multAdd(-1, x, r.set(b)); } return x; }
public Vector solve(Matrix A, Vector b, Vector x) throws IterativeSolverNotConvergedException { checkSizes(A, b, x); A.multAdd(-1, x, r.set(b)); for (iter.setFirst(); !iter.converged(r, x); iter.next()) { M.apply(r, z); x.add(z); A.multAdd(-1, x, r.set(b)); } return x; }