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

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

[Octave-bug-tracker] [bug #53012] Performance of sort on complex values


From: Rik
Subject: [Octave-bug-tracker] [bug #53012] Performance of sort on complex values
Date: Wed, 31 Jan 2018 12:08:14 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #5, bug #53012 (project octave):

I think that's not a bad trade-off.  Peak memory would be 16N (original array)
+ 16N(temporary array) + 16N(index vector) or 48N.  The current solution is
probably 16N (original array) + 16N (output sorted array) or 32N.  The ratio
is only 1.5.

I believe this should be done, but it will require hacking deep in to
liboctave.  There is both the sorting routine in liboctave/util and then code
which calls it out of Array.cc.  The code in Array.cc is general and shared by
all types that derive from it.  If we override each of the Complex object
types there are quite a few.


CColVector.h    CMatrix.h       CRowVector.h    fCDiagMatrix.h  fCNDArray.h   
 fCRowVector.h   
CDiagMatrix.h   CNDArray.h      CSparse.h       fCColVector.h   fCMatrix.h


There might be an intermediate ancestor between Array and these final types
which could be overridden.  That would be ideal because I would rather not
repeat the code 11 times. 




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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