frobby.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (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 FROBBY_INCLUSION_GUARD
#define FROBBY_INCLUSION_GUARD
// This file contains the public library interface of Frobby.
#include "gmp.h"
extern "C" const char* const frobby_version;
namespace FrobbyImpl {
class FrobbyIdealHelper;
}
namespace Frobby {
class Ideal {
public:
// Construct an ideal with variableCount variables.
Ideal(size_t variableCount);
Ideal(const Ideal& ideal);
~Ideal();
Ideal& operator=(const Ideal& ideal);
void addExponent(const mpz_t exponent);
void addExponent(int exponent);
void addExponent(unsigned int exponent);
private:
friend class FrobbyImpl::FrobbyIdealHelper;
FrobbyImpl::FrobbyIdealHelper* _data;
};
class IdealConsumer {
public:
virtual ~IdealConsumer();
virtual void idealBegin(size_t varCount);
virtual void consume(mpz_ptr* exponentVector) = 0;
virtual void idealEnd();
};
class PolynomialConsumer {
public:
virtual ~PolynomialConsumer();
virtual void polynomialBegin(size_t varCount);
virtual void consume(const mpz_t coefficient, mpz_ptr* exponentVector) = 0;
virtual void polynomialEnd();
};
bool alexanderDual(const Ideal& ideal,
const mpz_t* reflectionMonomial,
IdealConsumer& consumer);
bool alexanderDual(const Ideal& ideal,
const Ideal& reflectionMonomial,
IdealConsumer& consumer);
void multigradedHilbertPoincareSeries(const Ideal& ideal,
PolynomialConsumer& consumer);
void univariateHilbertPoincareSeries(const Ideal& ideal,
PolynomialConsumer& consumer);
void irreducibleDecompositionAsIdeals(const Ideal& ideal,
IdealConsumer& consumer);
bool irreducibleDecompositionAsMonomials(const Ideal& ideal,
IdealConsumer& consumer);
void maximalStandardMonomials(const Ideal& ideal,
IdealConsumer& consumer);
bool solveStandardMonomialProgram(const Ideal& ideal,
const mpz_t* l,
IdealConsumer& consumer);
void codimension(const Ideal& ideal, mpz_t codim);
void dimension(const Ideal& ideal, mpz_t dim);
void primaryDecomposition(const Ideal& ideal, IdealConsumer& consumer);
void associatedPrimes(const Ideal& ideal, IdealConsumer& consumer);
}
#endif
FrobbyImpl::FrobbyIdealHelper
Definition frobby.cpp:182
Frobby::IdealConsumer
This class provides a way to get monomial ideals as output from Frobby one generator at a time.
Definition frobby.h:75
Frobby::IdealConsumer::idealBegin
virtual void idealBegin(size_t varCount)
Called before output of a monomial ideal.
Definition frobby.cpp:164
Frobby::IdealConsumer::~IdealConsumer
virtual ~IdealConsumer()
The provided implementation does nothing.
Definition frobby.cpp:161
Frobby::IdealConsumer::idealEnd
virtual void idealEnd()
Called after output of a monomial ideal.
Definition frobby.cpp:167
Frobby::IdealConsumer::consume
virtual void consume(mpz_ptr *exponentVector)=0
For output of a generator of the ideal.
Frobby::Ideal
Definition frobby.h:35
Frobby::Ideal::operator=
Ideal & operator=(const Ideal &ideal)
Definition frobby.cpp:213
Frobby::Ideal::~Ideal
~Ideal()
Definition frobby.cpp:209
Frobby::Ideal::Ideal
Ideal(size_t variableCount)
Definition frobby.cpp:201
Frobby::Ideal::_data
FrobbyImpl::FrobbyIdealHelper * _data
Definition frobby.h:62
Frobby::Ideal::addExponent
void addExponent(const mpz_t exponent)
Call addExponent once for each variable to add a term one exponent at a time.
Definition frobby.cpp:225
Frobby::PolynomialConsumer
This class provides a way to get polynomials as output from Frobby one term at a time.
Definition frobby.h:112
Frobby::PolynomialConsumer::polynomialBegin
virtual void polynomialBegin(size_t varCount)
Called before output of a polynomial.
Definition frobby.cpp:173
Frobby::PolynomialConsumer::~PolynomialConsumer
virtual ~PolynomialConsumer()
The provided implementation does nothing.
Definition frobby.cpp:170
Frobby::PolynomialConsumer::polynomialEnd
virtual void polynomialEnd()
Called after output of a polynomial.
Definition frobby.cpp:176
Frobby::PolynomialConsumer::consume
virtual void consume(const mpz_t coefficient, mpz_ptr *exponentVector)=0
For output of a term of the polynomial.
frobby_version
const char *const frobby_version
Definition frobby.cpp:36
FrobbyImpl
The namespace FrobbyImpl is for internal use inside Frobby only.
Definition frobby.cpp:179
Frobby
The namespace Frobby contains the public interface of Frobby.
Definition frobby.h:34
Frobby::dimension
void dimension(const Ideal &ideal, mpz_t dim)
Compute the Krull dimension of a monomial ideal.
Definition frobby.cpp:451
Frobby::alexanderDual
bool alexanderDual(const Ideal &ideal, const mpz_t *reflectionMonomial, IdealConsumer &consumer)
Compute the Alexander dual of ideal using the point reflectionMonomial.
Definition frobby.cpp:250
Frobby::irreducibleDecompositionAsIdeals
void irreducibleDecompositionAsIdeals(const Ideal &ideal, IdealConsumer &consumer)
Compute the irreducible decomposition of ideal.
Definition frobby.cpp:375
Frobby::codimension
void codimension(const Ideal &ideal, mpz_t codim)
Compute the codimension of a monomial ideal.
Definition frobby.cpp:445
Frobby::associatedPrimes
void associatedPrimes(const Ideal &ideal, IdealConsumer &consumer)
Compute the associated primes of the ideal.
Definition frobby.cpp:459
Frobby::univariateHilbertPoincareSeries
void univariateHilbertPoincareSeries(const Ideal &ideal, PolynomialConsumer &consumer)
Compute the univariate Hilbert-Poincare series of ideal.
Definition frobby.cpp:315
Frobby::solveStandardMonomialProgram
bool solveStandardMonomialProgram(const Ideal &ideal, const mpz_t *l, IdealConsumer &consumer)
Solve the optimization program.
Definition frobby.cpp:424
Frobby::irreducibleDecompositionAsMonomials
bool irreducibleDecompositionAsMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the irreducible decomposition of ideal, and encode each irreducible component as a monomial.
Definition frobby.cpp:385
Frobby::maximalStandardMonomials
void maximalStandardMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the maximal standard monomials of ideal.
Definition frobby.cpp:412
Frobby::primaryDecomposition
void primaryDecomposition(const Ideal &ideal, IdealConsumer &consumer)
Compute the canonical primary decomposition of a monomial ideal.
Definition frobby.cpp:400
Frobby::multigradedHilbertPoincareSeries
void multigradedHilbertPoincareSeries(const Ideal &ideal, PolynomialConsumer &consumer)
Compute the multigraded Hilbert-Poincare series of ideal.
Definition frobby.cpp:303