-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jaroslav Hajek wrote:
> On Fri, Feb 20, 2009 at 10:59 AM, Jussi Leinonen <[email protected]> 
> wrote:
>> To: [email protected]
>> Cc: [email protected]
>> Subject: Function mean() fails with a complex matrix
>> --------
>> Bug report for Octave 3.0.1 configured for i486-pc-linux-gnu
>>
>> Description:
>> -----------
>>
>> There seems to be a bug (hopefully not a "feature"!) that causes
>> mean() to fail when given a complex matrix as an argument.
>>
>> Repeat-By:
>> ---------
>>
>> octave:43> c = [1 1+i 2-i];
>> octave:44> mean(c)
>> error: octave_base_value::array_value(): wrong type argument complex
>> matrix'
>> error: sumskipnan: first input argument must be a real matrix
>> error: evaluating if command near line 72, column 1
>> error: called from mean' in file
>> /usr/share/octave/packages/nan-1.0.6/mean.m'
>>
>> Fix:
>> ---
>>
>> Apparently the problem is in the function sumskipnan(), which should
>> be edited to support complex numbers (it is not documented that it
>> does not), or alternatively, mean() could be implemented differently.
>>
> 
> Hi,
> bug reports for OctaveForge packages should be reported to its mailing list
> <[email protected]>.
> 
> The NaN-aware mean is relatively easy to simulate:
> mask = isnan (x);
> x(mask) = 0;
> m = sum(x) ./ sum (! mask);
> 
> regards
> 


You are using sumskipnan.oct. Unfortunately, the sumskipnan.oct does not
yet support complex numbers.

I suggest using sumskipnan.mex or sumskipnan.m.

When you delete sumskipnan.oct, everything should work fine again.
If the performance penalty is too bad, use sumskipnan.mex.
        mkoctfile -mex sumskipnan.cpp



regards,
   Alois







-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkme1vwACgkQzSlbmAlvEIgKjACfdg/TDrjkI/AyGMSDeDMfdGfI
wmoAnRagovzw1Pnl3RaMt4xDqfa7xtUK
=7d7V
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to