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

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

Add two matrices (in-place).

Definition at line 1305 of file DoubleMatrix.java.

References addi(), assertSameLength(), data, ensureResultLength(), isScalar(), length, and scalar().

Referenced by add(), and addi().

        if (other.isScalar()) {
            return addi(other.scalar(), result);
        if (isScalar()) {
            return other.addi(scalar(), result);

        ensureResultLength(other, result);

        if (result == this) {
            SimpleBlas.axpy(1.0, other, result);
        } else if (result == other) {
            SimpleBlas.axpy(1.0, this, result);
        } else {
            /*SimpleBlas.copy(this, result);
            SimpleBlas.axpy(1.0, other, result);*/
            JavaBlas.rzgxpy(length, result.data, data, other.data);

        return result;

Generated by  Doxygen 1.6.0   Back to index