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

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

[Octave-bug-tracker] [bug #65927] movfun: output shape incorrect for dim


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65927] movfun: output shape incorrect for dim>2
Date: Fri, 28 Jun 2024 09:38:57 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65927>

                 Summary: movfun: output shape incorrect for dim>2
                   Group: GNU Octave
               Submitter: nrjank
               Submitted: Fri 28 Jun 2024 09:38:56 AM EDT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: Confirmed
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 9.2.0
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: 9.3.0 (current stable)


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 28 Jun 2024 09:38:56 AM EDT By: Nicholas Jankowski <nrjank>
[https://stackoverflow.com/questions/78677245/the-movstd-function-swaps-output-matrix-dimensions
As pointed out over on Stackoverflow], it appears that movfun fails to return
correct dimensions for dim>2.  see below:


>> b = reshape (1:30, 5, 3, 2)
b =

ans(:,:,1) =

    1    6   11
    2    7   12
    3    8   13
    4    9   14
    5   10   15

ans(:,:,2) =

   16   21   26
   17   22   27
   18   23   28
   19   24   29
   20   25   30

> movfun(@mean, b, 2, 'dim', 1)
ans =

ans(:,:,1) =

    1.0000    6.0000   11.0000
    1.5000    6.5000   11.5000
    2.5000    7.5000   12.5000
    3.5000    8.5000   13.5000
    4.5000    9.5000   14.5000

ans(:,:,2) =

   16.000   21.000   26.000
   16.500   21.500   26.500
   17.500   22.500   27.500
   18.500   23.500   28.500
   19.500   24.500   29.500

>> movfun(@mean, b, 2, 'dim', 2)
ans =

ans(:,:,1) =

    1.0000    3.5000    8.5000
    2.0000    4.5000    9.5000
    3.0000    5.5000   10.5000
    4.0000    6.5000   11.5000
    5.0000    7.5000   12.5000

ans(:,:,2) =

   16.000   18.500   23.500
   17.000   19.500   24.500
   18.000   20.500   25.500
   19.000   21.500   26.500
   20.000   22.500   27.500

>> movfun(@mean, b, 2, 'dim', 3)
ans =

ans(:,:,1) =

    1.0000    8.5000
    6.0000   13.5000
   11.0000   18.5000

ans(:,:,2) =

    2.0000    9.5000
    7.0000   14.5000
   12.0000   19.5000

ans(:,:,3) =

    3.0000   10.5000
    8.0000   15.5000
   13.0000   20.5000

ans(:,:,4) =

    4.0000   11.5000
    9.0000   16.5000
   14.0000   21.5000

ans(:,:,5) =

    5.0000   12.5000
   10.0000   17.5000
   15.0000   22.5000


I suspect it's something to do with the permute/ipermute sequence  that forces
all operations along dim1, for simpler computation, but haven't had a chance
to investigate yet.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65927>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

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