Creation of the 2 functions

Functions that save memory in a matrix and its inverse, and if the
array is not changed, then the inverse matrix is not recalculated