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

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

Subtract two matrices (in-place).

Definition at line 1340 of file FloatMatrix.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.0f, other, result);
        } else if (result == other) {
            SimpleBlas.scal(-1.0f, result);
            SimpleBlas.axpy(1.0f, this, result);
        } else {
            SimpleBlas.copy(this, result);
            SimpleBlas.axpy(-1.0f, other, result);
        }
        return result;
    }


Generated by  Doxygen 1.6.0   Back to index