Re: My first program: sublime (reverse of "extract" function)

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...

Why can't you keep a copy of the original list? What type of processing are you doing that makes this solution unsuitable?

That's slightly less trivial code:

sequence InputData = {0.01, 0.05, 0.08, 0.03, 0.02} 
sequence OutputData = sort(InputData) 
sequence OriginalOrder = sublime(InputData, OutputData) 
for i = 2 to length(OutputData) do 
    OutputData[i] *= 1 - OutputData[i-1] 
end for 
OutputData = extract(OutputData, OriginalOrder) 

P.S. I've been thinking how best to implement this feature: simple or optimal. This is the easiest and most non-optimal option. There have been other attempts.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu