@Override public void set(int aParamInt, double aParamDouble) { wrapped.set(aParamInt, aParamDouble); }
@Override public void setElement( int index, double value) { this.internalVector.set( index, value ); }
@Override public void setElement( int index, double value) { this.internalVector.set( index, value ); }
@Override public void set( final int index, final double value) { this.internalVector.set(index, value); }
@Override public void set( final int index, final double value) { this.internalVector.set(index, value); }
@Override public void set( final int index, final double value) { this.internalVector.set(index, value); }
@Override public void set(int aParamInt, Number aParamNumber) { wrapped.set(aParamInt, aParamNumber.doubleValue()); }
/** * Populates a vector with random numbers drawn from a uniform distribution * between 0 and 1 * * @param x * Vector to populate */ public static Vector random(Vector x) { for (int i = 0; i < x.size(); ++i) x.set(i, Math.random()); return x; }
/** * Populates a vector with random numbers drawn from a uniform distribution * between 0 and 1 * * @param x * Vector to populate */ public static Vector random(Vector x) { for (int i = 0; i < x.size(); ++i) x.set(i, Math.random()); return x; }
protected Vector initScoreVector(int tokenSize) { Vector scoreVector = new DenseVector(tokenSize); double initValue = 1.0; for (int i = 0; i < scoreVector.size(); i++) { scoreVector.set(i, initValue); } return scoreVector; }
public Vector transApply(Vector b, Vector x) { u[0].set(x); f[0].set(b); transpose = true; cycle(0); return x.set(u[0]); }
public Vector apply(Vector b, Vector x) { u[0].set(x); f[0].set(b); transpose = false; cycle(0); return x.set(u[0]); }
public Vector transApply(Vector b, Vector x) { u[0].set(x); f[0].set(b); transpose = true; cycle(0); return x.set(u[0]); }
public Vector apply(Vector b, Vector x) { u[0].set(x); f[0].set(b); transpose = false; cycle(0); return x.set(u[0]); }
protected Vector getDegreeVector(int tokenSize, FlexCompColMatrix adjacentMatrix) { Vector degreeVector = new DenseVector(tokenSize); for (int i = 0; i < adjacentMatrix.numColumns(); i++) { SparseVector col = adjacentMatrix.getColumn(i); double sum = 0; for (VectorEntry entry : col) { sum += entry.get(); } degreeVector.set(i, sum); } return degreeVector; }
@Override public Vector transMult(double alpha, Vector x, Vector y) { if (!(y instanceof DenseVector)) return super.transMult(alpha, x, y); checkTransMultAdd(x, y); double[] yd = ((DenseVector) y).getData(); // y = alpha*x y.set(alpha, x); // y = A'*y BLAS.getInstance().dtrmv(uplo.netlib(), Transpose.Transpose.netlib(), diag.netlib(), numRows, data, Math.max(1, ld), yd, 1); return y; }
@Override public Vector mult(double alpha, Vector x, Vector y) { if (!(y instanceof DenseVector)) return super.mult(alpha, x, y); checkMultAdd(x, y); double[] yd = ((DenseVector) y).getData(); // y = alpha*x y.set(alpha, x); // y = A*z BLAS.getInstance().dtrmv(uplo.netlib(), Transpose.NoTranspose.netlib(), diag.netlib(), numRows, data, Math.max(1, ld), yd, 1); return y; }
@Override public Vector transMult(double alpha, Vector x, Vector y) { if (!(y instanceof DenseVector)) return super.transMult(alpha, x, y); checkTransMultAdd(x, y); double[] yd = ((DenseVector) y).getData(); // y = alpha*x y.set(alpha, x); // y = A*y BLAS.getInstance().dtbmv(uplo.netlib(), Transpose.Transpose.netlib(), diag.netlib(), numRows, kd, data, kd + 1, yd, 1); return y; }