Skip to content

?test_rfp: error in the test  #678

@AlexanderZotkevich

Description

@AlexanderZotkevich

Description

Test can fail for DIAG = 'U' when diagonal elements of test matrix are supposed to be unit.

in ?drvrf3 one can read:

 *
 *                             Generate A our NA--by--NA triangular
 *                             matrix.
 *                             Our test is based on forward error so we
 *                             do want A to be well conditioned! To get
 *                             a well-conditioned triangular matrix, we
 *                             take the R factor of the QR/LQ factorization
 *                             of a random matrix.

And that's right, the 1/(condition number) of the test matrix calculated with ?LANGE + ?GETRF + ?GECON is about 1E-5 for single precision when DIAG is not 'U'.

But when DIAG is 'U', setting diagonal elements to be unit spoils the test matrix: 1/(condition number) becomes about 1E-10.

This can lead to test fail for different combinations of hardware/BLAS/compiler.

Checklist

  • I'd suggest to fix this dividing rows of the matrix by 2 * corresponding diagonal elements for DIAG ='U' case:

IUPLO = 1:

                                 IF ( LSAME( DIAG, 'U' ) ) THEN
                                    DO J = 1, NA
                                       DO I = 1, J
                                          A(I, J) = A(I, J) /
     +                                          ( 2.0 * A(J, J) )
                                       END DO
                                    END DO
                                 END IF

IUPLO != 1:

                                 IF ( LSAME( DIAG, 'U' ) ) THEN
                                    DO I = 1, NA
                                       DO J = 1, I
                                          A(I, J) = A(I, J) /
     +                                          ( 2.0 * A(I, I) )
                                       END DO
                                    END DO
                                 END IF

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions