søn, 09 03 2008 kl. 10:50 +0100, skrev Søren Hauberg:
> Also, does anybody know why 'sumskipnan' isn't implemented as
> (non-tested code, but you'll get the idea)
>
> function retval = sumskipnan(A, varargin)
> A(isnan(A)) = 0;
> retval = sum(A, varargin{:});
> endfunction
>
> ? That would be a lot simpler then the C++ implementation, and would
> also work for complex matrices.
I was curious, so I did an implementation of 'sumskipnan' using the
approach above. The result is somewhat slower, but it supports
everything that 'sum' supports (complex matrices, Nd matrices). I'm
attaching the function in case people are interested. Should we replace
the current implementation with my m-file implementation? I don't use
the function, so I don't have any strong feelings here.
Søren
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev