Update from template to cache matrix inverse.