eigenvalues method
Computes the eigenvalues of the matrix using the QR algorithm.
This implementation assumes that the matrix is symmetric and may not converge for non-symmetric matrices.
maxIterations: Maximum number of iterations for the QR algorithm (default: 1000).tolerance: Tolerance for checking the convergence of the QR algorithm (default: 1e-10).
Returns a list of eigenvalues.
Example:
var matrix = Matrix([
[1, 2, 3],
[2, 1, 2],
[3, 2, 1]
]);
var eigenvalues = matrix.eigenvalues();
print(eigenvalues); // [5.372281323269014, -2.3722813232690143, -1.0000000000000002]
Implementation
List<dynamic> eigenvalues({int maxIterations = 1000, num tolerance = 1e-10}) {
return eigen(maxIterations: maxIterations, tolerance: tolerance).values;
}