Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public DMatrix subi(DMatrix other) {
   assert (this.length() == other.length());
   SimpleCuBlas.axpy(-1.0, other, this);
   return this;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 // y = a*X+b
 public DMatrix addi(double a, DMatrix other) {
   SimpleCuBlas.axpy(a, other, this);
   return this;
 }
Ejemplo n.º 5
0
 // 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;
 }