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