09-12-2007 05:51 AM
09-12-2007 07:38 AM
Hi Michael,
Technically speaking yes it is possible but there are limitations to any appraoch that does not use loops.
Rather than wonder down that path, could you please post
an example of your "in" (the array of clusters) and your desired "out" (array indicator)
and could you tell us a bit more about why you wnat to do this without loops.
Ben
09-12-2007 08:13 AM
09-12-2007 08:43 AM
NO-GO for arrays or arbitrary size!
ASide from using an unbundle by name rather the plain "unbundle" they way you coded is acceptable.
Rather than just give up this could you tell us more about what is "in-elegant" about what you posted?
Ben
09-12-2007 08:53 AM
09-12-2007 09:01 AM - edited 09-12-2007 09:01 AM
Message Edited by mishklyar on 09-12-2007 09:01 AM
09-12-2007 09:34 AM
Thank you for the clarification Michael.
In this thread Shane and I discuss over the course of a week some of the fine points with working with arrays of clusters.
Please review that thread to get an idea of what it takes to work with arrys of clusters.
The important things to note are;
1) Memory allocation is an expensive operation. Do it as infrequently as possible.
2) The show buffer allocations gives you a view of when memory is being allocated.
I hope this help!
Ben
PS: Christian, this Q is right up your alley.
09-12-2007 11:59 AM
@mishklyar wrote:
The in-elegant here,as I see it is the time of execution.In the example that was posted,we should run thru all array.
The solution that I was looking for,is Rearranging the data handling,as LabView "sees it",and not Creating new data.
Your solution is actually very elegant and very efficient. A FOR loop is not a problem! It is one of the fastest structures and due to the use of autoindexing, all outputs can be fully allocated in one swoop.
You cannot reintrepret the data in memory, because the flattened representations between your two clusters is different. No matter what, a copy needs to be made.
If you would refactor your code from ground up, maybe you can stick with a single data representation so you don't need to reshuffle.
09-12-2007 12:36 PM - edited 09-12-2007 12:36 PM
OK, looking at the code once more, you don't need to initialize the first array, because all elements are the same. Here's a version that does NOT need to allocate the initial array.
Message Edited by altenbach on 09-12-2007 10:36 AM
09-12-2007 12:53 PM