Frobby  0.9.5
LibMaxStdTest.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 
19 #include "frobby.h"
20 #include "tests.h"
21 #include "BigIdeal.h"
22 #include "IdealFactory.h"
23 #include "LibTest.h"
24 
25 TEST_SUITE2(LibraryInterface, MaxStd)
26 
27 TEST(MaxStd, Typical) {
30 
31  Frobby::maximalStandardMonomials(ideal, consumer);
32 
33  ASSERT_EQ(consumer.getIdeal(), IdealFactory::xy_z());
34 }
35 
36 TEST(MaxStd, ZeroIdeal) {
37  for (size_t varCount = 0; varCount <= 3; ++varCount) {
38  Frobby::Ideal ideal(varCount);
39  LibIdealConsumer consumer((VarNames(varCount)));
40 
41  Frobby::maximalStandardMonomials(ideal, consumer);
42 
43  if (varCount == 0) {
44  ASSERT_EQ(consumer.getIdeal(), IdealFactory::wholeRing(varCount));
45  } else {
46  ASSERT_EQ(consumer.getIdeal(), IdealFactory::zeroIdeal(varCount));
47  }
48  }
49 }
50 
51 TEST(MaxStd, WholeRing) {
52  for (size_t varCount = 0; varCount <= 3; ++varCount) {
54  LibIdealConsumer consumer((VarNames(varCount)));
55 
56  Frobby::maximalStandardMonomials(ideal, consumer);
57 
58  ASSERT_EQ(consumer.getIdeal(), IdealFactory::zeroIdeal(varCount));
59  }
60 }
TEST(MaxStd, Typical)
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 VarNames ring_xyzt()
Returns the ring in the four variables , , and .
static BigIdeal xy_z()
Returns .
static BigIdeal xx_yy_zz_t_xz_yz()
Returns .
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 BigIdeal.
Definition: LibTest.h:39
const BigIdeal & getIdeal() const
Returns the recorded ideal in a canonical form.
Definition: LibTest.cpp:66
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
void maximalStandardMonomials(const Ideal &ideal, IdealConsumer &consumer)
Compute the maximal standard monomials of ideal.
Definition: frobby.cpp:408