bugGNU Octave - Bugs: bug #34206, Bug in harmmean.m

 
 

bug #34206: Bug in harmmean.m

Submitter:  None
Submitted:  Sun 04 Sep 2011 05:03:00 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Octave Forge Assigned to:  None
Originator Name:  Jacques Malaprade Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.4.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 20 Sep 2011 11:02:29 AM UTC, comment #2: 

Hi Rik,

thank you for forwarding this to our mailing list and bring it to our attention (it was actually on the bug tracker but we haven't got around to start using it properly). Just for reference, this is now fixed on the development version. Thank you,

Carnë

Carnë Draug <carandraug>
Group Member
Mon 19 Sep 2011 03:37:28 AM UTC, comment #1: 

This looks like a problem with an Octave Forge package, not a bug
in Octave.  The correct place to report this problem is the
Octave Forge mailing list, octave-dev@lists.sourceforge.net.

A copy of this update to the bug report is being sent to that
list so that they are aware of it.  Please follow up there.

Rik <rik5>
Group administrator
Sun 04 Sep 2011 05:03:00 PM UTC, original submission:  

I don't know if this is the right place to be submitting this but it seems to be in the source forge bugs page.
I have installed the statistics package from source forge version 1.0.10. I tried to use the geommean function and it came up with the following error:

>>> c = [1 1 3 6 9]

c =

   1   1   3   6   9

>>> harmmean(c)

error: `s' undefined near line 28 column 14

>>>error: evaluating argument list element number 1

error: called from:
error:   /home/malapradej/octave/statistics-1.0.10/harmmean.m at line 28, colum
n 7

I corrected this in my geommean.m file to the following:

## Copyright (C) 2001 Paul Kienzle
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; If not, see <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn {Function File} harmmean (@var{x})
## @deftypefnx{Function File} harmmean (@var{x}, @var{dim})
## Compute the harmonic mean.
##
## This function does the same as @code{mean (x, "h")}.
##
## @seealso{mean}
## @end deftypefn

function a = harmmean(x, dim)
  if (nargin == 1)
    a = mean(x, "h");
  else
    a = mean(x, "h", dim);
  endif
endfunction



It was line 28 which was
    a = mean(s, "h");

Hope this can be included in the next update.

Cheers,

Jacques

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by carandraug (Posted a comment)
  • -email is unavailable- added by rik5 (Not a core Octave issue, an Octave-Forge issue)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-20 rik5 StatusNone Octave Forge
        Open/ClosedOpen Closed
    2011-09-20 rik5 Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code