menpo/menpo — pull request #518 by jabooth (2014-11-27 12:43:10+00:00)
Title: PCA memory improvements, inplace dot product

- `PCAModel` has grown support for construction from an iterator rather than a list of vectorizable items. In this case we need to be able to instruct `PCAModel` on how big to allocate it's data matrix - we do this with the new (completely optional) `n_samples` kwarg. If you don't provide this, things are as they used to be.

- `menpo.math` gets two new functions - `dot_inplace_left(a, b)` and `dot_inplace_right(a, b)`. These methods iterate over either the left or right item in the dot product incrementally replacing this input array with the output. This allows us to essentially compute large dot products inplace.

- `principal_component_decomposition` now uses these inplace dot methods if you provide the (pre-existing) `inplace=True` kwarg.

- tests have been added for all new behaviour.