Skip to content

echelonize() on RR matrices should not use "classical" algorithm #34724

@dimpase

Description

@dimpase

From sage-devel:

Inverting RR-matrix

sage: m
[-6.12323399573677e-17     -1.72508242466029]
[    0.579682446302195  6.12323399573677e-17]
sage: m.parent()
Full MatrixSpace of 2 by 2 dense matrices over Real Field with 53 bits of precision

because it uses classical echelonize:

sage: A=m.augment(identity_matrix(RR,2))
sage: A
[-6.12323399573677e-17     -1.72508242466029      1.00000000000000     0.000000000000000]
[    0.579682446302195  6.12323399573677e-17     0.000000000000000      1.00000000000000]
sage: A.echelonize()
sage: A
[     1.00000000000000     0.000000000000000      4.00000000000000      1.72508242466029]
[    0.000000000000000      1.00000000000000    -0.579682446302195 -6.12323399573676e-17]

instead of

sage: A.echelonize(algorithm='scaled_partial_pivoting');A
[     1.00000000000000     0.000000000000000  6.12323399573677e-17      1.72508242466029]
[    0.000000000000000      1.00000000000000    -0.579682446302195 -6.12323399573677e-17]

Initial motivation : see this sage-devel thread, which exhibits a serious numerical error on matrix inversion.

CC: @mkoeppe

Component: linear algebra

Author: Dima Pasechnik

Branch/Commit: 605968d

Reviewer: Nils Bruin

Issue created by migration from https://trac.sagemath.org/ticket/34724

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions