cached inverse for matrix