next up previous contents
Next: Function: productc() Up: GRASP Routines: General purpose Previous: Function: clear()   Contents

Function: product()

0 void product(float *c,float *a, float *b,int ncomplex) This routine takes as input a pair of arrays $a$ and $b$ containing complex numbers. It multiplies $a$ with $b$, placing the result in $c$, so that $c = a \times b$. The arguments are:
a: Input. An array of $N$ complex numbers a[0..2N-1] with a[2j] and a[2j+1] respectively containing the real and imaginary parts.
b: Input. An array of $N$ complex numbers b[0..2N-1] with b[2j] and b[2j+1] respectively containing the real and imaginary parts.
c: Output. The array of $N$ complex numbers c[0..2N-1] with c[2j] and c[2j+1] respectively containing the real and imaginary parts of $a \times b$.
ncomplex: Input. The number $N$ of complex numbers in the arrays.
Note that the two input arrays a[ ] and b[ ] can be the same array; or the output array c[ ] can be the same as either or both of the inputs. For example, the following are all valid:
product(c,a,a,n), which performs the operation $a^2 \rightarrow c$.
product(a,a,b,n), which performs the operation $a \times b \rightarrow a$.
product(a,b,a,n), which performs the operation $a \times b \rightarrow a$.
product(a,a,a,n), which performs the operation $a^2 \rightarrow a$.
Note also that this routine does not allocate any memory itself - your input and output arrays must be allocated before calling product().
Author: Bruce Allen, ballen@dirac.phys.uwm.edu
Comments: None.


next up previous contents
Next: Function: productc() Up: GRASP Routines: General purpose Previous: Function: clear()   Contents
Bruce Allen 2000-11-19