EMS-TU-Ilmenau / fastmat

A library to build up lazily evaluated expressions of linear transforms for efficient scientific computing.
https://fastmat.readthedocs.io
Apache License 2.0
24 stars 8 forks source link

Extension and Renaming of largestSV and largestEV #43

Closed SebastianSemper closed 5 years ago

SebastianSemper commented 5 years ago
  1. We should rename the existing properties to largest{Singular,Eigen}Value, since {S,E}V could mean bot singular vector or singular value.

  2. We also calculate the {singular,eigen} vectors and cache these like we do with the values already. This poses no additional computational overhead, since during the calculations of the {singular,eigen} values, these vectors are generated anyway.

ChristophWWagner commented 5 years ago

good point. Remember to also update the demos. There might be some reference in there as well

about the 2nd point: one nice thing about the current implementation is: (if it converges) it let's you get away with what you need (the largest value) even if the matrix is huge. If you automatically store the vectors this might get a bit large in memory so this definately must be an option at max.

SebastianSemper commented 5 years ago

How about the following:

If the user accesses largest{Singular,Eigen}Value, we do not cache the associated vectors. If on the other hand, the user accesses largest{Singular,Eigen}Vector, we automatically cache the corresponding {singular,eigen} value.

In case the user first accessed largest{Singular, Eigen}Value and then also wants to access the vectors, we can start the iterations by warmstarting them with the already cached {singular,eigen} values, thus speeding things up tremendously. Of course, we then cache the calculated vectors.

SebastianSemper commented 5 years ago

Resolved and implemented by #60