LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize Incremental Array

Right you are!  It's shift registers that, when their size increases with each iteration of a loop, are not very efficient and are better replaced by the initialize array / replace subsets combo.  It takes a couple of times for things to stick in memory sometimes, but I'm getting there!  Smiley Happy

 

 

Edit:  By you specifying FOR loops in your answer, am I correct in thinking that other types of loop (where there isn't a pre-defined execution number) do not benefit from the same autoindexing efficiency?



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 11 of 13
(370 Views)

J.Mamakos wrote:

Edit:  By you specifying FOR loops in your answer, am I correct in thinking that other types of loop (where there isn't a pre-defined execution number) do not benefit from the same autoindexing efficiency?


That's right.  If I'm not mistaken, an auto-indexing while loop is more efficient than build array in a loop, but less efficient than a for loop.  My understanding is that the while loop uses an algorithm that increases (doubles, maybe?) the size of the array each time it fills, then resizes the array to the appropriate length when the loop exits.

0 Kudos
Message 12 of 13
(361 Views)

@J.Mamakos wrote:
Edit:  By you specifying FOR loops in your answer, am I correct in thinking that other types of loop (where there isn't a pre-defined execution number) do not benefit from the same autoindexing efficiency?

That is correct.  The while loop does not have the same memory luxuries as the FOR loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 13
(359 Views)