Changeset 32cc7e in git for libpolys/coeffs/gnumpc.cc


Ignore:
Timestamp:
Sep 28, 2011, 5:47:12 PM (11 years ago)
Author:
Burcin Erocal <burcin@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
85fd9012469ea8abe27f4869c1fdec9987b77063
Parents:
aa98be749867c7cb115d6a8245308363068b1c0d
git-author:
Burcin Erocal <burcin@erocal.org>2011-09-28 17:47:12+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:41+01:00
Message:
Implement setting precision of real and complex coefficient domains.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/gnumpc.cc

    raa98be r32cc7e  
    375375}
    376376
    377 BOOLEAN ngcInitChar(coeffs n, void* p)
     377BOOLEAN ngcCoeffIsEqual (const coeffs r, n_coeffType n, void * parameter)
     378{
     379  if (n==ID) {
     380    LongComplexInfo* p = (LongComplexInfo *)(parameter);
     381    if (p->float_len == r->float_len && p->float_len2 == r->float_len2 &&
     382                    strcmp(p->par_name, r->complex_parameter))
     383      return TRUE;
     384  }
     385  return FALSE;
     386}
     387
     388BOOLEAN ngcInitChar(coeffs n, void* parameter)
    378389{
    379390  assume( getCoeffType(n) == ID );
     391  assume( parameter != NULL);
     392
    380393  n->cfKillChar = ndKillChar; /* dummy */
    381394  n->ch = 0;
     
    411424#endif
    412425
    413   n->nCoeffIsEqual = ndCoeffIsEqual;
    414 
     426  n->nCoeffIsEqual = ngcCoeffIsEqual;
     427
     428  n->cfSetChar=ngcSetChar;
    415429
    416430
     
    418432  //r->cfInitChar=nlInitChar;
    419433  r->cfKillChar=NULL;
    420   r->cfSetChar=NULL;
    421   r->nCoeffIsEqual=nlCoeffsEqual;
    422434
    423435  r->cfMult  = nlMult;
     
    477489*/
    478490
    479 /// TODO: Any variables?
    480   if( p == NULL )
    481     n->complex_parameter = omStrDup((char*)"i");
    482   else
    483     n->complex_parameter = omStrDup( (char*) p );
     491  LongComplexInfo* p = (LongComplexInfo*)parameter;
     492  n->complex_parameter = omStrDup(p->par_name);
     493  n->float_len = p->float_len;
     494  n->float_len2 = p->float_len2;
    484495
    485496  return FALSE;
    486497}
    487498
    488 
     499void ngcSetChar(const coeffs r)
     500{
     501  setGMPFloatDigits(r->float_len, r->float_len2);
     502}
    489503
    490504
Note: See TracChangeset for help on using the changeset viewer.