Frobby 0.9.5
LibAssociatedPrimesTest.cpp
Go to the documentation of this file.
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2010 University of Aarhus
3 Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17*/
18#include "stdinc.h"
19
20#include "frobby.h"
21#include "tests.h"
22#include "IdealFactory.h"
23#include "LibTest.h"
24#include "BigIdeal.h"
25
26#include <vector>
27
28TEST_SUITE2(LibraryInterface, AssociatedPrimes)
29
30TEST(AssociatedPrimes, Typical) {
33
34 Frobby::associatedPrimes(ideal, consumer);
35
37}
38
39TEST(AssociatedPrimes, ZeroIdeal) {
40 for (size_t varCount = 0; varCount <= 3; ++varCount) {
41 Frobby::Ideal frobbyInputIdeal(varCount);
42 LibIdealsConsumer consumer((VarNames(varCount)));
43
44 Frobby::associatedPrimes(frobbyInputIdeal, consumer);
45
46 vector<BigIdeal> ideals;
47 ideals.push_back(IdealFactory::zeroIdeal(varCount));
48 ASSERT_EQ(consumer.getIdeals(), ideals);
49 }
50}
51
52TEST(AssociatedPrimes, WholeRing) {
53 for (size_t varCount = 0; varCount <= 3; ++varCount) {
55 LibIdealsConsumer consumer((VarNames(varCount)));
56
57 Frobby::associatedPrimes(ideal, consumer);
58
59 ASSERT_EQ(consumer.getIdeals(), vector<BigIdeal>());
60 }
61}
Frobby::Ideal toLibIdeal(const BigIdeal &ideal)
Returns a library interface ideal that corresponds to the parameter ideal.
Definition LibTest.cpp:26
#define ASSERT_EQ(A, B)
Definition asserts.h:147
static BigIdeal xx_yy_xz_yz()
Returns .
static VarNames ring_xyzt()
Returns the ring in the four variables , , and .
static vector< BigIdeal > assoprimes_xx_yy_xz_yz()
Returns the associated primes of .
static BigIdeal zeroIdeal(size_t varCount)
Returns the ideal in the ring VarNames(varCount).
static BigIdeal wholeRing(size_t varCount)
Returns in the ring VarNames(varCount).
Records library interface output into a vector of BigIdeals.
Definition LibTest.h:58
const vector< BigIdeal > & getIdeals() const
Returns the recorded ideals in a canonical form.
Definition LibTest.cpp:91
Defines the variables of a polynomial ring and facilities IO involving them.
Definition VarNames.h:40
#define TEST_SUITE2(PARENT, SUITE)
Definition macroes.h:28
#define TEST(SUITE, TEST_NAME)
Definition macroes.h:41
void associatedPrimes(const Ideal &ideal, IdealConsumer &consumer)
Compute the associated primes of the ideal.
Definition frobby.cpp:455
This header file includes common definitions and is included as the first line of code in every imple...