Pass matrices by value.

As with vectors, this increases performance by decreasing the amount of
pointer lookups.