<div dir="ltr">My main project is written in R that's why I need a wrapper function of ICC(0) in order to call it from R. I tried the IncompleteCholesky() in rcppEigen, basically the Eigen library but it turns out to be a modified incomplete Cholesky. Beside that, I didn't find any incomplete Cholesky functions available in R so I turned to the petsc.<div><br></div><div>I will apply this ICC for very big sparse matrix and hope the function to have almost linear computation complexity. I didn't write the function by myself because it might be too slow comparing to an well-written and optimized ICC() in existing C/C++ library. </div><div><br></div><div>-Wendy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 5, 2017 at 1:49 PM, Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
> On Dec 5, 2017, at 9:32 AM, Wenlong Gong <<a href="mailto:wenlonggong@gmail.com">wenlonggong@gmail.com</a>> wrote:<br>
><br>
> Barry, Thank you for the reply! It makes sense If two IC() function returns slightly different factored matrix. But the IC factor matrix from PETSc is not even close to what I get from ichol in Matlab.<br>
> Ultimately I need this incomplete cholesky factorization function wrapped in R once it gives correct result.<br>
<br>
</span> What do you mean by wrapped in R?<br>
<br>
Does R not have a ICC(0)? ICC(0) with the natural ordering is actually very simple to write. You could easily write it presumably directly in R or in C in a format callable from R.<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> Not sure if I used the easiest way to get IC so I also seek for help on getting a concise version of IC().<br>
><br>
> -Wendy<br>
><br>
><br>
> On Mon, Dec 4, 2017 at 10:07 PM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
> I'm not sure what your goal is. In general two different IC(0) codes might produce slightly different factorizations based on implementation details even if they claim to run the same algorithm so I don't think there is a reason to try to compare the factors they produce.<br>
><br>
> In addition PETSc, as well as most IC/ILU/LU codes store the factored matrices in a "non-conventional" form that is optimized for performance so it is not easy to just pull out the "factors" to look at them or compare them.<br>
><br>
> Barry<br>
><br>
><br>
> > On Dec 4, 2017, at 9:07 PM, Wenlong Gong <<a href="mailto:wenlonggong@gmail.com">wenlonggong@gmail.com</a>> wrote:<br>
> ><br>
> > Hello,<br>
> ><br>
> > I'm trying to use the Incomplete Cholesky Factorization for a sparse matrix in petsc. I started with a 10*10 matrix and used ksp and pc in order to get the ICC(0) factor, with no fill-in, natural ordering. However, the returned factor matrix does not match with the answer I got from matlab ichol() function.<br>
> ><br>
> > The code with the hard-coded data is attached here. I would appreciate if anyone could help check if I did anything wrong.Please let me know if there is easier way to get this incomplete cholesky factor. Thanks!<br>
> ><br>
> > Best regards,<br>
> > Wendy<br>
> ><br>
> > <repex.c><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>