HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
126 stars 50 forks source link

libhmat suggestion: dot product between vectors #45

Closed eunnieverse closed 8 years ago

eunnieverse commented 9 years ago

The following operations for HVector datatype will be useful.

dot product between vectors complex conjugate for all elements

HomerReid commented 9 years ago

In 5fd499bdae3bd232e16ef54f27bf198ff87a8b11 there are some new routines:

cdouble HVector::Dot(HVector *B);   /* hermitian dot product, this \cdot B */
cdouble HVector::DotU(HVector *B);  /* non-conjugated dot product */
double  HVector::DotD(HVector *B);  /* real part of Dot()       */

Also, HMatrix has a matrix-vector multiplication method:

   /* matrix-vector multiplication, this*X = Y (xgemv))      */
   /* Trans='C' or 'T' for hermitian / non-hermitian adjoint */
   void HMatrix::Apply(HVector *X, HVector *Y, char Trans=0);

(All of these routines are just wrappers around the level-1 and level-2 BLAS). Please let me know how they work.

eunnieverse commented 9 years ago

Row * Matrix * Vector operations can be simplified with HVector::Dot / HVector::DotU and HMatrix::Apply. Thank you! The issue is now closed.

On Wednesday, June 17, 2015, HomerReid notifications@github.com wrote:

In 5fd499b https://github.com/HomerReid/scuff-em/commit/5fd499bdae3bd232e16ef54f27bf198ff87a8b11 there are some new routines:

cdouble HVector::Dot(HVector B); / hermitian dot product, this \cdot B / cdouble HVector::DotU(HVector *B); / non-conjugated dot product / double HVector::DotD(HVector *B); / real part of Dot() */

Also, HMatrix has a matrix-vector multiplication method:

/* matrix-vector multiplication, thisX = Y (xgemv)) */ / Trans='C' or 'T' for hermitian / non-hermitian adjoint / void HMatrix::Apply(HVector X, HVector *Y, char Trans=0);

(All of these routines are just wrappers around the level-1 and level-2 BLAS). Please let me know how they work.

— Reply to this email directly or view it on GitHub https://github.com/HomerReid/scuff-em/issues/45#issuecomment-112736791.