Revert "Revert "Matrix algebra class""

This reverts commit 127f09275a7b67093e4961a509e4d3b2bc0ea2e3.