public DMatrix sub(DMatrix other) { assert this.length() == other.length() : System.out.printf("Length is not equal. %d - %d\n", this.length(), other.length()); DMatrix m = new CUDAMatrix(this.rows(), this.columns(), this.toArray()); SimpleCuBlas.axpy(-1.0, other, m); return m; }
public DMatrix subi(DMatrix other) { assert (this.length() == other.length()); SimpleCuBlas.axpy(-1.0, other, this); return this; }
public DMatrix addi(DMatrix other) { assert (this.length() == other.length()); // System.out.printf("Using cuda blas\n"); SimpleCuBlas.axpy(1.0, other, this); return this; }
// y = a*X+b public DMatrix addi(double a, DMatrix other) { SimpleCuBlas.axpy(a, other, this); return this; }
// y = 1*x+y public DMatrix add(DMatrix other) { assert (this.length() == other.length()); DMatrix m = new CUDAMatrix(this.rows, this.columns, this.data()); SimpleCuBlas.axpy(1.0, other, m); return m; }