Check dimensions of matrices.
Merge pull request #2 from AlexanderFabisch/python_bindings_checks

Check dimensions of matrices.