Page 2 of 2

Posted: Wed 27 Feb, 2008 3:51 am
by Moose
The problem is I already use those methods in testing whether each value is a root.

My real goal is to eliminate any values that happen to be repeated into one each. Using those I'd end up using a for loop to change the value I was looking for.

Posted: Wed 27 Feb, 2008 12:45 pm
by King Harold
I don't really understand the problem there..
But your program adds those things to a this list, right? That is the moment at which you should check whether it is already in there (with max)

Posted: Wed 27 Feb, 2008 7:53 pm
by JoostinOnline
driesguldolf wrote:Nah, I was thinking of another function.
Btw, have you tested it with a list filled with zeros or random numbers?
driesguldolf wrote:Nevermind, I mistook it with the string functions.
Well you are just full of excuses, aren't you :lol:

Posted: Wed 27 Feb, 2008 7:59 pm
by driesguldolf
There is always an excuse :P

Ok, I admit, I was doing things the wrong way. I asked first before I tested :mrgreen:

Neither do I trust TI. :D

Posted: Sun 09 Mar, 2008 4:43 pm
by Moose
Wait a minute.... I can use that delta list thingy :roll:

I could do this when list1 is my list:

SortA(L1
not(augment({1},[DELTA]List(L1 -> L2
SortA(L2,L1
dim(L1)-sum(L2S -> dim(L1

I'm still in the brainstorming stage, but it seems like that would work :)

Posted: Sun 09 Mar, 2008 6:00 pm
by King Harold
doesn't the second sort have to be descending? (could be that I didn't understand it properly..)
augmenting a {0} to the list after not-ing it would help to make it a few microseconds faster I think

Posted: Wed 12 Mar, 2008 7:10 am
by Moose
King Harold wrote:doesn't the second sort have to be descending? (could be that I didn't understand it properly..)
augmenting a {0} to the list after not-ing it would help to make it a few microseconds faster I think
It works pretty good, the not-ing makes ever list value without a change from the last register as one - the boolean opposite of any change from value to value, meaning any list value that doesn't change from the last registers a change of zero, not(0)=1, everything else is not-ed to zero, so if organised in an ascending order, every list value without a change is stored as a one, which is sent to the end of the list. So once I change the dimension of the list, all those ones get cut off, and the corresponding values from list one get cut off too.

I'll try augmenting a zero after all that, thanks for the tip.

Posted: Wed 12 Mar, 2008 10:59 am
by King Harold
Registers..?

Posted: Wed 12 Mar, 2008 1:06 pm
by Moose
King Harold wrote:Registers..?
Lol sorry

(not to self: don't use the word "registers" when around assembly programmers)

I can't think of another word for it though. It shows a change of zero I guess, I meant it in a more figurative way.

Posted: Wed 12 Mar, 2008 3:52 pm
by King Harold
Well I don't get you, I thought your algorithm works like this:
Sort to place duplicate values next to each other
Make a delta-list (will have 0 at the index of any duplicate except the last one)
Not( the d-list..
append 0 to front to match size
use the list to key-sort the old list and chop the duplicates off

sort {2,3,1,2
dlist {1,2,2,3
not {1,0,1
augmnt0 {0,1,0
keysort {0,0,1,0
chop {1,2,3,2
{1,2,3

like so.

Posted: Tue 18 Mar, 2008 2:22 am
by Moose
Oh I see what you mean. I actually only stick that zero there since the p/q technique doesn't work for any roots that are 0 (y=x^2 would only yield a bunch of 1's in the possible root value list).

Other than that your exactly right.

I don't know why, but I don't need to line up the lists with an extra value in the delta list, maybe it's just a result of the strange ways I use basic.