Skip to content

Commit

Permalink
src/sage/matrix/matrix_double_dense.pyx: increase an FP tolerance
Browse files Browse the repository at this point in the history
I recently hit,

  File "src/sage/matrix/matrix_double_dense.pyx", line 1629, in
  sage.matrix.matrix_double_dense.Matrix_double_dense.right_eigenvectors
  Failed example:
      spectrum[3]  # tol 1e-13
  Expected:
      (-1.0, [(1.0, -0.5, 2.0, 0.5)], 1)
  Got:
      (-1.0000000000000828,
       [(1.0, -0.4999999999999238, 1.9999999999997218, 0.4999999999999161)],
       1)
  Tolerance exceeded in 3 of 6:
      -0.5 vs -0.4999999999999238, tolerance 2e-13 > 1e-13
      2.0 vs 1.9999999999997218, tolerance 2e-13 > 1e-13
      0.5 vs 0.4999999999999161, tolerance 2e-13 > 1e-13

This commit changes that tolerance to 1e-12 and makes the failure go away.
  • Loading branch information
orlitzky committed Jan 12, 2024
1 parent e249bef commit 07534a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_double_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
(1.0, [(1.0, -0.666666666666633, 1.333333333333286, 0.33333333333331555)], 1)
sage: spectrum[2] # tol 1e-13
(-2.0, [(1.0, -0.2, 1.0, 0.2)], 1)
sage: spectrum[3] # tol 1e-13
sage: spectrum[3] # tol 1e-12
(-1.0, [(1.0, -0.5, 2.0, 0.5)], 1)
A generalized eigenvalue problem::
Expand Down

0 comments on commit 07534a7

Please sign in to comment.