commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-652) Tridiagonal QR decomposition has a faulty test for zero...
Date Sun, 22 Jan 2012 11:21:40 GMT

    [ https://issues.apache.org/jira/browse/MATH-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190649#comment-13190649
] 

Thomas Neidhart commented on MATH-652:
--------------------------------------

Patched in r1234486.
                
> Tridiagonal QR decomposition has a faulty test for zero... 
> -----------------------------------------------------------
>
>                 Key: MATH-652
>                 URL: https://issues.apache.org/jira/browse/MATH-652
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: JAVA
>            Reporter: greg sterijevski
>              Labels: TriDiagonalTransformer
>             Fix For: 3.0
>
>         Attachments: tridiagonal
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In the method getQT() of TriDiagonalTransformer we have:
>     public RealMatrix getQT() {
>         if (cachedQt == null) {
>             final int m = householderVectors.length;
>             cachedQt = MatrixUtils.createRealMatrix(m, m);
>             // build up first part of the matrix by applying Householder transforms
>             for (int k = m - 1; k >= 1; --k) {
>                 final double[] hK = householderVectors[k - 1];
>                 cachedQt.setEntry(k, k, 1);
>                 final double inv = 1.0 / (secondary[k - 1] * hK[k]);
>                 if (hK[k] != 0.0) {
>                     double beta = 1.0 / secondary[k - 1];
> The faulty line is : final double inv = 1.0 / (secondary[k - 1] * hK[k]);
> It should be put after the test for the zero, eg:
>     public RealMatrix getQT() {
>         if (cachedQt == null) {
>             final int m = householderVectors.length;
>             cachedQt = MatrixUtils.createRealMatrix(m, m);
>             // build up first part of the matrix by applying Householder transforms
>             for (int k = m - 1; k >= 1; --k) {
>                 final double[] hK = householderVectors[k - 1];
>                 cachedQt.setEntry(k, k, 1);
>                 if (hK[k] != 0.0) {
>                     final double inv = 1.0 / (secondary[k - 1] * hK[k]);
>                     double beta = 1.0 / secondary[k - 1];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message