[Top][All Lists]

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

Re: a difficult homework

From: Nicholas Jankowski
Subject: Re: a difficult homework
Date: Tue, 27 Aug 2019 15:15:52 -0400

On Tue, Aug 27, 2019 at 2:42 PM shivax via Help list for GNU Octave <address@hidden> wrote:
now i try to expian better

ok.  now what do you define as a successful solution?  Your initial, very simple but effective script with loops works. it should work for very large arrays. It may not be the fastest on octave. Matlab is probably much faster because it has a working JIT (Just In Time) compiler that knows how to optimize loops.  

In the script that I threw together, it removed the loops but only sped things up by about 30% for small cases. I suspect that might increase as the data size increases, but as you have seen, we're trading memory for speed. We can only hold so much data at one time. Your looping case holds very little. Projection operations to parallelize operation are not memory efficient. They multiply, and often duplicate, the data in memory to try to operate on it faster in parallel. For any solution and a particular data set you could tabulate speed and peak memory requirement to compare them and decide which is best.

What are your requirements for 'success' on the homework? You've created two working algorithms. Is vectorization or speed a requirement? 

reply via email to

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