From 5d4acb7a868ca565f426de9b053b6a45d6621fbf Mon Sep 17 00:00:00 2001 From: Cotton Seed Date: Wed, 14 Dec 2011 13:32:28 -0500 Subject: [PATCH] Added /serial.cmd* to .gitignore. Minor changes to build with version of gcc on newcomp. Use global reference (::) in linear_combination* typedefs in ring classes. Renamed linear_combiation::set set_coeff. --- .gitignore | 1 + algebra/Q.h | 4 ++-- algebra/Z.h | 8 +++++--- algebra/Z2.h | 4 ++-- algebra/Zp.h | 4 ++-- algebra/fraction_field.h | 4 ++-- algebra/linear_combination.h | 4 ++-- algebra/module.h | 12 ++++++------ algebra/multivariate_polynomial.h | 6 +++--- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 620aafd..0578269 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /gss /main /testsurfaces +/serial.cmd* diff --git a/algebra/Q.h b/algebra/Q.h index db25a54..0a4b705 100644 --- a/algebra/Q.h +++ b/algebra/Q.h @@ -2,9 +2,9 @@ class Q { public: - typedef linear_combination linear_combination; + typedef ::linear_combination linear_combination; // typedef linear_combination_iter linear_combination_iter; - typedef linear_combination_const_iter linear_combination_const_iter; + typedef ::linear_combination_const_iter linear_combination_const_iter; private: int n; diff --git a/algebra/Z.h b/algebra/Z.h index bd4ee2d..19b8a9a 100644 --- a/algebra/Z.h +++ b/algebra/Z.h @@ -2,8 +2,8 @@ class Z { public: - typedef linear_combination linear_combination; - typedef linear_combination_const_iter linear_combination_const_iter; + typedef ::linear_combination linear_combination; + typedef ::linear_combination_const_iter linear_combination_const_iter; enum steal { STEAL }; @@ -150,7 +150,9 @@ class Z triple extended_gcd (const Z &z) const { mpz_t d, s, t; - mpz_inits (d, s, t, 0); + mpz_init (d); + mpz_init (s); + mpz_init (t); mpz_gcdext (d, s, t, impl->x, z.impl->x); return triple (Z (STEAL, d), Z (STEAL, s), diff --git a/algebra/Z2.h b/algebra/Z2.h index 84e5b12..ea4514b 100644 --- a/algebra/Z2.h +++ b/algebra/Z2.h @@ -1,9 +1,9 @@ class Z2 { public: - typedef linear_combination linear_combination; + typedef ::linear_combination linear_combination; // typedef linear_combination_iter linear_combination_iter; - typedef linear_combination_const_iter linear_combination_const_iter; + typedef ::linear_combination_const_iter linear_combination_const_iter; private: bool v; diff --git a/algebra/Zp.h b/algebra/Zp.h index 6c6e1ae..dc53609 100644 --- a/algebra/Zp.h +++ b/algebra/Zp.h @@ -3,8 +3,8 @@ template class Zp { public: - typedef linear_combination > linear_combination; - typedef linear_combination_const_iter > linear_combination_const_iter; + typedef ::linear_combination > linear_combination; + typedef ::linear_combination_const_iter > linear_combination_const_iter; private: unsigned v; diff --git a/algebra/fraction_field.h b/algebra/fraction_field.h index ab7b278..d2ea6a4 100644 --- a/algebra/fraction_field.h +++ b/algebra/fraction_field.h @@ -2,8 +2,8 @@ template class fraction_field { public: - typedef linear_combination linear_combination; - typedef linear_combination_const_iter linear_combination_const_iter; + typedef ::linear_combination linear_combination; + typedef ::linear_combination_const_iter linear_combination_const_iter; private: T num; diff --git a/algebra/linear_combination.h b/algebra/linear_combination.h index f4f83f7..92e62dc 100644 --- a/algebra/linear_combination.h +++ b/algebra/linear_combination.h @@ -93,7 +93,7 @@ class linear_combination R annihilator () const; - void set (R c, unsigned i) + void set_coeff (R c, unsigned i) { if (c == 0) v -= i; @@ -348,7 +348,7 @@ class linear_combination return Z2 (operator == (0) ? 1 : 0); } - void set (Z2 c, unsigned i) + void set_coeff (Z2 c, unsigned i) { if (c == 0) v -= i; diff --git a/algebra/module.h b/algebra/module.h index c43cd15..edbff66 100644 --- a/algebra/module.h +++ b/algebra/module.h @@ -529,10 +529,10 @@ quotient_helper::improve_pivot_column (unsigned i, unsigned j, unsigned j2) R rkc = rk(j), rkc2 = rk(j2); - rk.set (rkc*t.second + rkc2*t.third, - j); - rk.set (rkc2*(rc.div (t.first)) - rkc*(rc2.div (t.first)), - j2); + rk.set_coeff (rkc*t.second + rkc2*t.third, + j); + rk.set_coeff (rkc2*(rc.div (t.first)) - rkc*(rc2.div (t.first)), + j2); } linear_combination g = generators[j], @@ -560,8 +560,8 @@ quotient_helper::improve_pivot_column (unsigned i, unsigned j, unsigned j2) R d = ginv(j), d2 = ginv(j2); - ginv.set (t.second*d + t.third*d2, j); - ginv.set (rc.div (t.first) * d2 - rc2.div (t.first) * d, j2); + ginv.set_coeff (t.second*d + t.third*d2, j); + ginv.set_coeff (rc.div (t.first) * d2 - rc2.div (t.first) * d, j2); } #if 0 diff --git a/algebra/multivariate_polynomial.h b/algebra/multivariate_polynomial.h index 73038fa..84c7d8f 100644 --- a/algebra/multivariate_polynomial.h +++ b/algebra/multivariate_polynomial.h @@ -134,8 +134,8 @@ template class multivariate_polynomial { public: - typedef linear_combination > linear_combination; - typedef linear_combination_const_iter > + typedef ::linear_combination > linear_combination; + typedef ::linear_combination_const_iter > linear_combination_const_iter; private: @@ -268,7 +268,7 @@ public: pair uncommon_factors (multivariate_polynomial b, basedvector ds); maybe - divides_exactly (const multivariate_polynomial &n) const; + divides_exactly (const multivariate_polynomial &num) const; multivariate_polynomial divide_exact (const multivariate_polynomial &d) const; bool operator | (const multivariate_polynomial &num) const { abort (); }