JacobiSVD: get rid of m_scaledMatrix, m_adjoint, hopefully fix some compiler warnings

Reference issue

What does this implement/fix?

m_scaledMatrix served no purpose. It is not used at all when rows == cols. Even when rows != cols, it is not used when there is no preconditioner. Even then, it is immediately copied into the preconditioner. We can avoid all these pointless scenarios by passing matrix/scale as an expression into the preconditioner object and handling it if/when it is needed.

Similarly with m_adjoint. Since the constructor of m_qr copies the entire input matrix, this serves no purpose -- and costs a lot of memory!

Finally, we should initialize the runtime computation options with their compile time counterparts. Currently, we initialize m_computeFullU to false, and then assign it to its compile time value. I think this may prevent some compiler optimizations.

There are many easy improvements like this in the SVD module. Hopefully breaking it down into small chunks can make it more manageable.

Additional information

Edited by Charles Schlosser

Merge request reports

Loading