[swift-users] hello, first time poster and accelerate question

Yuma Decaux jamyad7 at gmail.com
Fri Nov 18 07:36:23 CST 2016


Hello everyone,

Nice to meet y'all, and here's my first question:

I am currently setting a semantically easy to use accelerate operation extension set for my research.

I have done all the basic operations, vector to scalar, vector to vector, matrix mult matrix, transpose etc, but would like to know what the best approach might be for getting the mean for a matrix, as I am not sure if the result is what I think it is. In fact, I would like an output of m by 1 from an n by m matrix with means of each column vector.

The function is:
func vDSP_meanvD(UnsafePointer<Double>, vDSP_Stride, UnsafeMutablePointer<Double>, vDSP_Length)

I assume for a vector this is fine since it is 1 dimensional, but for matrices here is my question:

What is the approach to take?
1-Do I slice my matrix into m copies of size n where M_i(n by m) and pass them all through vDSP_meanvD?
2- Does the stride argument take care of this, in that if I have stride of n, then the ranges [0:n], [n+1: 2n], [2n+1: 3n] will have their mean and std computed?


Thanks for any pointer

Best regards,



 


More information about the swift-users mailing list