refactored linalg's sum methods
refactored the rest of linalg
Merge pull request #2374 from khalednasr/feature/linalg

refactored linalg's matrix sum methods