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

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

[Octave-bug-tracker] [bug #49389] inputParser changes order of Results s


From: Carlo de Falco
Subject: [Octave-bug-tracker] [bug #49389] inputParser changes order of Results structure depending on order by which parameters are assigned
Date: Fri, 21 Oct 2016 14:07:13 +0000 (UTC)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #5, bug #49389 (project octave):

@Rik 

Matlab does not keep struct keys sorted alphabetically
they are ordered according to the order in which they 
were added to the struct.

Indeed the properties returned by odeset are not in 
alphabetical order in Matlab either:


>> o = odeset ()

o = 

              AbsTol: []
                 BDF: []
              Events: []
         InitialStep: []
            Jacobian: []
           JConstant: []
            JPattern: []
                Mass: []
        MassSingular: []
            MaxOrder: []
             MaxStep: []
         NonNegative: []
         NormControl: []
           OutputFcn: []
           OutputSel: []
              Refine: []
              RelTol: []
               Stats: []
          Vectorized: []
    MStateDependence: []
           MvPattern: []
        InitialSlope: []


on the other hand they do not change with each assignment.

@Carnë

In inputParser.parse () the values passed are assigned first, 
then the the remaining Parameters are assigned the default value.

If we would assign the default value to all parameters first, 
then overwrite those passed to parse we would get the same behaviour
as Matlab, and it would propbably also run a bit faster.

But you are right that this does not seem to be a documented Matlab 
feature so we don't necessarily need to copy it.








    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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