0

I've been going through the new Accelerate framework for swift as I am looking to optimise all of my vector calculations.

I found the following enum called vDSp which avoids me re-writing the entire set of vector maths: https://developer.apple.com/documentation/accelerate/vdsp-snv?changes=_2

However, the enum is not recognised (no such found error). One of the enum cases is mean which takes a vector and returns the mean as a double. The signature is:

static func mean <U>(U) -> Double

Has anyone come across this, and know how to implement it? I'm looking to do something like

func getMean(_ u: [Double])->Double{
    return vDSP.mean<Double>(u)
}

This would be terribly useful for what I do

tRx
  • 815
  • 1
  • 15
  • 24
triple7
  • 542
  • 3
  • 17

1 Answers1

0

Ok, sorry guys, I realised I hadn't downloaded Xcode 11.x. Works like a charm.

Really recommend this one for anyone who can do Unsafe programming.

triple7
  • 542
  • 3
  • 17