title: How to marshal multi-dimensional arrays
body: <p>We have some interop code that involves matrices. I was trying to call the native DLL and for the most part it works very reliably.</p>
  
  <p>I am relying on the <a href="http://msdn.microsoft.com/en-us/library/z6cfh6e6%28v=vs.110%29.aspx">default marshalling by .net</a>, avoiding unmanaged pointers and rather using .net arrays for the most part, and maybe a <code>byref</code> here and there. The .net article says, that multidimensional arrays are implicitly marshalled as column-major one-dimensional arrays, which would be fine. </p>
  
  <p>The only thing that does not seem to work, is trying to marshal a multi-dimensional array, as the F# compiler complains that <code>float[,]</code> is not allowed in an <code>extern</code> declaration. Is there any way around this limitation? </p>
  
  <p>I am aware of the <code>PinnedArray</code> and <code>PinnedArray2</code> types from the F# PowerPack, but I was looking for a solution which relies on managed pointers and - more importantly - I'd like to avoid having to include F# PowerPack as a dependency just for the <code>PinnedArray</code> classes.</p>