-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of classical Jacobi diagonalization #3328
Conversation
numerics/matrix_computations.hpp
Outdated
// <matrix> rotation; | ||
// <vector> eigenvalues; | ||
// }; | ||
// Note that in the |rotation| field the eigenvectors appear in column. They |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s not use the word field, it sounds like we are talking about a field.
Note that in |rotation| the […]
numerics/matrix_computations.hpp
Outdated
template<typename V, typename U> | ||
struct ᵗRDRDecompositionGenerator; | ||
|
||
// Declares: | ||
// using Result = <vector>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⟨vector⟩
|
||
// See [GV13] section 8.5.2, algorithm 8.5.1. | ||
template<typename Scalar, typename Matrix> | ||
JacobiRotation SymmetricShurDecomposition2(Matrix const& A, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schur.
Also, 2By2 rather than 2, otherwise it sounds like it is the second algorithm for that decomposition, like PlotMethod2.
DCHECK_LE(0, p); | ||
DCHECK_LT(p, q); | ||
DCHECK_LT(q, A.rows()); | ||
static Scalar const zero{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexpr Scalar zero{}
, let’s not have locking to initialize a local static zero.
|
||
// A becomes ᵗJ A. | ||
template<typename Matrix> | ||
void Premultiplication(JacobiRotation const& J, Matrix& A) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PremultiplyByTranspose
|
||
// A becomes A J. | ||
template<typename Matrix> | ||
void Postmultiplication(Matrix& A, JacobiRotation const& J) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PostMultiply, or just operator*=
.
On top of #3327.
Related to #2966.