From bug-octave-request at bevo dot che dot wisc dot edu Thu May 27 18:38:08 1999 Subject: Bug in comparation of complex matrices From: "John W. Eaton" To: Stefan Pesko Cc: bug-octave at bevo dot che dot wisc dot edu, Michal Kaukic Date: Thu, 27 May 1999 18:38:05 -0500 (CDT) On 26-May-1999, Stefan Pesko wrote: | I have a problem with minimum of two complex matrices | x = min(a,b0 | where | a = [1,1+0.002i] | b = [0.002i,4] | with | x = [0,1] | and not correct result | x = [2i,1+0.002i] | as in matlab. | | Thanks | Stefan Please try the following patch. Thanks, jwe --- src/minmax.cc~ Sun Nov 3 02:22:47 1996 +++ src/minmax.cc Thu May 27 18:32:24 1999 at @ -169,7 +169,7 @@ { int columns_are_real_only = 1; for (int i = 0; i < nr; i++) - if (imag (a (i, j)) != 0.0 && imag (b (i, j)) != 0.0) + if (imag (a (i, j)) != 0.0 || imag (b (i, j)) != 0.0) { columns_are_real_only = 0; break; at @ -327,7 +327,7 @@ { int columns_are_real_only = 1; for (int i = 0; i < nr; i++) - if (imag (a (i, j)) != 0.0 && imag (b (i, j)) != 0.0) + if (imag (a (i, j)) != 0.0 || imag (b (i, j)) != 0.0) { columns_are_real_only = 0; break;