Add basic matrix calculation

This is a very naive version of matrix calculation, but it should work
as a demonstration.