octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #31823] floor/ceil caching causing incorrect b


From: anonymous
Subject: [Octave-bug-tracker] [bug #31823] floor/ceil caching causing incorrect behavior when concatenating
Date: Wed, 08 Dec 2010 09:26:40 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12

URL:
  <http://savannah.gnu.org/bugs/?31823>

                 Summary: floor/ceil caching causing incorrect behavior when
concatenating
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 08 Dec 2010 09:26:38 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Alex
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Each of the four columns of Wx has width 1, but Wx has width 6.

Calculating each column and storing it in a variable, then concatenating
those variables does NOT result in an error.

In the following code:
    n is a scalar
    Gx and Gy are vectors of the same length
    nnz is 4 times that length


    size(n*(floor(Gx)-1)+floor(Gy))
    size(n*(ceil(Gx)-1) +floor(Gy))
    size(n*(floor(Gx)-1)+ceil(Gy)) 
    size(n*(ceil(Gx)-1) +ceil(Gy)) 

    Wx = [  n*(floor(Gx)-1)+floor(Gy) , ...
            n*(ceil(Gx)-1) +floor(Gy) , ...
            n*(floor(Gx)-1)+ceil(Gy)  , ...
            n*(ceil(Gx)-1) +ceil(Gy)  ];

    Wx = reshape(Wx,[nnz,1]);


The exact output is as follows:


octave:3> W = registration(m,n,0.5,0.5,0,1,0);
ans =

   147576        1

ans =

   147576        1

ans =

   147576        1

ans =

   147576        1

error: reshape: can't reshape 147576x6 array to 590304x1 array


omitting the reshape and using vertical concatenation gives:


ans =

   147576        1

ans =

   147576        1

ans =

   147576        1

ans =

   147576        1

error: number of columns must match (2 != 1)


The error occurs both when preallocating Wx and when no preallocating Wx.

I installed the image processing package off what i think is a clean install
of 3.2.2.
http://octave.sourceforge.net/image/index.html

This problem also occured on 3.0.5 which prompted the reinstall.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 08 Dec 2010 09:26:38 AM UTC  Name: registration.m.buggy  Size: 1kB 
 By: None
file containing the bug inducing code
<http://savannah.gnu.org/bugs/download.php?file_id=22158>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31823>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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