How to find the inverse rectangular matrix in C using GSL

I searched on Google and I could not find a function to calculate the inverse of a rectangular matrix using GSL. Since it was hard to find, the answer here would help others when they needed to find the inverse rectangular matrix. If this is not possible with GSL, please suggest an alternative library that is easy to use and provides the inverse shape of a rectangular matrix.

+4
source share
1 answer

Yes it is possible! You probably did not fix it, because it is in the chapter "Linear Algebra" and not "Matrices".

In GSL, you first compute the LU decomposition, and then use it to determine the opposite through

int gsl_linalg_LU_invert (const gsl_matrix * LU, const gsl_permutation * p, gsl_matrix * reverse)

See here for a detailed example https://lists.gnu.org/archive/html/help-gsl/2008-11/msg00001.html

+2
source

Source: https://habr.com/ru/post/1496972/


All Articles