nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java
@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;
    }
@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

@param other  the second ndarray to add
@param result the result ndarray
@return the result of the addition