Merge pull request #99 from fegin/optimization

Optimization bugs fixed
Merge remote-tracking branch 'upstream/master' into from_file_parallel
Adjust matrix type