Improve pinv2 and pinvh.

Avoid matrix operations on array elements that are multiplied by 0
in the process of calculation.
Fix PEP8
Merge pull request #393 from akhmerov/master

Minor improvement of pinv2 and pinvh