Changeset bfde6c in git for libpolys/tests/polys_test.h
- Timestamp:
- Apr 27, 2011, 1:01:09 PM (12 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- b5b9dc3fbf31410fce6496f383303df8ed1e5461
- Parents:
- b7d7eb00647832d8b7ba2d7f853accc84ba835b5
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-04-27 13:01:09+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
rb7d7eb rbfde6c 55 55 namespace 56 56 { 57 57 58 void PrintRing(const ring r) 58 59 { … … 100 101 void TestSum(const ring r, const unsigned long N) 101 102 { 103 TS_ASSERT_DIFFERS( r , NULLp); 104 TS_ASSERT_DIFFERS( r->cf, NULLp); 105 106 102 107 clog << ( _2S("TEST: sum[0..") + _2S(N) + "]: "); 103 108 clog << endl; … … 110 115 clog<< "poly(N*(N+1)/2) (int: " << ssss << "): "; PrintSized(sum1, r); 111 116 112 poly s, ss, i, res; 117 poly s, ss, i, res; res = NULL; 113 118 114 119 s = p_Init(N , r); … … 120 125 121 126 number t = n_Init(2, r->cf); 122 clog<< "number(2): "; PrintSized( i, r);127 clog<< "number(2): "; PrintSized(t, r->cf); 123 128 124 129 if( !n_IsZero( t, r->cf) ) 125 130 { 126 TS_ASSERT( n_DivBy(p_GetCoeff(i, r), t, r->cf) ); 127 res = p_Div_nn(i, t, r); i = NULL; 128 131 if( i != NULL ) 132 { 133 number ii = p_GetCoeff(i, r); 134 clog<< "number(poly(N)*poly(N+1)): "; PrintSized(ii, r->cf); 135 136 TS_ASSERT( n_DivBy(ii, t, r->cf) ); 137 res = p_Div_nn(i, t, r); i = NULL; 138 } 139 140 141 129 142 clog<< "(poly(N)*poly(N+1))/number(2): "; PrintSized(res, r); 130 poly d = p_Sub( res, sum1, r);131 143 poly d = p_Sub(p_Copy(res, r), p_Copy(sum1, r), r); 144 132 145 if( d != NULL ) 133 146 TS_ASSERT( n_IsZeroDivisor(p_GetCoeff(d, r), r->cf) ); 134 147 135 148 Delete(d, r); 136 149 137 150 if( n_GetChar(r->cf) == 0 ) 138 151 {
Note: See TracChangeset
for help on using the changeset viewer.