Frobby  0.9.5
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 
24 namespace constants {
25  extern const char* const version;
26 }
27 
31 namespace FrobbyImpl {
32  class FrobbyIdealHelper;
33 }
34 
36 namespace Frobby {
37  class Ideal {
38  public:
39  // Construct an ideal with variableCount variables.
40  Ideal(size_t variableCount);
41  Ideal(const Ideal& ideal);
42  ~Ideal();
43 
44  Ideal& operator=(const Ideal& ideal);
45 
58  void addExponent(const mpz_t exponent);
59  void addExponent(int exponent);
60  void addExponent(unsigned int exponent);
61 
62  private:
65  };
66 
77  class IdealConsumer {
78  public:
80  virtual ~IdealConsumer();
81 
86  virtual void idealBegin(size_t varCount);
87 
96  virtual void consume(mpz_ptr* exponentVector) = 0;
97 
101  virtual void idealEnd();
102  };
103 
115  public:
117  virtual ~PolynomialConsumer();
118 
123  virtual void polynomialBegin(size_t varCount);
124 
134  virtual void consume(const mpz_t coefficient, mpz_ptr* exponentVector) = 0;
135 
139  virtual void polynomialEnd();
140  };
141 
162  bool alexanderDual(const Ideal& ideal,
163  const mpz_t* reflectionMonomial,
164  IdealConsumer& consumer);
165 
167  bool alexanderDual(const Ideal& ideal,
168  const Ideal& reflectionMonomial,
169  IdealConsumer& consumer);
170 
178  void multigradedHilbertPoincareSeries(const Ideal& ideal,
179  PolynomialConsumer& consumer);
180 
186  void univariateHilbertPoincareSeries(const Ideal& ideal,
187  PolynomialConsumer& consumer);
188 
206  void irreducibleDecompositionAsIdeals(const Ideal& ideal,
207  IdealConsumer& consumer);
208 
230  bool irreducibleDecompositionAsMonomials(const Ideal& ideal,
231  IdealConsumer& consumer);
232 
249  void maximalStandardMonomials(const Ideal& ideal,
250  IdealConsumer& consumer);
251 
269  bool solveStandardMonomialProgram(const Ideal& ideal,
270  const mpz_t* l,
271  IdealConsumer& consumer);
272 
287  void codimension(const Ideal& ideal, mpz_t codim);
288 
298  void dimension(const Ideal& ideal, mpz_t dim);
299 
313  void primaryDecomposition(const Ideal& ideal, IdealConsumer& consumer);
314 
318  void associatedPrimes(const Ideal& ideal, IdealConsumer& consumer);
319 }
320 
321 #endif
This class provides a way to get monomial ideals as output from Frobby one generator at a time.
Definition: frobby.h:77
virtual void idealBegin(size_t varCount)
Called before output of a monomial ideal.
Definition: frobby.cpp:160
virtual ~IdealConsumer()
The provided implementation does nothing.
Definition: frobby.cpp:157
virtual void idealEnd()
Called after output of a monomial ideal.
Definition: frobby.cpp:163
virtual void consume(mpz_ptr *exponentVector)=0
For output of a generator of the ideal.
Ideal & operator=(const Ideal &ideal)
Definition: frobby.cpp:209
Ideal(size_t variableCount)
Definition: frobby.cpp:197
FrobbyImpl::FrobbyIdealHelper * _data
Definition: frobby.h:64
void addExponent(const mpz_t exponent)
Call addExponent once for each variable to add a term one exponent at a time.
Definition: frobby.cpp:221
This class provides a way to get polynomials as output from Frobby one term at a time.
Definition: frobby.h:114
virtual void polynomialBegin(size_t varCount)
Called before output of a polynomial.
Definition: frobby.cpp:169
virtual ~PolynomialConsumer()
The provided implementation does nothing.
Definition: frobby.cpp:166
virtual void polynomialEnd()
Called after output of a polynomial.
Definition: frobby.cpp:172
virtual void consume(const mpz_t coefficient, mpz_ptr *exponentVector)=0
For output of a term of the polynomial.
The namespace FrobbyImpl is for internal use inside Frobby only.
Definition: frobby.cpp:175
The namespace Frobby contains the public interface of Frobby.
Definition: frobby.h:36
void dimension(const Ideal &ideal, mpz_t dim)
Compute the Krull dimension of a monomial ideal.
Definition: frobby.cpp:447
bool alexanderDual(const Ideal &ideal, const mpz_t *reflectionMonomial, IdealConsumer &consumer)
Compute the Alexander dual of ideal using the point reflectionMonomial.
Definition: frobby.cpp:246
void irreducibleDecompositionAsIdeals(const Ideal &ideal, IdealConsumer &consumer)
Compute the irreducible decomposition of ideal.
Definition: frobby.cpp:371
void codimension(const Ideal &ideal, mpz_t codim)
Compute the codimension of a monomial ideal.
Definition: frobby.cpp:441
void associatedPrimes(const Ideal &ideal, IdealConsumer &consumer)
Compute the associated primes of the ideal.
Definition: frobby.cpp:455
void univariateHilbertPoincareSeries(const Ideal &ideal, PolynomialConsumer &consumer)
Compute the univariate Hilbert-Poincare series of ideal.
Definition: frobby.cpp:311
bool solveStandardMonomialProgram(const Ideal &ideal, const mpz_t *l, IdealConsumer &consumer)
Solve the optimization program.
Definition: frobby.cpp:420
bool irreducibleDecompositionAsMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the irreducible decomposition of ideal, and encode each irreducible component as a monomial.
Definition: frobby.cpp:381
void maximalStandardMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the maximal standard monomials of ideal.
Definition: frobby.cpp:408
void primaryDecomposition(const Ideal &ideal, IdealConsumer &consumer)
Compute the canonical primary decomposition of a monomial ideal.
Definition: frobby.cpp:396
void multigradedHilbertPoincareSeries(const Ideal &ideal, PolynomialConsumer &consumer)
Compute the multigraded Hilbert-Poincare series of ideal.
Definition: frobby.cpp:299
const char *const version
Definition: frobby.cpp:31