Question about two Factorization functions

junwang at uwm.edu junwang at uwm.edu
Wed May 23 10:52:51 CDT 2007


Hi,
    I am trying to know the difference bewteen the following two functions:
    MatCholeskyFactorNumeric_SeqSBAIJ_2(Mat A,MatFactorInfo *info,Mat *B);
    MatCholeskyFactorNumeric_SeqSBAIJ_2_NaturalOrdering(Mat A,MatFactorInfo
*info,Mat *B);

    Suppose I have a matrix "mat" stored in the SBAIJ format, the block size is
2. When i am running the following code, it seems it calling the second
NatrualOrdering function:

    ierr = MatCreateSeqSBAIJ(PETSC_COMM_SELF,2,6,6,0,nnz,&mat);CHKERRQ(ierr);

    IS perm,colp;
    MatGetOrdering(mat,MATORDERING_NATURAL,&perm,&colp);
    ierr = ISDestroy(colp);CHKERRQ(ierr);
    MatFactorInfo info;
    info.fill=1.0;
    Mat result;
    ierr = MatCholeskyFactorSymbolic(mat,perm,&info,&result); CHKERRQ(ierr);
    ierr = MatCholeskyFactorNumeric(mat,&info,&result);CHKERRQ(ierr);

    However, since the first function is not naturalordering, does that mean i
don't have to call the MatGetOrdering before I  call MatCholeskyFactor....().
If so, does that mean, it will reduce the time cost since it doesn't have to do
the ordering part.
    Is anyone can give any idea and give me a example for calling the first
function to do the factorization. Thank you very mcuh!

Jun





More information about the petsc-users mailing list