Skip to content
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

Merged
merged 11 commits into from
Feb 13, 2022

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Feb 12, 2022

On top of #3327.

Related to #2966.

@pleroy pleroy mentioned this pull request Feb 12, 2022
// <matrix> rotation;
// <vector> eigenvalues;
// };
// Note that in the |rotation| field the eigenvectors appear in column. They
Copy link
Member

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 […]

template<typename V, typename U>
struct ᵗRDRDecompositionGenerator;

// Declares:
// using Result = <vector>;
Copy link
Member

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,
Copy link
Member

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{};
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostMultiply, or just operator*=.

@eggrobin eggrobin added the LGTM label Feb 13, 2022
@pleroy pleroy merged commit f8458e9 into mockingbirdnest:master Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants