TermExtra.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
Copyright (C) 2010 University of Aarhus
Contact Bjarke Hammersholt Roune for license information (www.broune.com)
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef TERM_EXTRA_GUARD
#define TERM_EXTRA_GUARD
#include "Term.h"
Exponent median(const Exponent* a, size_t varCount);
inline Exponent median(const Term& a) {
return median(a.begin(), a.getVarCount());
}
Exponent medianPositive(const Exponent* a, size_t varCount);
inline Exponent medianPositive(const Term& a) {
return medianPositive(a.begin(), a.getVarCount());
}
void totalDegree(mpz_class& res, const Exponent* a, size_t varCount);
inline void totalDegree(mpz_class& res, const Term& a) {
totalDegree(res, a.begin(), a.getVarCount());
}
Exponent minimumPositive(const Exponent* a, size_t varCount);
inline Exponent minimumPositive(const Term& a) {
return minimumPositive(a.begin(), a.getVarCount());
}
Exponent maximum(const Exponent* a, size_t varCount);
inline Exponent maximum(const Term& a) {
return maximum(a.begin(), a.getVarCount());
}
#endif
median
Exponent median(const Exponent *a, size_t varCount)
Returns the lower median exponent of a.
Definition TermExtra.cpp:25
medianPositive
Exponent medianPositive(const Exponent *a, size_t varCount)
Returns the lower median of the positive exponents of a.
Definition TermExtra.cpp:35
totalDegree
void totalDegree(mpz_class &res, const Exponent *a, size_t varCount)
Puts the sum of the entries of a into res.
Definition TermExtra.cpp:49
minimumPositive
Exponent minimumPositive(const Exponent *a, size_t varCount)
Returns the smallest positive exponent of a.
Definition TermExtra.cpp:55
maximum
Exponent maximum(const Exponent *a, size_t varCount)
Returns the largest exponent of a.
Definition TermExtra.cpp:68
Term.h
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
Term::begin
Exponent * begin()
Definition Term.h:79
Term::getVarCount
size_t getVarCount() const
Definition Term.h:85
Exponent
unsigned int Exponent
Definition stdinc.h:89