octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Where to patch bug #34549?


From: John W. Eaton
Subject: Where to patch bug #34549?
Date: Fri, 14 Oct 2011 20:23:13 -0400

On 14-Oct-2011, Jordi Gutiérrez Hermoso wrote:

| Re: bug #34549:
| 
|     http://savannah.gnu.org/bugs/?34549
| 
| On 14 October 2011 10:23, Jordi Gutiérrez Hermoso
| <address@hidden> wrote:
| > 2) This does indeed look like a bug. When automatically computing the visual
| > range for the image, we forgot to account for when the matrix used to 
compute
| > this range is complex.
| 
| I have an easy fix to this. In fact, I accidentally committed it
| earlier today. My question is, should this go on the stable branch or
| not? It's a relatively minor bug affecting stable, but it's so minor
| that I'm afraid to touch stable for it.

Your change was just to move the code that checks for complex images
and converts to real before the code that operates on the image?  It
seems OK to put that on stable, I guess, though there probably won't
be another 3.4.x release.

BTW, iscomplex may not be doing what the person who wrote that code
expects.  It is testing whether the underlying data structure is a
complex matrix, not whether any of the elements have imaginary parts.
For example

  iscomplex (complex (1, 0)) ==> true

I'm not sure, but I think !isreal may be the right check here.  If you
want to warn about non-zero imaginary parts and ensure that there are
no complex objects with zero imaginary parts slipping through, then
maybe doing

  if (! isreal (im))
    warning (...)
  endif

  im = real (im);

Calling real on a real-value object should be fast.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]