TODO: Implement various matrix manipulations.