# Thread: how can I get the inverse matrix in the sparse format

1. ## how can I get the inverse matrix in the sparse format

I want to solve the huge matrix of linear equations ,so I have to use the sparse matrix format to obtain my answers.

Hence,I use the imsl_f_lin_sol_gen_coordinate to solve the A*x=b
In order to obtain the x,I very expect to get the inverse of A.

So in the imsl_f_lin_sol_gen_coordinate how can I to obtain the inverse of A matrix??
Is the IMSL_RETURN_SPARSE_LU_FACTOR can complete my wishes?

I use the IMSL C Numerical Libraries version6.0

P.S.
the problem I met is sovling for x in a linear equation of A*x=b
A is a fixed huge matrix.
So I think to obtain the inverse of A ,then get the answer x=A(-1)*b one by one
That is a best way to get the answer.  Reply With Quote

2. Computing the inverse is not necessary or advisable.

See Example 2 of the documentation for imsl_f_lin_sol_gen_coordinate in the CNL 6 online help. That example uses optional arguments IMSL_SUPPLY_SPARSE_LU_FACTOR and IMSL_SOLVE_ONLY to compute the solution with a previously factored A and a new right hand side.

hth,
w  Reply With Quote

3. thanks a lot

I have tried the method you mention, IMSL_SUPPLY_SPARSE_LU_FACTOR and IMSL_SOLVE_ONLY

and I also used the
imsl_d_lin_sol_gen for IMSL_INVERSE , &p_inva to solve the linear equations

I found that two methods are nearly the same time-consuming for solving equations

So I want to ask for anyone who know about how to efficiently solving for very huge sparse matrix(such as A=* or more)?
or have some useful software to use for large sparse matrix solving

The problem I met is about solving A*x=b for many times(more than one million )
and the matrix A is fixed and the right hand side matrix B is all different  Reply With Quote

4. Originally Posted by omega Computing the inverse is not necessary or advisable.

See Example 2 of the documentation for imsl_f_lin_sol_gen_coordinate in the CNL 6 online help. That example uses optional arguments IMSL_SUPPLY_SPARSE_LU_FACTOR and IMSL_SOLVE_ONLY to compute the solution with a previously factored A and a new right hand side.

hth,
w
May I ask for how the IMSL_RETURN_SPARSE_LU_FACTOR and IMSL_SUPPLY_SPARSE_LU_FACTOR and IMSL_SOLVE_ONLY work?

Is the IMSL_RETURN_SPARSE_LU_FACTOR solve for LU decompostiton of A matrix,and then the IMSL_SUPPLY_SPARSE_LU_FACTOR and IMSL_SOLVE_ONLY solve by using the back_substitution routine repeatedly?  Reply With Quote