AlexanderDualAction.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
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/.
*/
#include "stdinc.h"
#include "AlexanderDualAction.h"
#include "BigIdeal.h"
#include "IOFacade.h"
#include "Scanner.h"
#include "SliceFacade.h"
#include "SliceParams.h"
#include "DataType.h"
#include "BigTermConsumer.h"
AlexanderDualAction::AlexanderDualAction():
Action
(staticGetName(),
"Compute the Alexander dual of the input ideal.",
"Compute the alexander dual of the input monomial ideal.\n\n"
"The computation is done using irreducible decomposition, which is why "
"there are\n"
"a number of options related to that. See the help topic on irrdecom for "
"details.",
false),
_io(DataType::getMonomialIdealType(), DataType::getMonomialIdealType()) {
}
void AlexanderDualAction::obtainParameters(vector<Parameter*>& parameters) {
Action::obtainParameters(parameters);
_sliceParams.obtainParameters(parameters);
_io.obtainParameters(parameters);
}
void AlexanderDualAction::perform() {
SliceParams params(_params);
validateSplit(params, true, false);
BigIdeal ideal;
vector<mpz_class> point;
bool pointSpecified;
{
Scanner in(_io.getInputFormat(), stdin);
_io.autoDetectInputFormat(in);
_io.validateFormats();
IOFacade ioFacade(_printActions);
pointSpecified = ioFacade.readAlexanderDualInstance(in, ideal, point);
in.expectEOF();
}
unique_ptr<BigTermConsumer> output =
_io.createOutputHandler()->createIdealWriter(stdout);
SliceFacade facade(params, ideal, *output);
if (pointSpecified)
facade.computeAlexanderDual(point);
else
facade.computeAlexanderDual();
}
const char* AlexanderDualAction::staticGetName() {
return "alexdual";
}
AlexanderDualAction.h
BigIdeal.h
BigTermConsumer.h
DataType.h
IOFacade.h
Scanner.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::_printActions
BoolParameter _printActions
Definition Action.h:68
Action::Action
Action(const char *name, const char *shortDescription, const char *description, bool acceptsNonParameter)
Definition Action.cpp:46
Action::obtainParameters
virtual void obtainParameters(vector< Parameter * > &parameters)
Definition Action.cpp:133
AlexanderDualAction::_sliceParams
SliceParameters _sliceParams
Definition AlexanderDualAction.h:35
AlexanderDualAction::staticGetName
static const char * staticGetName()
Definition AlexanderDualAction.cpp:76
AlexanderDualAction::obtainParameters
virtual void obtainParameters(vector< Parameter * > &parameters)
Definition AlexanderDualAction.cpp:42
AlexanderDualAction::perform
virtual void perform()
Definition AlexanderDualAction.cpp:48
AlexanderDualAction::_io
IOParameters _io
Definition AlexanderDualAction.h:36
AlexanderDualAction::AlexanderDualAction
AlexanderDualAction()
Definition AlexanderDualAction.cpp:28
BigIdeal
Definition BigIdeal.h:27
DataType
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
Definition DataType.h:29
IOFacade
A facade for input and output of mathematical objects.
Definition IOFacade.h:39
IOFacade::readAlexanderDualInstance
bool readAlexanderDualInstance(Scanner &in, BigIdeal &ideal, vector< mpz_class > &term)
Definition IOFacade.cpp:230
Scanner
This class offers an input interface which is more convenient and for some purposes more efficient th...
Definition Scanner.h:50
Scanner::expectEOF
void expectEOF()
Require that there is no more input.
Definition Scanner.cpp:77
SliceFacade
A facade for operations on monomial ideals using the Slice Algorithm.
Definition SliceFacade.h:44
SliceFacade::computeAlexanderDual
void computeAlexanderDual(const vector< mpz_class > &point)
Compute the Alexander dual of the ideal.
Definition SliceFacade.cpp:250
SliceParams
Definition SliceParams.h:25
stdinc.h
This header file includes common definitions and is included as the first line of code in every imple...