title: Optimally passing dimensions of fixed size array in julia
body: <p>I want to write a function which takes a matrix as an input.  This is a frequent low-level call in a complicated project, so making this function as fast as possible has potentially serious performance implications.  Because speed is so important to me, I'm using the types in <code>FixedSizeArrays</code> as I know that this will save on memory usage.  But I often know certain properties of the input matrix, and I'm not certain that I'm making optimal use of that.</p>
  
  <p>Here's a simple example.  Imagine that the function I want to make the following as fast as possible:</p>
  
  <pre><code>using FixedSizeArrays
  
  function foo( input::Mat )
  # NB: Mat is the FixedSizeArrays matrix type
    return 2 * input
  end
  </code></pre>
  
  <p>Obviously this is a trivial example, but that's not the point.  The point is that I know something about the dimensions of the matrix <code>input</code>: it always has only two columns and I can always specify the number of rows at run-time.  This seems like information that could be passed to the compiler to make my code faster.  Could I pass it as an argument that defines the size of <code>input</code> somehow?  Here's an example that doesn't work, but should give you some idea of what I'm trying to do.</p>
  
  <pre><code>function bar( int::N, thismat::Mat{N,2,Float64} )
    return 2 * thismat
  end
  </code></pre>
  
  <p>Is there something like this that I can do?  Would this even work if I could? Maybe FixedSizeArrays already does everything that can be done.  Thanks for you thoughts!</p>