MCPcopy Create free account
hub / github.com/csound/csound / Accum

Class Accum

Opcodes/arrayops.cpp:187–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185};
186
187template <typename T, int I> struct Accum : csnd::Plugin<1, 1> {
188
189 MYFLT process(csnd::myfltvec &in1) {
190 return std::accumulate(in1.begin(), in1.end(), FL(I), T());
191 }
192
193 int init() {
194 csnd::myfltvec &in1 = inargs.myfltvec_data(0);
195 outargs[0] = process(in1);
196 return OK;
197 }
198
199 int kperf() {
200 outargs[0] = process(inargs.myfltvec_data(0));
201 return OK;
202 }
203};
204
205
206#include <modload.h>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected