Frobby 0.9.5
IntersectFacade.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 MERCHANTABILITY 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 "IntersectFacade.h"
19
20#include "Term.h"
21#include "BigIdeal.h"
22#include "Ideal.h"
23#include "intersect.h"
24#include "Ideal.h"
25#include "TermTranslator.h"
26#include "ElementDeleter.h"
27
29 Facade(printActions) {
30}
31
33 const VarNames& emptyNames) {
34 beginAction("Intersecting ideals.");
35
36 if (ideals.empty()) {
38 entireRing->newLastTerm();
39 return entireRing;
40 }
41
42 vector<Ideal*> ideals2;
45
46 const VarNames& names = translator.getNames();
48
51 intersection->insert(identity);
52
53 for (size_t i = 0; i < ideals2.size(); ++i) {
54 ideals2[i]->minimize();
55
56 // Compute intersection
58 ::intersect(tmp.get(), intersection.get(), ideals2[i]);
59
60 // Handle bookkeeping
62 }
63
66
67 endAction();
68 return bigIdeal;
69}
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
This is the super class of all facades.
Definition Facade.h:32
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
void endAction()
Prints to standard error the time since the last call to beginAction.
Definition Facade.cpp:51
Represents a monomial ideal with int exponents.
Definition Ideal.h:27
IntersectFacade(bool printActions)
auto_ptr< BigIdeal > intersect(const vector< BigIdeal * > &ideals, const VarNames &names)
Returns the intersection of ideals.
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40
size_t getVarCount() const
Returns the current number of variables.
Definition VarNames.h:113