Logo Search packages:      
Sourcecode: jblas version File versions  Download package

DoubleMatrix org::jblas::la::DoubleMatrix::subi ( DoubleMatrix  other,
DoubleMatrix  result 
) [inline]

Subtract two matrices (in-place).

Definition at line 1340 of file DoubleMatrix.java.

References assertSameLength(), ensureResultLength(), isScalar(), rsubi(), and scalar().

Referenced by org::jblas::la::Geometry::center(), rsubi(), sub(), and subi().

                                                                      {
        if (other.isScalar()) {
            return subi(other.scalar(), result);
        }
        if (isScalar()) {
            return other.rsubi(scalar(), result);
        }

        assertSameLength(other);
        ensureResultLength(other, result);

        if (result == this) {
            SimpleBlas.axpy(-1.0, other, result);
        } else if (result == other) {
            SimpleBlas.scal(-1.0, result);
            SimpleBlas.axpy(1.0, this, result);
        } else {
            SimpleBlas.copy(this, result);
            SimpleBlas.axpy(-1.0, other, result);
        }
        return result;
    }


Generated by  Doxygen 1.6.0   Back to index