A Systematic Approach for Obtaining Performance on Matrix-Like Operations