Frobby 0.9.5
HilbertAction.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 MERCHANTABIL-ITY 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 "HilbertAction.h"
19
20#include "SliceFacade.h"
21#include "SliceParams.h"
22#include "BigattiFacade.h"
23#include "BigattiParams.h"
24#include "ScarfFacade.h"
25#include "DataType.h"
26#include "ScarfParams.h"
27#include "error.h"
28
30 Action
31(staticGetName(),
32 "Compute the Hilbert-Poincare series of the input ideal.",
33 "Compute the multigraded Hilbert-Poincare series of the input\n"
34 "ideal. Use the -univariate option to get the univariate series.\n\n"
35 "The Hilbert-Poincare series of a monomial ideal is the sum of all\n"
36 "monomials not in the ideal. This sum can be written as a (finite)\n"
37 "rational function with (x1-1)(x2-1)...(xn-1) in the denominator,\n"
38 "assuming the variables of the ring are x1,x2,...,xn. This action\n"
39 "computes the polynomial in the numerator of this fraction.",
40 false),
41
42 _io(DataType::getMonomialIdealType(), DataType::getPolynomialType()),
43
44 _sliceParams(false, true, true),
45
46 _univariate
47 ("univariate",
48 "Output a univariate polynomial by substituting t for each variable.",
49 false),
50
51 _algorithm
52 ("algorithm",
53 "Which algorithm to use. Options are slice, bigatti and deform.",
54 "bigatti") {
55
60
62}
63
65 if (_algorithm.getValue() == "bigatti") {
68 if (_univariate)
69 facade.computeUnivariateHilbertSeries();
70 else
71 facade.computeMultigradedHilbertSeries();
72 } else if (_algorithm.getValue() == "slice") {
74 validateSplit(params, false, false);
76 if (_univariate)
77 sliceFacade.computeUnivariateHilbertSeries();
78 else
79 sliceFacade.computeMultigradedHilbertSeries();
80 } else if (_algorithm.getValue() == "deform") {
83 if (_univariate)
84 facade.computeUnivariateHilbertSeries();
85 else
86 facade.computeMultigradedHilbertSeries();
87 } else
88 reportError("Unknown Hilbert-Poincare series algorithm \"" +
89 _algorithm.getValue() + "\".");
90}
91
93 return "hilbert";
94}
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
void addScarfParams(CliParams &params)
void validateSplit(const SliceParams &params, bool allowLabel, bool allowDegree)
CliParams _params
Definition Action.h:59
A facade for computing Hilbert series of monomial ideals using the divide-and-conquer algorithm by Bi...
void add(auto_ptr< Parameter > param)
Definition CliParams.cpp:88
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
Definition DataType.h:29
static const DataType & getPolynomialType()
Returns the one and only instance for polynomials.
Definition DataType.cpp:50
BoolParameter _univariate
SliceParameters _sliceParams
virtual void perform()
IOParameters _io
StringParameter _algorithm
static const char * staticGetName()
A facade for operations on monomial ideals using the Slice Algorithm.
Definition SliceFacade.h:44
const string & getValue() const
void reportError(const string &errorMsg)
Definition error.cpp:23