.Complex.'*'.scalarProduct

Scalar product of two complex vectors c1 and c2

Information

This function returns the scalar product of two given vectors of Complex numbers of length n.

c3 = sum(conj(c1[k]) * c2[k] for k in 1:n)

Interface

function scalarProduct
  import Complex;
  input Complex c1[:] "Vector of Complex numbers 1";
  input Complex c2[size(c1, 1)] "Vector of Complex numbers 2";
  output Complex c3 "Scalar product of c1 and c2";
end scalarProduct;

Revisions

Important bug fix note: The scalar product function was originally implemented without conjugating the argument c1. This issue is fixed based on #1260.
Generated at 2025-06-02T18:20:49Z by OpenModelicaOpenModelica 1.25.0 using GenerateDoc.mos