Skip to content

Instantly share code, notes, and snippets.

@eholk
Created January 18, 2013 02:08
Show Gist options
  • Select an option

  • Save eholk/4561762 to your computer and use it in GitHub Desktop.

Select an option

Save eholk/4561762 to your computer and use it in GitHub Desktop.
pub fn zero_matrix<T: Copy Ring, M: BasicMatrix<T> Create<T, M>>(n: uint, m: uint) -> M
{
Create::create::<T, M, M>(n, m, |_i, _j| Ring::zero::<T>())
}
// call site
let Z = zero_matrix::<float, R>(N2, N2a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment