/** * copy subtraction of two matrices * * @param other the second ndarray to subtract * @param result the result ndarray * @return the result of the subtraction */ @Override public INDArray sub(INDArray other, INDArray result) { return subi(other, result); }
/** * in place subtraction of two matrices * * @param other the second ndarray to subtract * @return the result of the addition */ @Override public INDArray subi(INDArray other) { return subi(other, this); }
@Override public INDArray subi(Number n) { return subi(n, this); }
@Override public INDArray sub(Number n, INDArray result) { return subi(n, result); }
/** * copy subtraction of two matrices * * @param other the second ndarray to subtract * @return the result of the addition */ @Override public INDArray sub(INDArray other) { return subi(other, Nd4j.createUninitialized(other.shape(), other.ordering())); }
@Override public INDArray sub(Number n) { //return dup().subi(n); return subi(n, Nd4j.createUninitialized(this.shape(), this.ordering())); }
/** * in place subtraction of two matrices * * @param other the second ndarray to subtract * @param result the result ndarray * @return the result of the subtraction */ @Override public INDArray subi(INDArray other, INDArray result) { if (other.isScalar()) { return subi(other.getDouble(0), result); } if (isScalar()) { return other.rsubi(getDouble(0), result); } if(!Shape.shapeEquals(this.shape(),other.shape())) { int[] broadcastDimensions = Shape.getBroadcastDimensions(this.shape(),other.shape()); Nd4j.getExecutioner().exec(new BroadcastSubOp(this,other,result,broadcastDimensions),broadcastDimensions); return result; } LinAlgExceptions.assertSameShape(other, result); Nd4j.getExecutioner().exec(new OldSubOp(this, other,result)); if (Nd4j.ENFORCE_NUMERICAL_STABILITY) Nd4j.clearNans(result); return result; }
/** * copy subtraction of two matrices * * @param other the second ndarray to subtract * @param result the result ndarray * @return the result of the subtraction */ @Override public INDArray sub(INDArray other, INDArray result) { return subi(other, result); }
/** * in place subtraction of two matrices * * @param other the second ndarray to subtract * @return the result of the addition */ @Override public INDArray subi(INDArray other) { return subi(other, this); }
@Override public INDArray subi(Number n) { return subi(n, this); }
@Override public INDArray sub(Number n, INDArray result) { return subi(n, result); }
@Override public IComplexNDArray subi(IComplexNumber n) { return subi(n, Nd4j.createComplex(shape())); }
@Override public INDArray sub(Number n) { //return dup().subi(n); return subi(n, Nd4j.createUninitialized(this.shape(), this.ordering())); }
/** * copy subtraction of two matrices * * @param other the second ndarray to subtract * @return the result of the addition */ @Override public INDArray sub(INDArray other) { return subi(other, Nd4j.createUninitialized(other.shape(), other.ordering())); }
/** * in place subtraction of two matrices * * @param other the second ndarray to subtract * @param result the result ndarray * @return the result of the subtraction */ @Override public INDArray subi(INDArray other, INDArray result) { if (other.isScalar()) { return subi(other.getDouble(0), result); } if (isScalar()) { return other.subi(getDouble(0), result); } LinAlgExceptions.assertSameShape(other, result); Nd4j.getExecutioner().exec(new SubOp(this, other, result, length())); if (Nd4j.ENFORCE_NUMERICAL_STABILITY) Nd4j.clearNans(result); return result; }
break; case 's': subi(columnVector); break; case 'm':