/*! \brief Invert a complex matrix with double precision elements, using iterative refinement to improve accuracy.
/**
* \brief Perform Newton-Schulz iterative refinement of matrix inversion.
*
* Use LAPACKE64 to perform an in-place matrix inversion for a complex
* matrix with double precision elements.
* In this function the residual of the inversion of a matrix A is evaluated as:
*
* \param mat: Matrix of complex. The matrix to be inverted.
* \param n: `np_int` The number of rows and columns of the [n x n] matrix.
* \param jer: `int &` Reference to an integer return flag.
* \param maxrefiters: `int` Maximum number of refinement iterations.
* \param accuracygoal: `double &` Accuracy to achieve in iterative refinement, defined as the module of the maximum difference between the identity matrix and the matrix product of the (approximate) inverse times the original matrix. On return, it contains the actually achieved accuracy.
* \param refinemode: `int` Flag to control the refinement mode.
* R = A^-1 A - I
*
* and the convergence of refinement is estimated through the largest element