@ Override public IComplexNDArray addi ( INDArray other , INDArray result ) { IComplexNDArray cOther = ( IComplexNDArray ) other ; IComplexNDArray cResult = ( IComplexNDArray ) result ; if ( cOther . isScalar ( ) ) { return cResult . addi ( cOther . getComplex ( 0 ) , result ) ; } if ( isScalar ( ) ) { return cOther . addi ( getComplex ( 0 ) , result ) ; } if ( result == this ) { Nd4j . getBlasWrapper ( ) . axpy ( Nd4j . UNIT , cOther , cResult ) ; } else if ( result == other ) { Nd4j . getBlasWrapper ( ) . axpy ( Nd4j . UNIT , this , cResult ) ; } else { INDArray resultLinear = result . linearView ( ) ; INDArray otherLinear = other . linearView ( ) ; INDArray linear = linearView ( ) ; for ( int i = 0 ; i < resultLinear . length ( ) ; i ++ ) { resultLinear . putScalar ( i , otherLinear . getDouble ( i ) + linear . getDouble ( i ) ) ; } } return ( IComplexNDArray ) result ; }
in place addition of two matrices