HilbertAction.cpp
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
MERCHANTABIL-ITY 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/.
*/
#include "stdinc.h"
#include "HilbertAction.h"
#include "SliceFacade.h"
#include "SliceParams.h"
#include "BigattiFacade.h"
#include "BigattiParams.h"
#include "ScarfFacade.h"
#include "DataType.h"
#include "ScarfParams.h"
#include "error.h"
HilbertAction::HilbertAction():
Action
(staticGetName(),
"Compute the Hilbert-Poincare series of the input ideal.",
"Compute the multigraded Hilbert-Poincare series of the input\n"
"ideal. Use the -univariate option to get the univariate series.\n\n"
"The Hilbert-Poincare series of a monomial ideal is the sum of all\n"
"monomials not in the ideal. This sum can be written as a (finite)\n"
"rational function with (x1-1)(x2-1)...(xn-1) in the denominator,\n"
"assuming the variables of the ring are x1,x2,...,xn. This action\n"
"computes the polynomial in the numerator of this fraction.",
false),
_io(DataType::getMonomialIdealType(), DataType::getPolynomialType()),
_sliceParams(false, true, true),
_univariate
("univariate",
"Output a univariate polynomial by substituting t for each variable.",
false),
_algorithm
("algorithm",
"Which algorithm to use. Options are slice, bigatti and deform.",
"bigatti") {
_params.add(_io);
_params.add(_sliceParams);
_params.add(_univariate);
_params.add(_algorithm);
addScarfParams(_params);
}
void HilbertAction::perform() {
if (_algorithm.getValue() == "bigatti") {
BigattiParams params(_params);
BigattiFacade facade(params);
if (_univariate)
facade.computeUnivariateHilbertSeries();
else
facade.computeMultigradedHilbertSeries();
} else if (_algorithm.getValue() == "slice") {
SliceParams params(_params);
validateSplit(params, false, false);
SliceFacade sliceFacade(params, DataType::getPolynomialType());
if (_univariate)
sliceFacade.computeUnivariateHilbertSeries();
else
sliceFacade.computeMultigradedHilbertSeries();
} else if (_algorithm.getValue() == "deform") {
ScarfParams params(_params);
ScarfFacade facade(params);
if (_univariate)
facade.computeUnivariateHilbertSeries();
else
facade.computeMultigradedHilbertSeries();
} else
reportError("Unknown Hilbert-Poincare series algorithm \"" +
_algorithm.getValue() + "\".");
}
const char* HilbertAction::staticGetName() {
return "hilbert";
}
BigattiFacade.h
BigattiParams.h
DataType.h
HilbertAction.h
ScarfFacade.h
addScarfParams
void addScarfParams(CliParams &params)
Definition ScarfParams.cpp:43
ScarfParams.h
SliceFacade.h
validateSplit
void validateSplit(const SliceParams &params, bool allowLabel, bool allowDegree)
Definition SliceParams.cpp:61
SliceParams.h
Action::_params
CliParams _params
Definition Action.h:59
Action::Action
Action(const char *name, const char *shortDescription, const char *description, bool acceptsNonParameter)
Definition Action.cpp:46
BigattiFacade
A facade for computing Hilbert series of monomial ideals using the divide-and-conquer algorithm by Bi...
Definition BigattiFacade.h:32
BigattiFacade::computeMultigradedHilbertSeries
void computeMultigradedHilbertSeries()
Computes the numerator of the multigraded Hilbert-Poincare series with no cancellation of common term...
Definition BigattiFacade.cpp:38
BigattiFacade::computeUnivariateHilbertSeries
void computeUnivariateHilbertSeries()
Computes the numerator of the univariate Hilbert-Poincare series with no cancellation of common terms...
Definition BigattiFacade.cpp:52
BigattiParams
Definition BigattiParams.h:25
DataType
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
Definition DataType.h:29
DataType::getPolynomialType
static const DataType & getPolynomialType()
Returns the one and only instance for polynomials.
Definition DataType.cpp:50
HilbertAction::_univariate
BoolParameter _univariate
Definition HilbertAction.h:37
HilbertAction::_sliceParams
SliceParameters _sliceParams
Definition HilbertAction.h:36
HilbertAction::HilbertAction
HilbertAction()
Definition HilbertAction.cpp:29
HilbertAction::perform
virtual void perform()
Definition HilbertAction.cpp:64
HilbertAction::_io
IOParameters _io
Definition HilbertAction.h:35
HilbertAction::_algorithm
StringParameter _algorithm
Definition HilbertAction.h:38
HilbertAction::staticGetName
static const char * staticGetName()
Definition HilbertAction.cpp:92
ScarfFacade
Definition ScarfFacade.h:27
ScarfFacade::computeMultigradedHilbertSeries
void computeMultigradedHilbertSeries()
Computes the numerator of the multigraded Hilbert-Poincare series with no cancellation of common term...
Definition ScarfFacade.cpp:44
ScarfFacade::computeUnivariateHilbertSeries
void computeUnivariateHilbertSeries()
Computes the numerator of the univariate Hilbert-Poincare series with no cancellation of common terms...
Definition ScarfFacade.cpp:60
ScarfParams
Definition ScarfParams.h:27
SliceFacade
A facade for operations on monomial ideals using the Slice Algorithm.
Definition SliceFacade.h:44
SliceFacade::computeMultigradedHilbertSeries
void computeMultigradedHilbertSeries()
Compute the numerator of the multigraded Hilbert-Poincare series.
Definition SliceFacade.cpp:78
SliceFacade::computeUnivariateHilbertSeries
void computeUnivariateHilbertSeries()
Compute the numerator of the univariate Hilbert-Poincare series.
Definition SliceFacade.cpp:93
SliceParams
Definition SliceParams.h:25
reportError
void reportError(const string &errorMsg)
Definition error.cpp:23
error.h
stdinc.h
This header file includes common definitions and is included as the first line of code in every imple...