Frobby  0.9.5
PolynomialFactory.cpp
Go to the documentation of this file.
1 /* Frobby: Software for monomial ideal computations.
2  Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see http://www.gnu.org/licenses/.
16 */
17 #include "stdinc.h"
18 #include "PolynomialFactory.h"
19 
20 #include "IdealFactory.h"
21 
24  poly.add(-1, IdealFactory::makeTerm(2, 2, 1, 0));
25  poly.add(-1, IdealFactory::makeTerm(0, 1, 1, 0));
26  poly.add(-1, IdealFactory::makeTerm(0, 2, 0, 0));
27  poly.add(+1, IdealFactory::makeTerm(0, 2, 1, 0));
28  poly.add(-1, IdealFactory::makeTerm(2, 0, 0, 0));
29  poly.add(+1, IdealFactory::makeTerm(2, 0, 1, 0));
30  poly.add(-1, IdealFactory::makeTerm(1, 0, 1, 0));
31  poly.add(+1, IdealFactory::makeTerm(1, 1, 1, 0));
32  poly.add(+1, IdealFactory::makeTerm(0, 0, 0, 0));
33  poly.add(+1, IdealFactory::makeTerm(2, 2, 0, 0));
34  poly.sortTermsReverseLex();
35  return poly;
36 }
37 
39  VarNames names;
40  names.addVar("t");
41  BigPolynomial poly(names);
42  poly.add(+1, IdealFactory::makeTerm(0));
43  poly.add(-4, IdealFactory::makeTerm(2));
44  poly.add(+3, IdealFactory::makeTerm(3));
45  poly.add(+1, IdealFactory::makeTerm(4));
46  poly.add(-1, IdealFactory::makeTerm(5));
47  poly.sortTermsReverseLex();
48  return poly;
49 }
50 
52  BigPolynomial poly((VarNames(varCount)));
53  poly.add(1, vector<mpz_class>(varCount));
54  return poly;
55 }
56 
58  BigPolynomial poly(names);
59  poly.add(1, vector<mpz_class>(names.getVarCount()));
60  return poly;
61 }
62 
64  return BigPolynomial((VarNames(varCount)));
65 }
void add(const mpz_class &coef, const vector< mpz_class > term)
void sortTermsReverseLex()
static VarNames ring_xyzt()
Returns the ring in the four variables , , and .
static vector< mpz_class > makeTerm(int a, int b, int c, int d)
Returns a vector representing .
static BigPolynomial one(size_t varCount)
Returns the polynomial 1 in the ring VarNames(varCount).
static BigPolynomial one_minus4tt_3ttt_tttt_minusttttt()
Returns the polynomial 1 - 4t^2 + 3t^3 + t^4 - t^5.
static BigPolynomial zero(size_t varCount)
Return the zero polynomial in the ring VarNames(varCount).
static BigPolynomial hilbert_xx_yy_xz_yz()
Returns the multigraded Hilbert-Poincare series numerator of the ideal <x^2, y^2, xz,...
Defines the variables of a polynomial ring and facilities IO involving them.
Definition: VarNames.h:40
bool addVar(const string &name)
Adds the variable and returns true if name is not already a variable.
Definition: VarNames.cpp:44
size_t getVarCount() const
Returns the current number of variables.
Definition: VarNames.h:113