Bobillier Posted December 17, 2009 Report Share Posted December 17, 2009 (edited) Hi I just want proposing you a trick for conditional array filling with feedback node . Perhapse lot's of you know that , perhapse not. Eric BOBILLIER Exempl in LV2009 conditionnal array filling exempl.vi Edited December 17, 2009 by Bobillier Quote Link to comment
jgcode Posted December 17, 2009 Report Share Posted December 17, 2009 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 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 Have you seen this VI? Quote Link to comment
Bobillier Posted December 18, 2009 Author Report Share Posted December 18, 2009 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 Have you seen this VI? 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 . Quote Link to comment
jgcode Posted December 18, 2009 Report Share Posted December 18, 2009 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 . Certainly my good man. Attached is an example project that includes benchmarking for building an array: From the front From the back Preallocating memory first, then taking subset 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! 14 Build Array.zip [LabVIEW 2009] Quote Link to comment
Bobillier Posted December 18, 2009 Author Report Share Posted December 18, 2009 (edited) 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 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 . 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 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 December 18, 2009 by Bobillier Quote Link to comment
Yair Posted December 20, 2009 Report Share Posted December 20, 2009 I have to admit I didn't know that the feedback node could have a conditional terminal. I'll have to look into that. Those who want to have this built in in a more convenient (and presumably efficient) manner should go vote for this idea (and while you're at it, you may wish to check out this related idea). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.