Merge pull request #2367 from khalednasr/feature/linalg

refactored linalg's dot product
refactored linalg's sum methods