Changeset b5b9dc in git
- Timestamp:
- Apr 27, 2011, 1:31:20 PM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- afa93aa59dae6413c863fbb12cc8da08c0e29d62
- Parents:
- bfde6c340bc1be1300eb00e9830173f5e19e5bc9
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-04-27 13:31:20+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:29+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/tests/polys_test.h
rbfde6c rb5b9dc 87 87 } 88 88 89 template <typename T>90 static inline poly p_Init(T v, const ring r)91 { assume(r != NULL); return p_ISet(v, r); }92 93 89 static inline void Delete(poly &p, const ring r) 94 90 { … … 99 95 } 100 96 101 void TestSum(const ring r, const unsigned longN)97 void TestSum(const ring r, const int N) 102 98 { 103 99 TS_ASSERT_DIFFERS( r , NULLp); … … 110 106 assume( N > 0 ); // just for now... 111 107 112 const unsigned longssss = (N * (N+1)) / 2;113 114 poly sum1 = p_I nit(ssss, r);108 const int ssss = (N * (N+1)) / 2; 109 110 poly sum1 = p_ISet(ssss, r); 115 111 clog<< "poly(N*(N+1)/2) (int: " << ssss << "): "; PrintSized(sum1, r); 116 112 117 poly s , ss, i, res; res =NULL;118 119 s = p_I nit(N , r);120 i = p_I nit(N+1, r);113 poly s=NULL, ss=NULL, i=NULL, res=NULL; 114 115 s = p_ISet(N , r); 116 i = p_ISet(N+1, r); 121 117 122 118 i = p_Mult_q(s, i, r); s = NULL; … … 159 155 160 156 161 s = p_Init(0 , r);162 ss = p_Init(0 , r);157 s = NULL; 158 ss = NULL; 163 159 for( int k = N; k >= 0; k-- ) 164 160 { 165 i = p_I nit(k, r);161 i = p_ISet(k, r); 166 162 s = p_Add_q(s, i, r); // s += i 167 163 168 i = p_Neg( p_I nit(k, r), r );164 i = p_Neg( p_ISet(k, r), r ); 169 165 ss = p_Add_q(ss, i, r); // ss -= i 170 166 }
Note: See TracChangeset
for help on using the changeset viewer.