Hi,<br><br>I am new to PETSc and I wanted to solve some least squares problems with it. On searching the net I found that KSPLSQR() and KSPCGNE() solve the least squares system |Ax-b|<br><br>But I don&#39;t really know how to use these functions to get my answer. This manual page did not help: <a href="http://www.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/KSP/KSPLSQR.html">http://www.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/KSP/KSPLSQR.html</a><br>
<br>Apparently no tutorial code uses these functions. <br><br>If anyone could could give a small code snippet of how to use these functions (assuming A and b are given) then it would be really helpful. <br><br>Thanks,<br>
<br>Gaurish<br>