吕超 <[email protected]> writes:

> Hello!
>
>        Recently, I am writing a program using Petsc, and I encouter a 
> questions.
>
>        the question is as follow:
>
>        In matlab, if a=[1,2,3,4,5], b = [2,2,2,2,2], we can use c=a.*b to get 
> c = [2,4,6,8,10]. This operation is called array multiply in matlab.
>
>        But in Petsc' Vec operations, I can't find a counterpart. So, I want 
> to kown how can I  get c = a.*b in Petsc. Can you help me?

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecPointwiseMult.html

>        I have tried to implement it by using the Petsc's 
> function-VecGetValues().
>
>        But in parallel program, some erros like "undeclared here (not in a 
> function)" always appear. 

Always send the entire error message.

Attachment: pgpu0qOEEkObi.pgp
Description: PGP signature

Reply via email to