GenerateDataFacade.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 "GenerateDataFacade.h"
#include "randomDataGenerators.h"
#include "display.h"
GenerateDataFacade::GenerateDataFacade(bool printActions):
Facade(printActions) {
}
void GenerateDataFacade::generateListIdeal(BigIdeal& ideal,
size_t varCount) {
beginAction("Generating list ideal.");
::generateLinkedListIdeal(ideal, varCount);
endAction();
}
void GenerateDataFacade::generateKingChessIdeal(BigIdeal& ideal,
unsigned int rowsAndColumns) {
beginAction("Generating king ideal.");
::generateKingChessIdeal(ideal, rowsAndColumns);
endAction();
}
void GenerateDataFacade::generateKnightChessIdeal
(BigIdeal& ideal, unsigned int rowsAndColumns) {
beginAction("Generating knight ideal.");
::generateKnightChessIdeal(ideal, rowsAndColumns);
endAction();
}
void GenerateDataFacade::generateRookChessIdeal
(BigIdeal& ideal, unsigned int n, unsigned int k) {
beginAction("Generating rook ideal.");
::generateRookChessIdeal(ideal, n, k);
endAction();
}
void GenerateDataFacade::generateMatchingIdeal
(BigIdeal& ideal, unsigned int n) {
beginAction("Generating matching ideal.");
::generateMatchingIdeal(ideal, n);
endAction();
}
void GenerateDataFacade::generateTreeIdeal
(BigIdeal& ideal,
unsigned int varCount) {
beginAction("Generating tree ideal.");
::generateTreeIdeal(ideal, varCount);
endAction();
}
void GenerateDataFacade::generateEdgeIdeal
(BigIdeal& ideal, size_t varCount, size_t generatorCount) {
beginAction("Generating random edge ideal.");
bool fullSize =
::generateRandomEdgeIdeal(ideal, varCount, generatorCount);
if (!fullSize)
displayNote("Generated ideal has fewer minimal "
"generators than requested.\n");
endAction();
}
void GenerateDataFacade::generateIdeal(BigIdeal& ideal,
size_t exponentRange,
size_t varCount,
size_t generatorCount) {
beginAction("Generating random monomial ideal.");
bool fullSize =
::generateRandomIdeal(ideal, exponentRange, varCount, generatorCount);
if (!fullSize)
displayNote("Generated ideal has fewer minimal "
"generators than requested.\n");
endAction();
}
void GenerateDataFacade::
generateFrobeniusInstance(vector<mpz_class>& instance,
size_t entryCount,
const mpz_class& maxEntry) {
beginAction("Generating random Frobenius instance.");
::generateRandomFrobeniusInstance(instance, entryCount, maxEntry);
endAction();
}
GenerateDataFacade.h
BigIdeal
Definition BigIdeal.h:27
Facade::beginAction
void beginAction(const char *message)
Prints message to standard error if printing is turned on, and records the time when the action start...
Definition Facade.cpp:38
Facade::endAction
void endAction()
Prints to standard error the time since the last call to beginAction.
Definition Facade.cpp:51
Facade::Facade
Facade(bool printActions)
Constructs a facade that prints out what it is doing if printActions is true.
Definition Facade.cpp:20
GenerateDataFacade::generateIdeal
void generateIdeal(BigIdeal &ideal, size_t exponentRange, size_t varCount, size_t generatorCount)
Definition GenerateDataFacade.cpp:96
GenerateDataFacade::generateKingChessIdeal
void generateKingChessIdeal(BigIdeal &ideal, unsigned int rowsAndColumns)
Definition GenerateDataFacade.cpp:36
GenerateDataFacade::generateTreeIdeal
void generateTreeIdeal(BigIdeal &ideal, unsigned int varCount)
Definition GenerateDataFacade.cpp:73
GenerateDataFacade::GenerateDataFacade
GenerateDataFacade(bool printActions)
Definition GenerateDataFacade.cpp:23
GenerateDataFacade::generateEdgeIdeal
void generateEdgeIdeal(BigIdeal &ideal, size_t varCount, size_t generatorCount)
Definition GenerateDataFacade.cpp:83
GenerateDataFacade::generateFrobeniusInstance
void generateFrobeniusInstance(vector< mpz_class > &instance, size_t entryCount, const mpz_class &maxEntry)
Definition GenerateDataFacade.cpp:113
GenerateDataFacade::generateKnightChessIdeal
void generateKnightChessIdeal(BigIdeal &ideal, unsigned int rowsAndColumns)
Definition GenerateDataFacade.cpp:46
GenerateDataFacade::generateRookChessIdeal
void generateRookChessIdeal(BigIdeal &ideal, unsigned int n, unsigned int k)
Definition GenerateDataFacade.cpp:55
GenerateDataFacade::generateMatchingIdeal
void generateMatchingIdeal(BigIdeal &ideal, unsigned int n)
Definition GenerateDataFacade.cpp:64
GenerateDataFacade::generateListIdeal
void generateListIdeal(BigIdeal &ideal, size_t varCount)
Definition GenerateDataFacade.cpp:27
displayNote
void displayNote(const string &msg)
Display msg to standard error in a way that indicates that this is something that the user should tak...
Definition display.cpp:135
display.h
This file contains functions for printing strings to standard error.
generateRandomFrobeniusInstance
void generateRandomFrobeniusInstance(vector< mpz_class > &instance, size_t entryCount, const mpz_class &maxEntry)
Generate a random vector of numbers whose gcd is 1.
Definition randomDataGenerators.cpp:460
generateRandomIdeal
bool generateRandomIdeal(BigIdeal &bigIdeal, size_t exponentRange, size_t variableCount, size_t generatorCount)
Generate a random ideal with exponents in the range [0, exponentRange].
Definition randomDataGenerators.cpp:429
generateRandomEdgeIdeal
bool generateRandomEdgeIdeal(BigIdeal &bigIdeal, size_t variableCount, size_t generatorCount)
Generate a random ideal where every edge is a product of two different variables.
Definition randomDataGenerators.cpp:393
generateLinkedListIdeal
void generateLinkedListIdeal(BigIdeal &ideal, size_t variableCount)
Generate an ideal of the form , and so on.
Definition randomDataGenerators.cpp:31
randomDataGenerators.h
This file contains functions that generate data.
stdinc.h
This header file includes common definitions and is included as the first line of code in every imple...