octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52342] vecnorm command


From: Rik
Subject: [Octave-bug-tracker] [bug #52342] vecnorm command
Date: Thu, 9 Nov 2017 01:00:28 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #52342 (project octave):

                  Status:         Patch Submitted => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #10:

I checked in a patch here
http://hg.savannah.gnu.org/hgweb/octave/rev/3d96400df713.

I added validation for the dimension argument, and added more complete code to
detect the first non-singleton dimension.  I also added a separate
TeX-formatted definition of the p-norm to the docstring so that it appears
nicely in the Octave Manual.  

In terms of performance, I found for the case of n == 2 that using sumsq()
resulted in a 15X speed-up over abs().  This is much faster than using the
vectorized real^2 + imag^2 as well.  Finally, the vectorized code seems to
outperform abs() when p is evenly divisble by 2.  So I split the generic
calculation based on whether p is even or odd and use vectorized cod or abs()
appropriately.

Marking as fixed and closing report.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52342>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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