See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417199>.
#include <iostream>
#include <stdexcept>
+#include <limits>
#include "add.h"
#include "mul.h"
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;
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;
#include <string>
#include <stdexcept>
#include <list>
+#include <limits>
#include "function.h"
#include "operators.h"
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;
#include <iostream>
#include <sstream>
#include <stdexcept>
+#include <limits>
#include "indexed.h"
#include "idx.h"
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;
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)
#include <numeric>
#include <stdexcept>
+#include <limits>
#include "pseries.h"
#include "add.h"
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)
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)
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) {
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)))
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);
}
#include <iostream>
#include <stdexcept>
#include <functional>
+#include <limits>
#include "symmetry.h"
#include "lst.h"
{
// 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;
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;
}
default:
break;
}
- return something_changed ? sign : INT_MAX;
+ return something_changed ? sign : std::numeric_limits<int>::max();
}
* @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). */