lessthanoptimal / ejml

A fast and easy to use linear algebra library written in Java for dense, sparse, real, and complex matrices.
https://ejml.org
561 stars 117 forks source link

Wrong multInner implementation chosen by matrix size condition #58

Open rekobo opened 5 years ago

rekobo commented 5 years ago

Hi, there is a flipped condition in CommonOps_DDRM.multInner, which results in a less than optimal (sorry:) ) algorithm being picked.

`

    if( a.numCols >= EjmlParameters.MULT_INNER_SWITCH ) {
        MatrixMultProduct_DDRM.inner_small(a, c);
    } else {
        MatrixMultProduct_DDRM.inner_reorder(a, c);
    }

`

There's the same thing in FDRM as well.

lessthanoptimal commented 5 years ago

I think you're right, but I want to double check with a performance benchmark to make sure.