Changeset e5422d in git for libpolys/tests/coeffs_test.h


Ignore:
Timestamp:
Apr 19, 2011, 6:16:27 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7f602bf34cba1848ae22dbe21a65ea4f2460604f
Parents:
8c99125adf3766ea3c93c4198e3f4aeed1b29b5f
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-04-19 18:16:27+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:20+01:00
Message:
fixed zero divisior issue in Z/2^mZ
coauthor: Frank Seelisch <seelisch@mathematik.uni-kl.de>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/tests/coeffs_test.h

    r8c9912 re5422d  
    3939 
    4040  number sum1 = n_Init(ssss, r);
    41   clog<< "sum1(int): "; PrintSized(sum1, r);
     41  clog<< "N*(N+1)/2 (int: " << ssss << "): "; PrintSized(sum1, r);
    4242
    4343  number s, ss, i, res;
     
    4848  n_Delete(&i, r);
    4949 
     50  clog<< "N*(N+1): ("<< N*(N+1) << ")"; PrintSized(s, r); 
     51 
    5052  i = n_Init(2, r);
     53  clog<< "2: "; PrintSized(i, r); 
    5154
    5255  if( !n_IsZero( i, r) )
     
    5558    res = n_Div(s, i, r);
    5659 
    57     clog<< "res: "; PrintSized(res, r);
    58 
    59     TS_ASSERT( n_Equal(sum1, res, r) );
    60     TS_ASSERT( n_Equal(res, sum1, r) );
     60    clog<< "N*(N+1)/2: "; PrintSized(res, r);
     61    number d = n_Sub(res, sum1, r);
     62   
     63    TS_ASSERT( ndIsZeroDivisor(d, r) );
     64   
     65    if( n_GetChar(r) == 0 )
     66    {
     67      TS_ASSERT( n_Equal(sum1, res, r) );
     68      TS_ASSERT( n_Equal(res, sum1, r) );
     69    }
    6170  } else
    6271    TS_ASSERT_EQUALS( n_GetChar(r), 2);
     
    8291
    8392  ss = n_Neg(ss, r); // ss = -ss
    84  
    85  
     93 
     94  clog<< "real sum    : "; PrintSized(s, r);
     95  clog<< "real sum(--): "; PrintSized(ss, r); 
     96
    8697  TS_ASSERT( n_Equal(s, ss, r) );
    8798  TS_ASSERT( n_Equal(ss, s, r) );
    8899
    89   clog<< "s: "; PrintSized(s, r);
    90   clog<< "ss: "; PrintSized(ss, r); 
    91 
    92100  n_Delete(&s, r);   
    93101  n_Delete(&ss, r);   
     102
     103  clog << ( " >>> TEST DONE!" );
     104  clog << endl;
     105
    94106}
    95107
     
    161173  n_Delete(&aa1, r);
    162174  n_Delete(&aa2, r);
     175
     176
     177  clog << ( " >>> TEST DONE!" );
     178  clog << endl;
     179
    163180}
    164181
     
    212229      TS_ASSERT(  nCoeff_is_Q( r ));
    213230      TS_ASSERT(  nCoeff_is_Domain( r ));
    214       TS_ASSERT(  nCoeff_has_Units( r ));
    215       TS_ASSERT(  nCoeff_has_simple_inverse( r ));// ?
    216       TS_ASSERT(  nCoeff_has_simple_Alloc( r )); // ?
     231
     232      TS_ASSERT( !nCoeff_has_Units( r )); // ?
     233      TS_ASSERT( !nCoeff_has_simple_inverse( r ));// ?
     234      TS_ASSERT( !nCoeff_has_simple_Alloc( r )); // ?
    217235
    218236      TS_ASSERT( !nCoeff_is_Ring_2toM( r ));
     
    291309
    292310  TestArith( r );
     311  TestSum( r, 10 );
    293312  TestSum( r, 100 );
    294   TestSum( r, 1000 );
     313  TestSum( r, 101 );
     314  TestSum( r, 1001 );
     315  TestSum( r, 9000 );
    295316
    296317  nKillChar( r );
    297 
    298   clog << ( " >>> TEST DONE!" );
    299   clog << endl;
    300318
    301319  return TRUE;
Note: See TracChangeset for help on using the changeset viewer.