0

Sorry if this is obvious. I'm just getting into the Accelerate framework and trying to go beyond the very simple stuff. I'm staring down the vDSP reference but I'm not sure how the following would be phrased or what it might be called in technical lingo. I want the following operation - what's the best way to do this with vDSP? I'm just having trouble finding it. (In pseudocode, for i from 0 to some N:)

O[i]= A + B * (sum of vector I from 0 to i)

Thanks!

To clarify: these are both vectors of floats and speed is critical.

Luke
  • 7,110
  • 6
  • 45
  • 74
  • Summing an array of ints is trivial: http://stackoverflow.com/questions/5567517/sum-array-of-unsigned-8-bit-integers-using-the-accelerate-framework. You might get more hits if you searched for the entirety of the Accelerate framework rather than just vDSP. There are very few benefits to be had from this kind of operation unless you need very large vector computations on large integers or floating point numbers. – CodaFi Jul 11 '13 at 01:01
  • Edited to be more clear. Note that I need more than just the final sum. – Luke Jul 11 '13 at 03:19

1 Answers1

0

It turns out this is equivalent to:

vDSP_vrsum(I, 1, &B, O, 1, N);
vDSP_vsadd(O, 1, &A, O, 1, N);
Luke
  • 7,110
  • 6
  • 45
  • 74