05-01-2008 04:03 PM
05-02-2008 04:34 AM
05-02-2008 10:18 AM
05-02-2008 10:33 AM
andre.buurman@carya wrote: If you're value are in an array. You can delete portions of the array with "delete from array" in a for loop. The delete array is just as easily used to delete one sample or many sample at once. Just iterate use a for loop through all the portions to be deleted.
The delete from array is so slow that we really need to wait. The "replace" versions are so fast that we need a bigger array to see the difference.
So, lets try with an array that is 10x larger (size 1000000)
With an array that is 100x larger (size 10000000), the built array version starts also to lag behind:
In summary, "delete from array" is 30x slower on an array that is 100x smaller!!!! The difference actually gets worse with larger arrays. It is useless inside a loop.
05-02-2008 10:55 AM
05-02-2008 11:34 AM
lmtis wrote:
that is very odd...
Both options are a lof of work and for each element deletion, most of the other elements of the entire array need to be touched and manipulated. That's why the complexity goes with the square of the array size.
If you use the the "replace" version, all operations are "in place" in memory and each array element needs to be touched only once, no matter now many delete operations you perform. The complexity is liner with the array size.
"delete from array" is highly optimized code and works very well if you only need to delete a single element or subset. As soon as you need to do repetitive work in a loop it fails misearbly in terms of performance. The reason is not a flaw in the code, but a fundamental issue dictated by the task at hand. 🙂
05-02-2008 04:06 PM
Altenbach... I understood what you said....
And the problem might be quite serious because I work with large files.... The performance of computer will dropped down....
But one thing that I still don´t know hot to do, is the selection with mouse. I have a waveform in the screen and I want to select a region of the waveform with the mouse and when I release the button of the mouse, an operation runs on the region selected, for example a mean calculation. Is there any way to build this with Labview?
Thanks
Daniel
05-02-2008 04:26 PM
Yes, this is easily possible using mouse down events on the graph and parsing the coordinates.
daniel.penteado wrote:
I have a waveform in the screen and I want to select a region of the waveform with the mouse and when I release the button of the mouse, an operation runs on the region selected, for example a mean calculation. Is there any way to build this with Labview?