[SCM] polybori: Polynomials over Boolean Rings branch, upstream-hg, updated. b4a5cffaa908c53e1d958a42110f8c4dad853aa3
Alexander Dreyer
adreyer at gmx.de
Fri Mar 23 08:02:17 UTC 2012
The following commit has been merged in the upstream-hg branch:
commit b2132431b626c138ff61bc836049f52380c7945a
Author: Alexander Dreyer <adreyer at gmx.de>
Date: Thu Mar 1 22:59:38 2012 +0100
CHA renamed DelayedLongProduct to PseudoLongProduct
diff --git a/SConstruct b/SConstruct
index 7f44785..9b5fea6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -965,7 +965,7 @@ env.Clean(DocPath('c++'), docutarget)
testclasses = Split("""GroebnerStrategy spoly term_accumulate CStringLiteral BooleEnv BooleSet BooleConstant BoolePolyRing BooleExponent BooleVariable BooleMonomial BoolePolynomial PBoRiError CCuddDDFacade DegRevLexAscOrder DegLexOrder
BlockDegRevLexAscOrder BlockDegLexOrder LexOrder
CFactoryBase MonomialFactory PolynomialFactory VariableFactory SetFactory
-weak_pointers FGLMStrategy DelayedLongProduct""")
+weak_pointers FGLMStrategy PseudoLongProduct""")
# Note: use custom TEST_CPPPATH settings for testing header installation, if any
try:
diff --git a/groebner/include/polybori/groebner/DelayedLongProduct.h b/groebner/include/polybori/groebner/PseudoLongProduct.h
similarity index 75%
rename from groebner/include/polybori/groebner/DelayedLongProduct.h
rename to groebner/include/polybori/groebner/PseudoLongProduct.h
index 0ac4e2a..547b0d7 100644
--- a/groebner/include/polybori/groebner/DelayedLongProduct.h
+++ b/groebner/include/polybori/groebner/PseudoLongProduct.h
@@ -1,11 +1,11 @@
// -*- c++ -*-
//*****************************************************************************
-/** @file DelayedLongProduct.h
+/** @file PseudoLongProduct.h
*
* @author Alexander Dreyer
* @date 2012-02-23
*
- * This file includes the definition of the class @c DelayedLongProduct.
+ * This file includes the definition of the class @c PseudoLongProduct.
*
* @par Copyright:
* (c) by The PolyBoRi Team
@@ -13,8 +13,8 @@
**/
//*****************************************************************************
-#ifndef polybori_groebner_DelayedLongProduct_h_
-#define polybori_groebner_DelayedLongProduct_h_
+#ifndef polybori_groebner_PseudoLongProduct_h_
+#define polybori_groebner_PseudoLongProduct_h_
// include basic definitions
#include "groebner_defs.h"
@@ -23,20 +23,20 @@
BEGIN_NAMESPACE_PBORIGB
-/** @class DelayedLongProduct
+/** @class PseudoLongProduct
* @brief This class defines a delayed product of longs and comparison with
* @c LongLong Constant.
*
**/
-class DelayedLongProduct:
+class PseudoLongProduct:
protected BitMask<sizeof(unsigned long)*4> {
public:
typedef unsigned long long_type;
- DelayedLongProduct(const long_type& first, const long_type & second):
- least(low(first)*low(second)), most(high(first)*high(second)) {
+ PseudoLongProduct(const long_type& first, const long_type& second):
+ most(high(first)*high(second)), least(low(first)*low(second)) {
long_type mixed = high(least) + high(first)*low(second);
most += high(mixed);
@@ -70,7 +70,7 @@ private:
template <class RhsType>
inline bool
-operator> (DelayedLongProduct lhs, const RhsType& rhs) {
+operator> (PseudoLongProduct lhs, const RhsType& rhs) {
return lhs.greater(rhs);
}
@@ -78,4 +78,4 @@ operator> (DelayedLongProduct lhs, const RhsType& rhs) {
END_NAMESPACE_PBORIGB
-#endif /* polybori_groebner_DelayedLongProduct_h_ */
+#endif /* polybori_groebner_PseudoLongProduct_h_ */
diff --git a/groebner/include/polybori/groebner/linear_algebra_step.h b/groebner/include/polybori/groebner/linear_algebra_step.h
index c280b3c..05ae13a 100644
--- a/groebner/include/polybori/groebner/linear_algebra_step.h
+++ b/groebner/include/polybori/groebner/linear_algebra_step.h
@@ -27,7 +27,7 @@
#include "PolyMonomialPairComparerLess.h"
#include "BitMask.h"
-#include "DelayedLongProduct.h"
+#include "PseudoLongProduct.h"
#include "Long64From32BitsPair.h"
#ifdef PBORI_HAVE_NTL
@@ -267,7 +267,7 @@ linalg_step_modified(std::vector < Polynomial > &polys, MonomialSet terms, Monom
int unmodified_cols=terms.size();
/// This checks cols*rows > 20000000000 = 4*2^32 + 2820130816
- if (PBORI_UNLIKELY( (DelayedLongProduct(unmodified_cols, unmodified_rows) >
+ if (PBORI_UNLIKELY( (PseudoLongProduct(unmodified_cols, unmodified_rows) >
Long64From32BitsPair<4u, 2820130816u>::get()) )){
PBoRiError error(CTypes::matrix_size_exceeded);
throw error;
diff --git a/testsuite/src/DelayedLongProductTest.cc b/testsuite/src/PseudoLongProductTest.cc
similarity index 57%
rename from testsuite/src/DelayedLongProductTest.cc
rename to testsuite/src/PseudoLongProductTest.cc
index 0de6fcf..ad9b796 100644
--- a/testsuite/src/DelayedLongProductTest.cc
+++ b/testsuite/src/PseudoLongProductTest.cc
@@ -1,6 +1,6 @@
// -*- c++ -*-
//*****************************************************************************
-/** @file DelayedLongProductTest.cc
+/** @file PseudoLongProductTest.cc
*
* @author Alexander Dreyer
* @date 2012-02-24
@@ -18,7 +18,7 @@
#include <boost/test/output_test_stream.hpp>
using boost::test_tools::output_test_stream;
-#include <polybori/groebner/DelayedLongProduct.h>
+#include <polybori/groebner/PseudoLongProduct.h>
#include <polybori/groebner/PseudoLongLong.h>
#include <polybori/groebner/Long64From32BitsPair.h>
USING_NAMESPACE_PBORI
@@ -37,62 +37,62 @@ struct Fdelayedlongprod {
};
-BOOST_FIXTURE_TEST_SUITE(DelayedLongProductTest, Fdelayedlongprod)
+BOOST_FIXTURE_TEST_SUITE(PseudoLongProductTest, Fdelayedlongprod)
BOOST_AUTO_TEST_CASE(test_less) {
BOOST_TEST_MESSAGE( "operator<..." );
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(-1),
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(-1),
long_type(-1)) >
PseudoLongLong<long_type(-1), long_type(-1)>()), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(-1),
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(-1),
long_type(-1)) >
PseudoLongLong<long_type(-1), 0>()), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(-1),
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(-1),
long_type(-1)) >
PseudoLongLong<long_type(-1)/2,
long_type(-1)>()), true);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(2)<< nhalf,
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(2)<< nhalf,
long_type(2)<< nhalf) >
PseudoLongLong<3,long_type(-1)>()), true);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(2)<< nhalf ,
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(2)<< nhalf ,
long_type(2)<< nhalf ) >
PseudoLongLong<4,0>()), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(2)<< nhalf,
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(2)<< nhalf,
long_type(2)<< nhalf )>
PseudoLongLong<4,1>()), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(5, 7) > 34), true);
- BOOST_CHECK_EQUAL((DelayedLongProduct(5, 7) > 35), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(5, 7) > 36), false);
+ BOOST_CHECK_EQUAL((PseudoLongProduct(5, 7) > 34), true);
+ BOOST_CHECK_EQUAL((PseudoLongProduct(5, 7) > 35), false);
+ BOOST_CHECK_EQUAL((PseudoLongProduct(5, 7) > 36), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<nhalf, 7) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<nhalf, 7) >
long_type(34)<<nhalf), true);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<nhalf, 7) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<nhalf, 7) >
long_type(35)<<nhalf), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<nhalf, 7) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<nhalf, 7) >
long_type(36)<<nhalf), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<(nhalf - 4), long_type(7)<<(nhalf-4)) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<(nhalf - 4), long_type(7)<<(nhalf-4)) >
long_type(34)<<(nbits - 8)), true);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<(nhalf - 4), long_type(7)<<(nhalf-4)) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<(nhalf - 4), long_type(7)<<(nhalf-4)) >
long_type(35)<<(nbits - 8)), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<(nhalf - 4), long_type(7)<<(nhalf-4)) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<(nhalf - 4), long_type(7)<<(nhalf-4)) >
long_type(36)<<(nbits - 8)), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(3)<<16, long_type(1)<<16) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(3)<<16, long_type(1)<<16) >
Long64From32BitsPair<4, 0>::get()), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(4)<<16, long_type(1)<<16) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(4)<<16, long_type(1)<<16) >
Long64From32BitsPair<4, 0>::get()), false);
- BOOST_CHECK_EQUAL((DelayedLongProduct(long_type(5)<<16, long_type(1)<<16) >
+ BOOST_CHECK_EQUAL((PseudoLongProduct(long_type(5)<<16, long_type(1)<<16) >
Long64From32BitsPair<4, 0>::get()), true);
--
polybori: Polynomials over Boolean Rings
More information about the debian-science-commits
mailing list