Summing Structures via Iterator - stock patches only?

vade's picture

Hi.

I recall a method to use use an iterator with no consumers in it, with a published output port that allows one to aggregate a structure of say, numbers, into a sum.

Basically, I have a structure. I need stock only summation of the contents of the structure, and do not want to "unroll" this loop. I'm pretty sure this is possible, but for whatever reason I cannot determine the method, and cannot seem to find an example that does this.

Help a brotha out.

vade's picture
Re: Summing Structures via Iterator - stock patches only?

I got it.

You need to use the feedback patch. I was doing that, but I had issues "upstream"

In your iterator, publish the output you want summed or averaged or whatever, then use the feedback patch to get at the last iterated value, and use it in a computation.

gtoledo3's picture
Re: Summing Structures via Iterator - stock patches only?

You sunk my answer :) but, it's possible to use a splitter (and maybe multiplexer) to manually make a feedback loop instead. Whatever works though! :)

gtoledo3's picture
Re: Summing Structures via Iterator - stock patches only?

This is what I'm talking about.

I view the feedback patch with trepidation; I use it because of convenience, but it seems to have problems executing correctly sometimes, at least in image chains. Every so often it will wind up doing a weird strobey flicker that "manual pre-feedback patch" feedback loops don't. I wind up replacing the patch in pretty much everything.

PreviewAttachmentSize
Structure Addition.qtz4.78 KB

usefuldesign.au's picture
Re: Summing Structures via Iterator - stock patches only?

Didn't know this was possible. Demo comp when you have a chance pls.

usefuldesign.au's picture
Re: Summing Structures via Iterator - stock patches only?

Nice trick. Since I've been on 10.7 (and skipped 10.6) I haven't got into pushing the limits of the patches to do things but the this reminds me of the kinds of things I used to get up to in QC 3!