<div dir="ltr">I must have forgotten how matrices work—I think it&#39;s actually this direction. And I also lost an m :-)<div><br></div><div><img src="cid:ii_1587ac4053991fb6" alt="Inline image 1" width="562" height="75"><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail-m_8552766800504083152gmail_signature"><div dir="ltr"><div><br></div></div></div></div><div class="gmail_quote">On Fri, Nov 18, 2016 at 7:55 PM, Jacob Bandes-Storch <span dir="ltr">&lt;<a href="mailto:jtbandes@gmail.com" target="_blank">jtbandes@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Can&#39;t you achieve this with a single vector*matrix multiplication?<div><br></div><div>[1/n,  1/n,  ...,  1/n] * A  =  [mean(col 1); mean(col 2); ...; mean(col n)]</div><div><br></div><div>Or in more legible form:</div><div><br></div><div><img src="cid:ii_1587ab8e14b4c047" alt="Inline image 1" width="562" height="203"><span class="gmail-m_8552766800504083152HOEnZb"><font color="#888888"><br></font></span></div><div><div class="gmail_extra"><span class="gmail-m_8552766800504083152HOEnZb"><font color="#888888"><br clear="all"><div><div class="gmail-m_8552766800504083152m_-7011125162419129388gmail_signature"><div dir="ltr"><div>Jacob<br></div></div></div></div></font></span><div><div class="gmail-m_8552766800504083152h5">
<br><div class="gmail_quote">On Fri, Nov 18, 2016 at 5:36 AM, Yuma Decaux via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello everyone,<br>
<br>
Nice to meet y&#39;all, and here&#39;s my first question:<br>
<br>
I am currently setting a semantically easy to use accelerate operation extension set for my research.<br>
<br>
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.<br>
<br>
The function is:<br>
func vDSP_meanvD(UnsafePointer&lt;Doub<wbr>le&gt;, vDSP_Stride, UnsafeMutablePointer&lt;Double&gt;, vDSP_Length)<br>
<br>
I assume for a vector this is fine since it is 1 dimensional, but for matrices here is my question:<br>
<br>
What is the approach to take?<br>
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?<br>
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?<br>
<br>
<br>
Thanks for any pointer<br>
<br>
Best regards,<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-users</a><br>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div>