Closed spensonshih closed 1 year ago
thanks for the PR. Will probably end up shuffling around its location the another class, but that can be done later on.
Inside of main/ejml-dsparse/src/org/ejml/sparse/csc/mult there are several examples for JMH and you could put it in a new class there.
I think adding a concurrent implementation should be straight forward. That can be done in another PR.
Ignore comment about unit tests. I missed the ones you added.
Thanks for the prompt feedback @lessthanoptimal. I've added the JMH benchmarks.
almost there
Can you squash it into a single commit? When I have a break from this conference I'll do a local checkout then hopefully approve it. As a warning, after this gets merged I'm going to create a PR which does some refactoring. Mostly move the location of files. It would take longer to explain where everything should go than to do it.
@lessthanoptimal Apologies for the delay, I had some hardware troubles yesterday. I've now squashed into a single commit.
looks like a spotless issue snuck in. ./gradlew :main:spotlessApply
squash again, then I'll merge it.
Fixed the spotless issue and squashed.
PR for #180
The new version of
innerProduct
will be specialised to take in sparse vectors for A and C, and a matrix B.scalar = AT^ B C
By looping through only non-zero elements of the vectors, avoids a lot of unnecessary operations and have a significant performance improvement when used with sparse vectors.
And
innerProductSelfSymmetrical
, specialised to take in sparse vector A, and a positive semi-definite covariance matrix B.scalar = AT B A
Further enhances the innerProduct, utilising the matrix symmetry, it will calculate the product using just the lower (or upper) triangle, multiply this by 2, then add to the product of the matrix diagonal.
Before submitting this PR, please make sure:
./gradlew spotlessJavaApply