]> www.ginac.de Git - ginac.git/commitdiff
better error reporting for minimal_dim()
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 22 Jan 2003 20:05:21 +0000 (20:05 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 22 Jan 2003 20:05:21 +0000 (20:05 +0000)
ginac/idx.cpp
ginac/indexed.cpp

index 77beecb8de7fd2c6bd08a44320ef52bca5e8c1ff..fe1dab2921e1fc11f09ab6b3bd2d3e3317b46070 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <iostream>
+#include <sstream>
 #include <stdexcept>
 
 #include "idx.h"
@@ -548,8 +549,11 @@ ex minimal_dim(const ex & dim1, const ex & dim2)
                return dim1;
        else if (dim1 > dim2 || (is_a<symbol>(dim1) && is_exactly_a<numeric>(dim2)))
                return dim2;
-       else
-               throw (std::runtime_error("minimal_dim(): index dimensions cannot be ordered"));
+       else {
+               std::ostringstream s;
+               s << "minimal_dim(): index dimensions " << dim1 << " and " << dim2 << " cannot be ordered";
+               throw (std::runtime_error(s.str()));
+       }
 }
 
 } // namespace GiNaC
index b791bc2ee757e1ff4f10a082d3e0c69dc2170325..ee3694b3962e65c1d0e909815b25fd25204eef54 100644 (file)
@@ -876,14 +876,6 @@ public:
        {
                int comp = si1.symmterm.compare(si2.symmterm);
                if (comp < 0) return true;
-#if 0
-               if (comp > 0) return false;
-               comp = si1.orig.compare(si2.orig);
-               if (comp < 0) return true;
-               if (comp > 0) return false;
-               comp = si1.coeff.compare(si2.coeff);
-               if (comp < 0) return true;
-#endif
                return false;
        }
 };
@@ -894,14 +886,6 @@ public:
        {
                int comp = si1.orig.compare(si2.orig);
                if (comp < 0) return true;
-#if 0
-               if (comp > 0) return false;
-               comp = si1.symmterm.compare(si2.symmterm);
-               if (comp < 0) return true;
-               if (comp > 0) return false;
-               comp = si1.coeff.compare(si2.coeff);
-               if (comp < 0) return true;
-#endif
                return false;
        }
 };