*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/** A pair of expressions.
* This similar to, but slightly extended STL's pair<> but we need to account
/** A pair of expressions.
* This similar to, but slightly extended STL's pair<> but we need to account
{
return (rest.compare(other.rest)<0) ||
(!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
}
{
return (rest.compare(other.rest)<0) ||
(!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
}
*/
if (is_ex_exactly_of_type(rest,numeric) &&
is_ex_exactly_of_type(other.rest,numeric)) {
*/
if (is_ex_exactly_of_type(rest,numeric) &&
is_ex_exactly_of_type(other.rest,numeric)) {
// both have coeff 1: compare rests
return rest.compare(other.rest)<0;
}
// only this has coeff 1: >
return false;
// both have coeff 1: compare rests
return rest.compare(other.rest)<0;
}
// only this has coeff 1: >
return false;
{
if (is_ex_exactly_of_type(rest,numeric) &&
is_ex_exactly_of_type(other.rest,numeric)) {
{
if (is_ex_exactly_of_type(rest,numeric) &&
is_ex_exactly_of_type(other.rest,numeric)) {
// both have coeff 1: compare rests
return rest.compare(other.rest);
}
// only this has coeff 1: >
return 1;
// both have coeff 1: compare rests
return rest.compare(other.rest);
}
// only this has coeff 1: >
return 1;
{
return (rest.compare(other.rest)<0) ||
(!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
}
{
return (rest.compare(other.rest)<0) ||
(!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
}