Frobby  0.9.0
frobby.h
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 #ifndef FROBBY_INCLUSION_GUARD
18 #define FROBBY_INCLUSION_GUARD
19 
20 // This file contains the public library interface of Frobby.
21 
22 #include "gmp.h"
23 
27 namespace FrobbyImpl {
28  class FrobbyIdealHelper;
29 }
30 
32 namespace Frobby {
33  class Ideal {
34  public:
35  // Construct an ideal with variableCount variables.
36  Ideal(size_t variableCount);
37  Ideal(const Ideal& ideal);
38  ~Ideal();
39 
40  Ideal& operator=(const Ideal& ideal);
41 
54  void addExponent(const mpz_t exponent);
55  void addExponent(int exponent);
56  void addExponent(unsigned int exponent);
57 
58  private:
61  };
62 
73  class IdealConsumer {
74  public:
76  virtual ~IdealConsumer();
77 
82  virtual void idealBegin(size_t varCount);
83 
92  virtual void consume(mpz_ptr* exponentVector) = 0;
93 
97  virtual void idealEnd();
98  };
99 
111  public:
113  virtual ~PolynomialConsumer();
114 
119  virtual void polynomialBegin(size_t varCount);
120 
130  virtual void consume(const mpz_t coefficient, mpz_ptr* exponentVector) = 0;
131 
135  virtual void polynomialEnd();
136  };
137 
158  bool alexanderDual(const Ideal& ideal,
159  const mpz_t* reflectionMonomial,
160  IdealConsumer& consumer);
161 
163  bool alexanderDual(const Ideal& ideal,
164  const Ideal& reflectionMonomial,
165  IdealConsumer& consumer);
166 
174  void multigradedHilbertPoincareSeries(const Ideal& ideal,
175  PolynomialConsumer& consumer);
176 
182  void univariateHilbertPoincareSeries(const Ideal& ideal,
183  PolynomialConsumer& consumer);
184 
202  void irreducibleDecompositionAsIdeals(const Ideal& ideal,
203  IdealConsumer& consumer);
204 
226  bool irreducibleDecompositionAsMonomials(const Ideal& ideal,
227  IdealConsumer& consumer);
228 
245  void maximalStandardMonomials(const Ideal& ideal,
246  IdealConsumer& consumer);
247 
265  bool solveStandardMonomialProgram(const Ideal& ideal,
266  const mpz_t* l,
267  IdealConsumer& consumer);
268 
283  void codimension(const Ideal& ideal, mpz_t codim);
284 
294  void dimension(const Ideal& ideal, mpz_t dim);
295 
309  void primaryDecomposition(const Ideal& ideal, IdealConsumer& consumer);
310 
314  void associatedPrimes(const Ideal& ideal, IdealConsumer& consumer);
315 }
316 
317 #endif
bool irreducibleDecompositionAsMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the irreducible decomposition of ideal, and encode each irreducible component as a monomial...
Definition: frobby.cpp:377
Ideal(size_t variableCount)
Definition: frobby.cpp:193
FrobbyImpl::FrobbyIdealHelper * _data
Definition: frobby.h:60
void irreducibleDecompositionAsIdeals(const Ideal &ideal, IdealConsumer &consumer)
Compute the irreducible decomposition of ideal.
Definition: frobby.cpp:367
virtual void consume(const mpz_t coefficient, mpz_ptr *exponentVector)=0
For output of a term of the polynomial.
Ideal & operator=(const Ideal &ideal)
Definition: frobby.cpp:205
virtual void idealEnd()
Called after output of a monomial ideal.
Definition: frobby.cpp:159
bool alexanderDual(const Ideal &ideal, const mpz_t *reflectionMonomial, IdealConsumer &consumer)
Compute the Alexander dual of ideal using the point reflectionMonomial.
Definition: frobby.cpp:242
virtual ~IdealConsumer()
The provided implementation does nothing.
Definition: frobby.cpp:153
void maximalStandardMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the maximal standard monomials of ideal.
Definition: frobby.cpp:404
void codimension(const Ideal &ideal, mpz_t codim)
Compute the codimension of a monomial ideal.
Definition: frobby.cpp:437
This class provides a way to get polynomials as output from Frobby one term at a time.
Definition: frobby.h:110
void multigradedHilbertPoincareSeries(const Ideal &ideal, PolynomialConsumer &consumer)
Compute the multigraded Hilbert-Poincare series of ideal.
Definition: frobby.cpp:295
void dimension(const Ideal &ideal, mpz_t dim)
Compute the Krull dimension of a monomial ideal.
Definition: frobby.cpp:443
bool solveStandardMonomialProgram(const Ideal &ideal, const mpz_t *l, IdealConsumer &consumer)
Solve the optimization program.
Definition: frobby.cpp:416
This class provides a way to get monomial ideals as output from Frobby one generator at a time...
Definition: frobby.h:73
virtual void polynomialEnd()
Called after output of a polynomial.
Definition: frobby.cpp:168
virtual void polynomialBegin(size_t varCount)
Called before output of a polynomial.
Definition: frobby.cpp:165
void addExponent(const mpz_t exponent)
Call addExponent once for each variable to add a term one exponent at a time.
Definition: frobby.cpp:217
void primaryDecomposition(const Ideal &ideal, IdealConsumer &consumer)
Compute the canonical primary decomposition of a monomial ideal.
Definition: frobby.cpp:392
virtual ~PolynomialConsumer()
The provided implementation does nothing.
Definition: frobby.cpp:162
virtual void idealBegin(size_t varCount)
Called before output of a monomial ideal.
Definition: frobby.cpp:156
The namespace Frobby contains the public interface of Frobby.
Definition: frobby.h:32
The namespace FrobbyImpl is for internal use inside Frobby only.
Definition: frobby.cpp:171
void univariateHilbertPoincareSeries(const Ideal &ideal, PolynomialConsumer &consumer)
Compute the univariate Hilbert-Poincare series of ideal.
Definition: frobby.cpp:307
void associatedPrimes(const Ideal &ideal, IdealConsumer &consumer)
Compute the associated primes of the ideal.
Definition: frobby.cpp:451
virtual void consume(mpz_ptr *exponentVector)=0
For output of a generator of the ideal.