[petsc-users] Vector Operations

吕超 luchao at mail.iggcas.ac.cn
Wed Dec 25 08:43:16 CST 2013




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?

       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. 

       I like the Petsc very much! Thank you for your work!

       Merry Christmas and Happy New Year!

yours sincely.

      



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131225/e128f4d1/attachment.html>


More information about the petsc-users mailing list