Skip to content
Snippets Groups Projects
Commit ee5ce55b authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

separate first inversion from refinement

parent c0a56cfd
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,7 @@
/*! \brief Invert a complex matrix with double precision elements.
*
* Use MAGMA to perform an in-place matrix inversion for a complex
* matrix with double precision elements.
* call magma_zinvert1() to do the actual inversion
*
* \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.
......@@ -35,11 +34,22 @@
*/
void magma_zinvert(dcomplex **mat, np_int n, int &jer, int device_id=0);
/*! \brief Invert a complex matrix with double precision elements, applying iterative refinement of the solution
/*! \brief Auxiliary function to Invert a complex matrix with double precision elements.
*
* Use MAGMA to perform an in-place matrix inversion for a complex
* matrix with double precision elements.
*
* \param inva: reference to the pointer to the first element of the matrix to be inverted on entry, inverted matrix on exit.
* \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 device_id: `int` ID of the device for matrix inversion offloading.
*/
void magma_zinvert1(dcomplex * &inva, np_int n, int &jer, int device_id);
/*! \brief Invert a complex matrix with double precision elements, applying iterative refinement of the solution
*
* call magma_zinvert1() to perform the first matrix inversion, then magma_refine() to do the refinement (only if maxrefiters is >0)
*
* \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.
......@@ -49,4 +59,18 @@ void magma_zinvert(dcomplex **mat, np_int n, int &jer, int device_id=0);
*/
void magma_zinvert_and_refine(dcomplex **mat, np_int n, int &jer, int &maxrefiters, double &accuracygoal, int refinemode, int device_id);
/*! \brief apply iterative refinement of the solution of a matrix inversion
*
* iteratively compute and apply a correction to the inverse inva of the complex matrix aorig, for a maximum number of maxiters times, or until achieving a maximum residual better than accuracygoal
*
* \param aorig: pointer to the first element of the matrix of complex to be inverted.
* \param inva: pointer to the first element of inverse.
* \param n: `np_int` The number of rows and columns of the [n x n] matrices.
* \param jer: `int &` Reference to an integer return flag.
* \param maxrefiters: `int` Maximum number of refinement iterations to apply.
* \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 device_id: `int` ID of the device for matrix inversion offloading.
*/
void magma_refine(dcomplex *aorig, dcomplex *inva, np_int n, int &jer, int &maxrefiters, double &accuracygoal, int refinemode, int device_id);
#endif
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment