Frobby 0.10.0
Loading...
Searching...
No Matches
LibTest.h
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2009 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#ifndef LIB_TEST_GUARD
18#define LIB_TEST_GUARD
19
20#include "frobby.h"
21#include "BigIdeal.h"
22#include "BigPolynomial.h"
23
24#include <vector>
25
29Frobby::Ideal toLibIdeal(const BigIdeal& ideal);
30
36const mpz_t* castLibArray(const vector<mpz_class>& vect);
37
39class LibIdealConsumer : public Frobby::IdealConsumer {
40 public:
41 LibIdealConsumer(const VarNames& names);
42
43 virtual void idealBegin(size_t varCount);
44 virtual void consume(mpz_ptr* exponentVector);
45
47 const BigIdeal& getIdeal() const;
48
50 bool hasAnyOutput() const;
51
52private:
53 bool _hasAnyOutput;
54 mutable BigIdeal _ideal;
55};
56
58class LibIdealsConsumer : public Frobby::IdealConsumer {
59public:
60 LibIdealsConsumer(const VarNames& names);
61
62 virtual void idealBegin(size_t varCount);
63 virtual void consume(mpz_ptr* exponentVector);
64
66 const vector<BigIdeal>& getIdeals() const;
67
68private:
69 mutable vector<BigIdeal> _ideals;
70 VarNames _names;
71};
72
74class LibPolynomialConsumer : public Frobby::PolynomialConsumer {
75 public:
76 LibPolynomialConsumer(const VarNames& names);
77
78 virtual void polynomialBegin(size_t varCount);
79 virtual void consume(const mpz_t coef, mpz_ptr* exponentVector);
80
82 const BigPolynomial& getPolynomial() const;
83
84 private:
85 mutable BigPolynomial _polynomial;
86};
87
88#endif
Definition BigIdeal.h:27
Definition BigPolynomial.h:27
Definition frobby.h:75
Definition frobby.h:35
Definition frobby.h:112
const BigIdeal & getIdeal() const
Definition LibTest.cpp:66
virtual void consume(mpz_ptr *exponentVector)
Definition LibTest.cpp:60
virtual void idealBegin(size_t varCount)
Definition LibTest.cpp:53
bool hasAnyOutput() const
Definition LibTest.cpp:71
virtual void consume(mpz_ptr *exponentVector)
Definition LibTest.cpp:85
virtual void idealBegin(size_t varCount)
Definition LibTest.cpp:80
const vector< BigIdeal > & getIdeals() const
Definition LibTest.cpp:91
const BigPolynomial & getPolynomial() const
Definition LibTest.cpp:113
virtual void polynomialBegin(size_t varCount)
Definition LibTest.cpp:102
virtual void consume(const mpz_t coef, mpz_ptr *exponentVector)
Definition LibTest.cpp:106
Definition VarNames.h:38