octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementation of convn


From: Søren Hauberg
Subject: Re: Implementation of convn
Date: Mon, 24 Mar 2008 22:22:07 +0100

man, 24 03 2008 kl. 16:27 -0400, skrev John W. Eaton:
> Will you please update according to the following comments and submit
> this as an hg changeset?
Sure. In which directories do you want the files to be placed?

> |       // For each neighbour
> |       SumType sum = 0;
> |       for (octave_idx_type n = 0; n < ndims; n++)
> |         B_idx(n) = 0;
> |       for (octave_idx_type j = 0; j < B_numel; j++)
> |         {
> |           for (octave_idx_type n = 0; n < ndims; n++)
> |             A_idx(n) = out_idx(n) + (B_size(n)-1-B_idx(n));
> |           sum += A(A_idx)*B(B_idx);
> |           B.increment_index(B_idx, B_size);
> |       }
> |             
> |       // Compute filter result
> |       out(out_idx) = sum;
> | 
> |       // Prepare for next iteration
> |       out.increment_index(out_idx, out_size);
> |       
> |       OCTAVE_QUIT;
> |     }
> |     
> |   return octave_value(out);
> | }
> 
> Is there a way to do this without increment_index?  That function will
> make this code slow.
Perhaps. I couldn't think of a way though. Perhaps somebody else has a
suggestion?

>  Note also that doc strings for internal functions
> should just say (for example)
> 
>     "-*- texinfo -*-\n\
>   @deftypefn {Loadable Function} {} __convn__ (@var{a}, @var{b})\n\
>   Undocumented internal function"
> 
> Currently we have a mixture of styles for these, so maybe they should
> all be fixed to be consistent.
Don't we have "private" directories now? I would think all __functions__
should be moved to "private" directories. If we do this, then it would
probably be nice for developers if __functions__ are documented as well.

Søren



reply via email to

[Prev in Thread] Current Thread [Next in Thread]