Optimization: Avoid repeated iterator garbage generation.
Optimization: Re-use matrices, double [] allocations.