[GiNaC-devel] [GiNaC-list] A strange behaviour while implementing archive in a user-defined class

Vladimir V. Kisil V.Kisil at leeds.ac.uk
Mon Dec 20 12:07:42 CET 2021


>>>>> On Mon, 20 Dec 2021 08:57:42 +0000, Oleg Finkelshteyn <olegfink at gmail.com> said:

    OF> i suspect this is actually due to a typo in
    OF> relational::compare_same_type.

    Thanks for spotting the source. It is worth to cross-post your patch
  to GiNaC-devel list.
-- 
Vladimir V. Kisil                 http://www.maths.leeds.ac.uk/~kisilv/
  Book:      Geometry of Mobius Maps       https://doi.org/10.1142/p835
  Soft:      Geometry of cycles         http://moebinv.sourceforge.net/
  Jupyter notebooks:        https://github.com/vvkisil?tab=repositories
====================================================
diff --git a/ginac/relational.cpp b/ginac/relational.cpp
index 599a2635..dbc541a3 100644
--- a/ginac/relational.cpp
+++ b/ginac/relational.cpp
@@ -223,8 +223,8 @@ int relational::compare_same_type(const basic & other) const
                                return (o < oth.o) ? -1 : 1;
                        break;
        }
-       const int lcmpval = lh.compare(oth.rh);
-       return (lcmpval!=0) ? lcmpval : rh.compare(oth.lh);
+       const int lcmpval = lh.compare(oth.lh);
+       return (lcmpval!=0) ? lcmpval : rh.compare(oth.rh);
}
 


More information about the GiNaC-devel mailing list