JuliaLang/julia — pull request #7907 by Jutho (2014-08-08 00:22:01+00:00)
Title: WIP: use mutating matrix multiplication in eigs

Currently, the arpack wrapper of eigs allocates way too much memory. Firstly, no mutating methods are used, so every matrix multiplication creates (allocates) a new output, which is then copied to the position requested by Arpack. Secondly, for every new matrix multiplication, a new inputvector `x=workd[load_idx]` is created (allocated). So that is two vector allocations per matrix multiplication, both of which could be avoided. The second one will automatically go away when indexing creates a view. The first one requires to switch to mutating methods whenever possible (e.g. whenever defined for the type of A).

This is a work in progress, since so far only the standard mode is covered (i.e. no shift-invert, no generalised eigenvalue problems, so this will fail the tests). Also, I currently use `pointer` and `pointer_to_array` to create a view, but a simple `slice` would probably have been ok.