Habib,<div><br></div><div>Check the condition number of your matrix. If the condition number of the matrix is too high, iterative methods have a difficult time converging. Also, it is likely that the iterative algorithm requires your matrix to be symmetric, positive definite.</div>
<div><br></div><div>- Wes<br><br><div class="gmail_quote">On Wed, Jun 17, 2009 at 11:19 AM, Habib Baluwala <span dir="ltr"><<a href="mailto:habibbaluwala@gmail.com">habibbaluwala@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Arnaud ,<br>
It takes around 10 min to solve the linear system of equations. I<br>
also tried the vnl_sparse_matrix_linear_system but that too takes a long<br>
time for solving these equations.<br>
<br>
<br>
<br>
<br>
Arnaud Gelas wrote:<br>
><br>
> Habib,<br>
><br>
> Right, your matrix is not that large and is really sparse...<br>
> I am curious to know how long it takes to solve your system?<br>
><br>
> I am not so sure about the efficiency of vnl direct solver (LU<br>
> solver)... (Until recently, sparse iterative solver were really<br>
> efficient in comparison to direct ones, and this is still a very active<br>
> field of research!)<br>
> If you need to solve several times linear systems which involve the same<br>
> matrix, I would recommend to use a direct solver like LU, LLT, LDLT;<br>
> else an iterative solution like vnl_sparse_matrix_linear_system.<br>
><br>
><br>
> Arnaud<br>
><br>
><br>
><br>
> Habib Baluwala wrote:<br>
>> Hi Arnaud,<br>
>> The size of the matrix is around 40,000 rows and columns<br>
>> but<br>
>> the density is around 5 percent which is very small. I am using the<br>
>> vnl_sparse_matrix for reading the sparse matrix and then using the<br>
>> vnl_sparse_lu and for solving the equations. I thought that the blas and<br>
>> lapack libraries are linked with the linear solver but that does not seem<br>
>> to<br>
>> be the case or I am currently not using any pointers for the sparse<br>
>> matrix.<br>
>> Can this be a reason for the failure????? I look forward to yor reply<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> Arnaud Gelas wrote:<br>
>><br>
>>> Hi habbib,<br>
>>><br>
>>> How large is your matrix?<br>
>>> How sparse is your matrix? Do you know the number of non null elements<br>
>>> in your matrix? Or can you tell me the number of non null elements per<br>
>>> row (in average)?<br>
>>><br>
>>> Solving sparse linear system highly depends on the sparsity of your<br>
>>> matrix.<br>
>>> When you say I am "using VNL sparse system solver", what do you mean?<br>
>>> which class are you using?<br>
>>><br>
>>> Note that it is not because you use BLAS and LAPACK that the code will<br>
>>> be fast, it depends how they are used in in the library. For example<br>
>>> mumps, taucs are also based on blas and lapack and performances are<br>
>>> really different...<br>
>>><br>
>>> Arnaud<br>
>>><br>
>>> Habib Baluwala wrote:<br>
>>><br>
>>>> Hi everyone ,<br>
>>>> I am currently using a large sparse system of linear<br>
>>>> equation which is non-symmetric. I tried using VNL sparse system<br>
>>>> solvers<br>
>>>> but<br>
>>>> they are very slow , I can't still understand why they are slow because<br>
>>>> they<br>
>>>> are supposed to utilise the BLAS and Lapack libraries to speed up. Can<br>
>>>> anyone tell me how can I speed up the procedure???? I also tried the<br>
>>>> release<br>
>>>> instead of debug. It was able to reduce the time taken but not to a<br>
>>>> significant effect. Would including the Utilities folder in the<br>
>>>> CMakeFile.txt help ???<br>
>>>><br>
>>>> I look forward to your reply and sorry for any inconvenience.<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>> _____________________________________<br>
>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>><br>
>>> Please keep messages on-topic and check the ITK FAQ at:<br>
>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>>><br>
>>><br>
>>><br>
>><br>
>><br>
><br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
<br>
--<br>
View this message in context: <a href="http://n2.nabble.com/solving-large-linear-equations-tp3092477p3093457.html" target="_blank">http://n2.nabble.com/solving-large-linear-equations-tp3092477p3093457.html</a><br>
Sent from the ITK Insight Users mailing list archive at Nabble.com.<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>R&D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x120<br>
</div>