[Insight-users] How to solve linear equations in ITK at a faster rate????

Arnaud Gelas arnaud_gelas at hms.harvard.edu
Mon Jun 8 13:38:03 EDT 2009


Hi Habib,

It really depends on the kind of linear system you want to solve.

Since you are using vnl_sparse_lu, I assume the matrix involved in the 
linear system is sparse. Right?
I would recommend to use vnl_sparse_lu if you need to inverse several 
times the same matrix. It avoids computing to many times the LU 
decomposition...
If you need a quick resolution, you could try an iterative solution with 
vnl_sparse_matrix_linear_system.

Note that the speed really depends on how sparse your matrix is!!!
Note that the time difference between release mode could be about 10 to 
20 times faster than debug mode...
If you are really searching for efficiency (cause you need to get faster 
results), and you don't have any licence issues, there are bunch of 
libraries out there to solve sparse linear system very very very 
efficiently, like: MUMPS, TAUCS, CHOLMOD...

Regards,
Arnaud

Habib Baluwala wrote:
> Hi everyone , 
>                   I needed help in solving the a set of large number of
> linear equations in ITK. I am currently using the following list of programs 
>
> vnl_vector<double>x(2*TotVox,0);
> vnl_sparse_lu linear_solver(A, vnl_sparse_lu::estimate_condition);
> linear_solver.solve(b,&x);
>
> where S is a sparse matrix and b is a vector with all the values and x is
> the solution that we get at the end of the equation . for a 256*256*2 no of
> linear equations it takes around 20 minutes which is very large as Matlab
> solves it in 30 seconds. I look forward to your reply and any help is
> appreciated.   
>   



More information about the Insight-users mailing list