Next: cprdcj() Up: MacAnova Help File Previous: cpolar()   Contents

cprdc()

Usage:
cprdc(cx1 [, cx2]), cx1 and cx2 REAL matrices representing complex data



Keywords: time series, complex arithmetic
                                  Usage
cprdc(cx1, cx2) computes the element wise complex multiplication of
fully complex (pairs of columns constitute real and imaginary parts)
matrices cx1 and cx2.  When cx1 or cx2 has an odd number of columns, it
is augmented with a column of zeros before multiplication.

cprdc(cx) is equivalent to cprdc(cx,cx).

When cx1 or cx2 represents a complex scalar (nrows(cx1) = 1 and
ncols(cx1) <= 2 or nrows(cx2) = 1 and ncols(cx2) <= 2), cprdc()
multiplies every element of the other argument by that scalar.  For
example,

  Cmd> i_times_cx <- cprdc(vector(0,1)',cx)

multiplies cx by i = sqrt(-1).

When nrows(cx1) = 1 or nrows(cx2) = 1, cprdc() multiplies each row in
the other argument by that single row.

When cx1 or cx2 represents a single complex series (ncols(cx1) <= 2 or
ncols(cx2) <= 2), cprdc() multiplies each series in the other argument
by that series.

It is an error when both nrows(cx1) > 1 and nrows(cx2) > 1 and
nrows(cx1) != nrows(cx2), or when both ncols(cx1) > 2 and ncols(cx2) > 2
and ceiling(ncols(cx1)/2) != ceiling(ncols(cx2)/2) (the number of
complex series represented differs).

                                Examples
Examples:
  When ncols(cx1) = 2 and ncols(cx2) = 5, cprdc(cx1,cx2) is equivalent to
  cprdc(hconcat(cx1,cx1,cx1),hconcat(cx2,rep(0,nrows(cx2))))

  When a and b are REAL scalars, cprdc(cmplx(a,b),cx) computes the
  complex scalar product of a + b*i and cx.

                            Cross references
See also cprdcj(), hprdh(), hprdhj(), cdivc(), cdivcj(), hdivh(),
hdivhj(), hconcat(), rep(), nrows(), ncols().

See topic 'complex' for discussion of complex matrices in MacAnova.

See subtopic 'matrices:"complex_matrices" for a list of macros for
working with complex matrices.


Gary Oehlert 2005-08-12