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

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

[Octave-bug-tracker] [bug #61473] unexpected results from eq


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #61473] unexpected results from eq
Date: Sun, 14 Nov 2021 10:01:50 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53

Follow-up Comment #7, bug #61473 (project octave):

That's probably due to some obscure logic that TheMathworks used when
implementing `isequal`. Octave does the same for compatibility.
See also these programming notes at the beginning of `isequal.m`. In
particular 1.b. and 4.b.:

## Algorithm:
##
## 1. Verify the class of x.
##    a. All objects are of the same class
##    b. All objects are of a generic "numeric" class which includes
##       numeric, logical, and character arrays
## 2. Verify size of all objects match.
## 3. Convert objects to struct, and then compare as stated below.
## 4. For each argument after x, compare it for equality with x:
##    a. char       compare each member with strcmp
##    b. numeric    compare each member with '==' with sparsity regarded
##    c. struct     compare number of fieldnames, value of fieldnames,
##                  and then each field with isequal (recursive)
##    d. cellstr    compare each cellstr member with strcmp
##    e. cell       compare each member with isequal (recursive)
##    f. fcn_handle compare using overloaded "eq" operator


There might still be some edge cases where Octave's `isequal` works
differently from Matlab's. This case however isn't.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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