bugGNU Octave - Bugs: bug #34260, bwdist macro igiving incorrect...

 
 

bug #34260: bwdist macro igiving incorrect result on x86_64 systems

Submitter:  Jeffrey Cunningham <jkcunningham>
Submitted:  Fri 09 Sep 2011 09:16:03 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Octave Forge Assigned to:  None
Originator Name:  Jeffrey Cunningham Open/Closed:  * Closed
Release:  * 3.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 09 Sep 2011 09:34:06 PM UTC, comment #1: 

Sigh...

You're reporting a bug with an Octave-Forge package to the core Octave developers. Supposedly, these are two different projects, but I'm trying to fix this:

http://octave.1599824.n4.nabble.com/Octave-Forge-bugs-in-the-tracker-tp3686525p3800542.html

but in the meantime, I've CC'ed the Octave-Forge mailing list so they can see about this problem.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Fri 09 Sep 2011 09:16:03 PM UTC, original submission:  

I am working with the __bwdist.cc code and found that this macro:

#define DIST_EUCLIDEAN(x,y) ((int)(x)*(x) + (y)*(y))

isn't being expanded correctly, as it produces negative results inside this loop:

        euclidean(bw, rows, cols, xdist, ydist);
        /* Remember sqrt() for the final output */
        for(int i=0; i<rows*cols; i++) {
          D(i) = sqrt((double)DIST_EUCLIDEAN(xdist[i], ydist[i]));
        }


Changing it to this fixes it:

#define DIST_EUCLIDEAN(x,y) ((double)(x)*(x) + (double)(y)*(y))


Regards,
Jeff Cunningham

Jeffrey Cunningham <jkcunningham>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by jordigh
  • -email is unavailable- added by jkcunningham (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-09 jordigh StatusNone Octave Forge
        Open/ClosedOpen Closed
        Carbon-Copy- Added "octave forge list" <octave-dev@lists.sourceforge.net>

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code