[petsc-users] Does PETSc have some functions like A.*B, A./B in Matlab?

Barry Smith bsmith at mcs.anl.gov
Sun Feb 21 15:03:18 CST 2010


    PETSc is not a parallel Matlab. You can now purchase a parallel  
Matlab from the Mathworks company if you want. We have no interest in  
competing with Matlab. PETSc is specialized to the parallel solution  
of PDEs and related problems,  it is not a general purpose package  
like Matlab and hence does not have much of the functionality of Matlab.

    Barry

On Feb 21, 2010, at 2:58 PM, Yujie wrote:

> At the beginning, I was just thinking whether PETSc has some similar  
> operations with Matlab like A./B or A.*B. To my understanding, PETSc  
> realizes a parallel operation version of Matlab regarding matrix  
> computations.
>
> Thanks,
> Yujie
>
> On Sun, Feb 21, 2010 at 2:54 PM, Jed Brown <jed at 59a2.org> wrote:
> On Sun, 21 Feb 2010 14:44:55 -0600, Yujie <recrusader at gmail.com>  
> wrote:
> > I need do it for many. Actually, we don't consider a vector.  
> Generally, if A
> > is dense matrix (nonzero entries) and B is sparse matrix,  
> MatGetRow()
> > doesn't work when doing A.*B or A./B directly, right?
>
> You can call MatGetRow with all column indices, you have to do  
> something
> special about dividing by zero.
>
> But we're getting caught up in algebraic shenanigans again.  What
> problem are you trying to solve?  Why do you have a dense matrix and  
> why
> do you think you need to perform A./B?
>
> Jed
>



More information about the petsc-users mailing list