Jump to content

Trick for conditional array filling


Bobillier

Recommended Posts

Hi

I just want proposing you a trick for conditional array filling with feetback node . Perhapse lot's of you know that , perhapse not.

Eric BOBILLIER

post-5178-126109025167_thumb.png

Exempl in LV2009

Hi Bob

Cool trick!

(Although in this case you have used a while loop)

I personally prefer OpenG Conditional Auto Indexing Tunnel over preallocating arrays.

All the performance, non of the hassle :P

Have you seen this VI?

post-10325-126109128268_thumb.png

Link to comment

Hi Bob

Cool trick!

(Although in this case you have used a while loop)

I personally prefer OpenG Conditional Auto Indexing Tunnel over preallocating arrays.

All the performance, non of the hassle tongue.gif

Have you seen this VI?

post-10325-126109128268_thumb.png

Hi JG

Yes it's true, the limitation of this solution is than there isn't any memory preallocating and for this reason it's better to use it with small size array.

Yes i know OpenG Conditional Auto Indexing Tunnel , but with it you must before have one booleen array (elements to keep)to filter the array in).

Perhapse it will be interesting that you show us, how you made the same exempl ( even array) with OpenG Conditional Auto Indexing Tunnel . wink.gif

Link to comment

Hi JG

Yes it's true, the limitation of this solution is than there isn't any memory preallocating and for this reason it's better to use it with small size array.

Yes i know OpenG Conditional Auto Indexing Tunnel , but with it you must before have one booleen array (elements to keep)to filter the array in).

Perhapse it will be interesting that you show us, how you made the same exempl ( even array) with OpenG Conditional Auto Indexing Tunnel . wink.gif

Certainly my good man.

Attached is an example project that includes benchmarking for building an array:

  1. From the front
  2. From the back
  3. Preallocating memory first, then taking subset
  4. Using the OpenG array

I get difference performance on single core vs dual core.

Unfortunately this example includes keeping odd numbers I hope that is ok! :P

14 Build Array.zip

[LabVIEW 2009]

Link to comment

Thanks JG

You are right again , my solution is really bad for speed, 5.3s for 100000 points. Better than "add to front" but worst than the others.

Finaly it's bad trick :wacko:

If i compare with your buildArray_reverseArray.vi (who are like the classic solution in my previous post), i obtein a 18ms of time versus 5.3s :frusty: . I don't know why normally those two solutions don't preallocate memory.

If we thinks that feedback Node is not equal to shift register, we have a good exempl of why :cool:

I send you my test vi, perhapse you can add it to your bible of filling array, like exempl to not use ;).

Bye

Eric

buildArray_FillingArray with feedback node.vi

Edited by Bobillier
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.