Mercurial > octave-nkf
comparison scripts/general/cplxpair.m @ 5831:b0d4ff99a0c5
[project @ 2006-05-26 21:06:00 by jwe]
author | jwe |
---|---|
date | Fri, 26 May 2006 21:06:00 +0000 |
parents | 27c966e4b2dc |
children | 34f96dd5441b |
comparison
equal
deleted
inserted
replaced
5830:0bb816a28335 | 5831:b0d4ff99a0c5 |
---|---|
21 ## @deftypefn {Function File} {} cplxpair (@var{z}, @var{tol}, @var{dim}) | 21 ## @deftypefn {Function File} {} cplxpair (@var{z}, @var{tol}, @var{dim}) |
22 ## Sort the numbers @var{z} into complex conjugate pairs ordered by | 22 ## Sort the numbers @var{z} into complex conjugate pairs ordered by |
23 ## increasing real part. With identical real parts, order by increasing | 23 ## increasing real part. With identical real parts, order by increasing |
24 ## imaginary magnitude. Place the negative imaginary complex number | 24 ## imaginary magnitude. Place the negative imaginary complex number |
25 ## first within each pair. Place all the real numbers after all the | 25 ## first within each pair. Place all the real numbers after all the |
26 ## complex pairs (those with @code {abs ( imag (@var{z}) / @var{z}) < | 26 ## complex pairs (those with @code{abs (imag (@var{z}) / @var{z}) < |
27 ## @var{tol}}), where the default value of @var{tol} is @code{100 * | 27 ## @var{tol})}, where the default value of @var{tol} is @code{100 * |
28 ## @var{eps}}. | 28 ## @var{eps}}. |
29 ## | 29 ## |
30 ## By default the complex pairs are sorted along the first non-singleton | 30 ## By default the complex pairs are sorted along the first non-singleton |
31 ## dimension of @var{z}. If @var{dim} is specified, then the complex | 31 ## dimension of @var{z}. If @var{dim} is specified, then the complex |
32 ## pairs are sorted along this dimension. | 32 ## pairs are sorted along this dimension. |
35 ## all complex numbers to be exact conjugates within tol, or signals an | 35 ## all complex numbers to be exact conjugates within tol, or signals an |
36 ## error. Note that there are no guarantees on the order of the returned | 36 ## error. Note that there are no guarantees on the order of the returned |
37 ## pairs with identical real parts but differing imaginary parts. | 37 ## pairs with identical real parts but differing imaginary parts. |
38 ## | 38 ## |
39 ## @example | 39 ## @example |
40 ## cplxpair (exp(2i*pi*[0:4]'/5)) == exp(2i*pi*[3; 2; 4; 1; 0]/5) | 40 ## cplxpair (exp(2i*pi*[0:4]'/5)) == exp(2i*pi*[3; 2; 4; 1; 0]/5) |
41 ## @end example | 41 ## @end example |
42 ## @end deftypefn | 42 ## @end deftypefn |
43 | 43 |
44 ## TODO: subsort returned pairs by imaginary magnitude | 44 ## TODO: subsort returned pairs by imaginary magnitude |
45 ## TODO: Why doesn't exp(2i*pi*[0:4]'/5) produce exact conjugates. Does | 45 ## TODO: Why doesn't exp(2i*pi*[0:4]'/5) produce exact conjugates. Does |