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 
56  _params.add(_io);
60 
62 }
63 
65  if (_algorithm.getValue() == "bigatti") {
66  BigattiParams params(_params);
67  BigattiFacade facade(params);
68  if (_univariate)
70  else
72  } else if (_algorithm.getValue() == "slice") {
73  SliceParams params(_params);
74  validateSplit(params, false, false);
75  SliceFacade sliceFacade(params, DataType::getPolynomialType());
76  if (_univariate)
77  sliceFacade.computeUnivariateHilbertSeries();
78  else
79  sliceFacade.computeMultigradedHilbertSeries();
80  } else if (_algorithm.getValue() == "deform") {
81  ScarfParams params(_params);
82  ScarfFacade facade(params);
83  if (_univariate)
85  else
87  } else
88  reportError("Unknown Hilbert-Poincare series algorithm \"" +
89  _algorithm.getValue() + "\".");
90 }
91 
93  return "hilbert";
94 }
void addScarfParams(CliParams &params)
Definition: ScarfParams.cpp:43
void validateSplit(const SliceParams &params, bool allowLabel, bool allowDegree)
Definition: SliceParams.cpp:61
Definition: Action.h:25
CliParams _params
Definition: Action.h:59
A facade for computing Hilbert series of monomial ideals using the divide-and-conquer algorithm by Bi...
Definition: BigattiFacade.h:32
void computeMultigradedHilbertSeries()
Computes the numerator of the multigraded Hilbert-Poincare series with no cancellation of common term...
void computeUnivariateHilbertSeries()
Computes the numerator of the univariate Hilbert-Poincare series with no cancellation of common terms...
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
Definition: HilbertAction.h:37
SliceParameters _sliceParams
Definition: HilbertAction.h:36
virtual void perform()
IOParameters _io
Definition: HilbertAction.h:35
StringParameter _algorithm
Definition: HilbertAction.h:38
static const char * staticGetName()
void computeMultigradedHilbertSeries()
Computes the numerator of the multigraded Hilbert-Poincare series with no cancellation of common term...
Definition: ScarfFacade.cpp:44
void computeUnivariateHilbertSeries()
Computes the numerator of the univariate Hilbert-Poincare series with no cancellation of common terms...
Definition: ScarfFacade.cpp:60
A facade for operations on monomial ideals using the Slice Algorithm.
Definition: SliceFacade.h:44
void computeMultigradedHilbertSeries()
Compute the numerator of the multigraded Hilbert-Poincare series.
Definition: SliceFacade.cpp:78
void computeUnivariateHilbertSeries()
Compute the numerator of the univariate Hilbert-Poincare series.
Definition: SliceFacade.cpp:93
const string & getValue() const
void reportError(const string &errorMsg)
Definition: error.cpp:23