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

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

[Octave-bug-tracker] [bug #30114] perms generates different results to m


From: David Bateman
Subject: [Octave-bug-tracker] [bug #30114] perms generates different results to matlab
Date: Fri, 11 Jun 2010 21:39:14 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009091010 Iceweasel/3.0.14 (Debian-3.0.14-1)

Update of bug #30114 (project octave):

                  Status:               Need Info => Wont Fix               

    _______________________________________________________

Follow-up Comment #4:

The page

http://www.mathworks.com/access/helpdesk/help/techdo/ref/perms.html

doesn't document that the behavior of perms has this nature and so there is
no guarantee that matlab will continue to respect the ordering of the
permutations... So this is hardly a bug..

Looking at what the page above says perms([2 4 6]) returns, you'll see

     6     4     2
     6     2     4
     4     6     2
     4     2     6
     2     4     6
     2     6     4

So this isn't a lexicographical sort in descending order as the last two rows
are in ascending order. So as far as I can see there is no logic in the manner
in which matlab sorts its rows of permutation vectors.. Reproducing matlab
behavior in this case seems counter productive to me.

What I suggest you do is to run "sortrows(perm([1,2,3,4]))" in your code to
ensure a consistent ordering for both matlab and octave

D.

 

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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