Changeset b5b9dc in git


Ignore:
Timestamp:
Apr 27, 2011, 1:31:20 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
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
Message:
fix poly_test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/tests/polys_test.h

    rbfde6c rb5b9dc  
    8787  }
    8888
    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 
    9389static inline void Delete(poly &p, const ring r)
    9490{
     
    9995}
    10096
    101 void TestSum(const ring r, const unsigned long N)
     97void TestSum(const ring r, const int N)
    10298{
    10399  TS_ASSERT_DIFFERS( r    , NULLp);
     
    110106  assume( N > 0 ); // just for now...
    111107
    112   const unsigned long ssss = (N * (N+1)) / 2;
    113  
    114   poly sum1 = p_Init(ssss, r);
     108  const int ssss = (N * (N+1)) / 2;
     109 
     110  poly sum1 = p_ISet(ssss, r);
    115111  clog<< "poly(N*(N+1)/2) (int: " << ssss << "): "; PrintSized(sum1, r);
    116112
    117   poly s, ss, i, res; res = NULL;
    118 
    119   s = p_Init(N  , r);
    120   i = p_Init(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);
    121117
    122118  i = p_Mult_q(s, i, r); s = NULL;
     
    159155
    160156
    161   s = p_Init(0  , r);
    162   ss = p_Init(0 , r);
     157  s = NULL;
     158  ss = NULL;
    163159  for( int k = N; k >= 0; k-- )
    164160  {
    165     i = p_Init(k, r);
     161    i = p_ISet(k, r);
    166162    s = p_Add_q(s, i, r); // s += i
    167163
    168     i = p_Neg( p_Init(k, r), r );
     164    i = p_Neg( p_ISet(k, r), r );
    169165    ss = p_Add_q(ss, i, r); // ss -= i
    170166  }
Note: See TracChangeset for help on using the changeset viewer.