[petsc-dev] various dot products messed up for complex numbers?

Barry Smith bsmith at mcs.anl.gov
Tue Apr 17 21:09:34 CDT 2012


   Since PETSc was written and always implemented with mathematician style* inner products, I have decided to keep it that way and call the BLASdot_() with the arguments reversed. Note that until Matt added the support for zdotc() we never called the BLAS for complex inner products and thus never used the engineers style inner products.

    Please report any problems,

    Barry

* please do not be upset by my joking reference to mathematician and engineering style inner products.


On Apr 15, 2012, at 1:09 PM, Jed Brown wrote:

> On Sun, Apr 15, 2012 at 12:55, Barry Smith <bsmith at mcs.anl.gov> wrote:
>   Real mathematicians conjugate the second one :-)
> 
> I never unrderstood that choice. I like vectors to be column vectors, one forms to be row vectors, and operations to have standard fixity. How some mathematicians ended up with infix operators and postfix inner products is beyond me.
>  
> 
>   The code to check is PETSc's conjugate gradient, there the conjugate does mater :-).
> 
> Looks right to me.
> 
>        ierr = KSP_MatMult(ksp,Amat,P,W);CHKERRQ(ierr);          /*     w <- Ap         */
>        ierr = VecXDot(P,W,&dpi);CHKERRQ(ierr);                  /*     dpi <- p'w     */
> 




More information about the petsc-dev mailing list