]> www.ginac.de Git - ginac.git/commitdiff
* Fix compilation issues with prereleases of GCC 4.3, at least in theory.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 2 Apr 2007 06:15:31 +0000 (06:15 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 2 Apr 2007 06:15:31 +0000 (06:15 +0000)
  See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417199>.

ginac/add.cpp
ginac/function.pl
ginac/indexed.cpp
ginac/integral.cpp
ginac/pseries.cpp
ginac/symmetry.cpp
ginac/symmetry.h

index c2db229168371c320fa7be763bb748ecb222ba2f..067f9bf73b578144295f3566a535c6f01fe10f5e 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <iostream>
 #include <stdexcept>
+#include <limits>
 
 #include "add.h"
 #include "mul.h"
@@ -256,7 +257,7 @@ bool add::info(unsigned inf) const
 
 int add::degree(const ex & s) const
 {
-       int deg = INT_MIN;
+       int deg = std::numeric_limits<int>::min();
        if (!overall_coeff.is_zero())
                deg = 0;
        
@@ -273,7 +274,7 @@ int add::degree(const ex & s) const
 
 int add::ldegree(const ex & s) const
 {
-       int deg = INT_MAX;
+       int deg = std::numeric_limits<int>::max();
        if (!overall_coeff.is_zero())
                deg = 0;
        
index 13abceb2655b248ba213867ebef2b0dddd118e25..d5c6245d5e030010751b71602122179ddec28fc6 100755 (executable)
@@ -508,6 +508,7 @@ $implementation=<<END_OF_IMPLEMENTATION;
 #include <string>
 #include <stdexcept>
 #include <list>
+#include <limits>
 
 #include "function.h"
 #include "operators.h"
@@ -871,7 +872,7 @@ ex function::eval(int level) const
                exvector v = seq;
                GINAC_ASSERT(is_a<symmetry>(opt.symtree));
                int sig = canonicalize(v.begin(), ex_to<symmetry>(opt.symtree));
-               if (sig != INT_MAX) {
+               if (sig != std::numeric_limits<int>::max()) {
                        // Something has changed while sorting arguments, more evaluations later
                        if (sig == 0)
                                return _ex0;
index 618efbceb3cf95adb5439773264591ad1d3ccb48..0b668cd7e593b151c9f169802e4ec501e2e502a7 100644 (file)
@@ -23,6 +23,7 @@
 #include <iostream>
 #include <sstream>
 #include <stdexcept>
+#include <limits>
 
 #include "indexed.h"
 #include "idx.h"
@@ -305,7 +306,7 @@ ex indexed::eval(int level) const
                exvector v = seq;
                GINAC_ASSERT(is_exactly_a<symmetry>(symtree));
                int sig = canonicalize(v.begin() + 1, ex_to<symmetry>(symtree));
-               if (sig != INT_MAX) {
+               if (sig != std::numeric_limits<int>::max()) {
                        // Something has changed while sorting indices, more evaluations later
                        if (sig == 0)
                                return _ex0;
index f4cf75d0090bc37212d3eabcfcf9356bd4bdadad..695fec800d5419f642f6d79975d895484a8edb24 100644 (file)
@@ -223,7 +223,7 @@ struct error_and_integral
 
 struct error_and_integral_is_less
 {
-       bool operator()(const error_and_integral &e1,const error_and_integral &e2)
+       bool operator()(const error_and_integral &e1,const error_and_integral &e2) const
        {
                int c = e1.integral.compare(e2.integral);
                if(c < 0)
index b63d46403b0dff179ed3eb328355db876de11923..d239777a2991c3646574ef860fdbab997f832421 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <numeric>
 #include <stdexcept>
+#include <limits>
 
 #include "pseries.h"
 #include "add.h"
@@ -287,7 +288,7 @@ int pseries::degree(const ex &s) const
                epvector::const_iterator it = seq.begin(), itend = seq.end();
                if (it == itend)
                        return 0;
-               int max_pow = INT_MIN;
+               int max_pow = std::numeric_limits<int>::min();
                while (it != itend) {
                        int pow = it->rest.degree(s);
                        if (pow > max_pow)
@@ -315,7 +316,7 @@ int pseries::ldegree(const ex &s) const
                epvector::const_iterator it = seq.begin(), itend = seq.end();
                if (it == itend)
                        return 0;
-               int min_pow = INT_MAX;
+               int min_pow = std::numeric_limits<int>::max();
                while (it != itend) {
                        int pow = it->rest.ldegree(s);
                        if (pow < min_pow)
@@ -653,7 +654,7 @@ ex pseries::add_series(const pseries &other) const
        epvector::const_iterator b = other.seq.begin();
        epvector::const_iterator a_end = seq.end();
        epvector::const_iterator b_end = other.seq.end();
-       int pow_a = INT_MAX, pow_b = INT_MAX;
+       int pow_a = std::numeric_limits<int>::max(), pow_b = std::numeric_limits<int>::max();
        for (;;) {
                // If a is empty, fill up with elements from b and stop
                if (a == a_end) {
@@ -786,8 +787,8 @@ ex pseries::mul_series(const pseries &other) const
        int cdeg_min = a_min + b_min;
        int cdeg_max = a_max + b_max;
        
-       int higher_order_a = INT_MAX;
-       int higher_order_b = INT_MAX;
+       int higher_order_a = std::numeric_limits<int>::max();
+       int higher_order_b = std::numeric_limits<int>::max();
        if (is_order_function(coeff(var, a_max)))
                higher_order_a = a_max + b_min;
        if (is_order_function(other.coeff(var, b_max)))
@@ -808,7 +809,7 @@ ex pseries::mul_series(const pseries &other) const
                if (!co.is_zero())
                        new_seq.push_back(expair(co, numeric(cdeg)));
        }
-       if (higher_order_c < INT_MAX)
+       if (higher_order_c < std::numeric_limits<int>::max())
                new_seq.push_back(expair(Order(_ex1), numeric(higher_order_c)));
        return pseries(relational(var, point), new_seq);
 }
index 4044ee26787c559964993dc6b3d3060e681344f2..f1cc67cbc4da29b9b3a489d7bcf2f06bad736f2c 100644 (file)
@@ -23,6 +23,7 @@
 #include <iostream>
 #include <stdexcept>
 #include <functional>
+#include <limits>
 
 #include "symmetry.h"
 #include "lst.h"
@@ -361,7 +362,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
 {
        // Less than two elements? Then do nothing
        if (symm.indices.size() < 2)
-               return INT_MAX;
+               return std::numeric_limits<int>::max();
 
        // Canonicalize children first
        bool something_changed = false;
@@ -372,7 +373,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
                int child_sign = canonicalize(v, ex_to<symmetry>(*first));
                if (child_sign == 0)
                        return 0;
-               if (child_sign != INT_MAX) {
+               if (child_sign != std::numeric_limits<int>::max()) {
                        something_changed = true;
                        sign *= child_sign;
                }
@@ -399,7 +400,7 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
                default:
                        break;
        }
-       return something_changed ? sign : INT_MAX;
+       return something_changed ? sign : std::numeric_limits<int>::max();
 }
 
 
index 46bdae28ad340b9892cd106e0d5ca20cc39449e9..b97abf80844e250ae1912e57a2feb360600bda93 100644 (file)
@@ -136,7 +136,7 @@ const symmetry & antisymmetric4();
  *  @param v Start of expression vector
  *  @param symm Root node of symmetry tree
  *  @return the overall sign introduced by the reordering (+1, -1 or 0)
- *          or INT_MAX if nothing changed */
+ *          or numeric_limits<int>::max() if nothing changed */
 extern int canonicalize(exvector::iterator v, const symmetry &symm);
 
 /** Symmetrize expression over a set of objects (symbols, indices). */