]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix thinko in Eigensystem for complex Hermitian matrices
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Apr 2025 09:45:23 +0000 (11:45 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Apr 2025 09:55:41 +0000 (11:55 +0200)
commitb65f4fe10996c247751b0636773009659d92ab6c
treeadd372ee277498d515e1c07798dff345a31db89c
parentd4d63be9e9517a6ffd01ddb6ea19e50952a79134
Ada: Fix thinko in Eigensystem for complex Hermitian matrices

The implementation solves the eigensystem for a NxN complex Hermitian matrix
by first solving it for a 2Nx2N real symmetric matrix and then interpreting
the 2Nx1 real vectors as Nx1 complex ones, but the last step does not work.

The patch fixes the last step and also performs a small cleanup throughout
the implementation, mostly in the commentary and without functional changes.

gcc/ada/
* libgnat/a-ngcoar.adb (Eigensystem): Adjust notation and fix the
layout of the real symmetric matrix in the main comment.  Adjust
the layout of the associated code accordingly and correctly turn
the 2Nx1 real vectors into Nx1 complex ones.
(Eigenvalues): Minor similar tweaks.
* libgnat/a-ngrear.adb (Jacobi): Minor tweaks in the main comment.
Adjust notation and corresponding parameter names of functions.
Fix call to Unit_Matrix routine.  Adjust the comment describing
the various kinds of iterations to match the implementation.
gcc/ada/libgnat/a-ngcoar.adb
gcc/ada/libgnat/a-ngrear.adb