Menu

#1501 Dimensions for `stats matrix` are exchanged.

closed-accepted
nobody
stats (6)
5
2015-03-23
2014-10-15
No

Hi, when using stats matrix, the reported indices of the maximum and minimum are wrong because the number of columns is falsely reported as y-dimension. Consider the script

$data <<EOD
5 1 5 5
5 5 5 5
5 5 5 5
5 9 5 5
5 5 5 5
EOD
stats 'data.txt' matrix

which reports

Minimum: 1.0000 [ 0 1 ]
Maximum: 9.0000 [ 2 3 ]

The correct indices would be

[ 1 0 ]
[ 1 3 ]

The attached patch fixes this and adds two new variables STATS_size_x and STATS_size_y which contain the matrix dimensions. It further documents the use of stats matrix.

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2014-10-16

    Applied, thanks.

    I've marked this as "known bug" in CVS for 4.6 but the patch itself does not apply cleanly to the 4.6 source. If we ever decide to release a 4.6.7 it should include a back-ported version of this fix.

     
  • Ethan Merritt

    Ethan Merritt - 2014-10-16
    • status: open --> pending-fixed
     
  • Ethan Merritt

    Ethan Merritt - 2014-10-29
    • status: pending-fixed --> closed-accepted
     

Log in to post a comment.