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

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

[Octave-bug-tracker] [bug #59850] uniquetol missing, so I implemented it


From: anonymous
Subject: [Octave-bug-tracker] [bug #59850] uniquetol missing, so I implemented it
Date: Mon, 25 Jan 2021 00:12:05 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

Follow-up Comment #17, bug #59850 (project octave):

Is the following good enough?


tol=.1;
x=(1:.045:3)';
## the difference check
dx=diff(x);
csdx=cumsum(dx);
shouldkeep=[true;diff([0;csdx-mod(csdx,tol)])>eps(max(abs(x)))]
x(shouldkeep)


It's not exactly .1 between each point but it is close. I don't imagine
exactly subtracting without a loop. I am interested if this is the same as
Matlab. Should I update uniquetol with the above suggestion?

I thought of a way to decrease the number of iterations of the loop for the by
rows method but it would require sorting for each unique value so it may not
be faster. I could also write it in c++ which would hopefully remove much of
the loop overhead.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59850>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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