nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java
@Override
    public IComplexNDArray mmuli(INDArray other, INDArray result) {


        IComplexNDArray otherArray = (IComplexNDArray) other;
        IComplexNDArray resultArray = (IComplexNDArray) result;

        if (other.shape().length > 2) {
            for (int i = 0; i < other.slices(); i++) {
                resultArray.putSlice(i, slice(i).mmul(otherArray.slice(i)));
            }

            return resultArray;

        }


        LinAlgExceptions.assertMultiplies(this, other);

        if (other.isScalar()) {
            return muli(otherArray.getComplex(0), resultArray);
        }
        if (isScalar()) {
            return otherArray.muli(getComplex(0), resultArray);
        }

        /* check sizes and resize if necessary */
        //assertMultipliesWith(other);


        if (result == this || result == other) {
            /* actually, blas cannot do multiplications in-place. Therefore, we will fake by
             * allocating a temporary object on the side and copy the result later.
             */
            IComplexNDArray temp = Nd4j.createComplex(resultArray.shape());

            if (otherArray.columns() == 1) {
                Nd4j.getBlasWrapper().level2().gemv(BlasBufferUtil.getCharForTranspose(temp),
                                BlasBufferUtil.getCharForTranspose(this), Nd4j.UNIT, this, otherArray, Nd4j.ZERO, temp);
            } else {
                Nd4j.getBlasWrapper().level3().gemm(BlasBufferUtil.getCharForTranspose(temp),
                                BlasBufferUtil.getCharForTranspose(this), BlasBufferUtil.getCharForTranspose(other),
                                Nd4j.UNIT, this, otherArray, Nd4j.ZERO, temp);

            }

            Nd4j.getBlasWrapper().copy(temp, resultArray);


        } else {
            if (otherArray.columns() == 1) {
                Nd4j.getBlasWrapper().level2().gemv(BlasBufferUtil.getCharForTranspose(resultArray),
                                BlasBufferUtil.getCharForTranspose(this), Nd4j.UNIT, this, otherArray, Nd4j.ZERO,
                                resultArray);
            }


            else {
                Nd4j.getBlasWrapper().level3().gemm(BlasBufferUtil.getCharForTranspose(resultArray),
                                BlasBufferUtil.getCharForTranspose(this), BlasBufferUtil.getCharForTranspose(other),
                                Nd4j.UNIT, this, otherArray, Nd4j.ZERO, resultArray);
            }
        }
        return resultArray;


    }
@Override
    public IComplexNDArray mmuli(INDArray other, INDArray result) {


        IComplexNDArray otherArray = (IComplexNDArray) other;
        IComplexNDArray resultArray = (IComplexNDArray) result;

        if (other.shape().length > 2) {
            for (int i = 0; i < other.slices(); i++) {
                resultArray.putSlice(i, slice(i).mmul(otherArray.slice(i)));
            }

            return resultArray;

        }


        LinAlgExceptions.assertMultiplies(this, other);

        if (other.isScalar()) {
            return muli(otherArray.getComplex(0), resultArray);
        }
        if (isScalar()) {
            return otherArray.muli(getComplex(0), resultArray);
        }

        /* check sizes and resize if necessary */
        //assertMultipliesWith(other);


        if (result == this || result == other) {
            /* actually, blas cannot do multiplications in-place. Therefore, we will fake by
             * allocating a temporary object on the side and copy the result later.
             */
            IComplexNDArray temp = Nd4j.createComplex(resultArray.shape());

            if (otherArray.columns() == 1) {
                Nd4j.getBlasWrapper().level2().gemv(BlasBufferUtil.getCharForTranspose(temp),
                                BlasBufferUtil.getCharForTranspose(this), Nd4j.UNIT, this, otherArray, Nd4j.ZERO, temp);
            } else {
                Nd4j.getBlasWrapper().level3().gemm(BlasBufferUtil.getCharForTranspose(temp),
                                BlasBufferUtil.getCharForTranspose(this), BlasBufferUtil.getCharForTranspose(other),
                                Nd4j.UNIT, this, otherArray, Nd4j.ZERO, temp);

            }

            Nd4j.getBlasWrapper().copy(temp, resultArray);


        } else {
            if (otherArray.columns() == 1) {
                Nd4j.getBlasWrapper().level2().gemv(BlasBufferUtil.getCharForTranspose(resultArray),
                                BlasBufferUtil.getCharForTranspose(this), Nd4j.UNIT, this, otherArray, Nd4j.ZERO,
                                resultArray);
            }


            else {
                Nd4j.getBlasWrapper().level3().gemm(BlasBufferUtil.getCharForTranspose(resultArray),
                                BlasBufferUtil.getCharForTranspose(this), BlasBufferUtil.getCharForTranspose(other),
                                Nd4j.UNIT, this, otherArray, Nd4j.ZERO, resultArray);
            }
        }
        return resultArray;


    }
@ Override public IComplexNDArray mmuli ( INDArray other , INDArray result ) { IComplexNDArray otherArray = ( IComplexNDArray ) other ; IComplexNDArray resultArray = ( IComplexNDArray ) result ; if ( other . shape ( ) . length > 2 ) { for ( int i = 0 ; i < other . slices ( ) ; i ++ ) { resultArray . putSlice ( i , slice ( i ) . mmul ( otherArray . slice ( i ) ) ) ; } return resultArray ; } LinAlgExceptions . assertMultiplies ( this , other ) ; if ( other . isScalar ( ) ) { return muli ( otherArray . getComplex ( 0 ) , resultArray ) ; } if ( isScalar ( ) ) { return otherArray . muli ( getComplex ( 0 ) , resultArray ) ; } /* check sizes and resize if necessary */ //assertMultipliesWith(other); if ( result == this || result == other ) { /* actually, blas cannot do multiplications in-place. Therefore, we will fake by
             * allocating a temporary object on the side and copy the result later.
             */ IComplexNDArray temp = Nd4j . createComplex ( resultArray . shape ( ) ) ; if ( otherArray . columns ( ) == 1 ) { Nd4j . getBlasWrapper ( ) . level2 ( ) . gemv ( BlasBufferUtil . getCharForTranspose ( temp ) , BlasBufferUtil . getCharForTranspose ( this ) , Nd4j . UNIT , this , otherArray , Nd4j . ZERO , temp ) ; } else { Nd4j . getBlasWrapper ( ) . level3 ( ) . gemm ( BlasBufferUtil . getCharForTranspose ( temp ) , BlasBufferUtil . getCharForTranspose ( this ) , BlasBufferUtil . getCharForTranspose ( other ) , Nd4j . UNIT , this , otherArray , Nd4j . ZERO , temp ) ; } Nd4j . getBlasWrapper ( ) . copy ( temp , resultArray ) ; } else { if ( otherArray . columns ( ) == 1 ) { Nd4j . getBlasWrapper ( ) . level2 ( ) . gemv ( BlasBufferUtil . getCharForTranspose ( resultArray ) , BlasBufferUtil . getCharForTranspose ( this ) , Nd4j . UNIT , this , otherArray , Nd4j . ZERO , resultArray ) ; } else { Nd4j . getBlasWrapper ( ) . level3 ( ) . gemm ( BlasBufferUtil . getCharForTranspose ( resultArray ) , BlasBufferUtil . getCharForTranspose ( this ) , BlasBufferUtil . getCharForTranspose ( other ) , Nd4j . UNIT , this , otherArray , Nd4j . ZERO , resultArray ) ; } } return resultArray ; }
Perform an copy matrix multiplication

@param other  the other matrix to perform matrix multiply with
@param result the result ndarray
@return the result of the matrix multiplication
Perform an copy matrix multiplication