Changeset 61b2e16 in git


Ignore:
Timestamp:
Nov 3, 2011, 7:40:55 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6051d879db769fabc5f68f3052af02b306ccf1a6
Parents:
a15586a3e2341feb5065aee8eaef7ffb89308451
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-11-03 19:40:55+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-11-09 20:32:41+01:00
Message:
FIX: bigints <-> numbers
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipconv.cc

    ra15586 r61b2e16  
    5353static void * iiBI2P(void *data)
    5454{
    55   number n=n_Init_bigint((number)data, currRing->cf, currRing->cf);
    56   n_Delete((number *)&data,currRing);
    57   poly p=pNSet(n);
     55  number n=n_Init_bigint((number)data, coeffs_BIGINT /*currRing->cf*/, currRing->cf);
     56  n_Delete((number *)&data, coeffs_BIGINT);
     57  poly p=p_NSet(n, currRing);
    5858  return (void *)p;
    5959}
     
    6868static void * iiBI2V(void *data)
    6969{
    70   number n=n_Init_bigint((number)data, currRing->cf, currRing->cf);
    71   n_Delete((number *)&data,coeffs_BIGINT);
    72   poly p=pNSet(n);
     70  number n=n_Init_bigint((number)data, coeffs_BIGINT/*currRing->cf*/, currRing->cf);
     71  n_Delete((number *)&data, coeffs_BIGINT);
     72  poly p=p_NSet(n, currRing);
    7373  if (p!=NULL) pSetComp(p,1);
    7474  return (void *)p;
     
    8585{
    8686  ideal I=idInit(1,1);
    87   number n=n_Init_bigint((number)data, currRing->cf, currRing->cf);
     87  number n=n_Init_bigint((number)data, coeffs_BIGINT, currRing->cf);
    8888  n_Delete((number *)&data,coeffs_BIGINT);
    8989  poly p=pNSet(n);
     
    163163{
    164164  if (currRing==NULL) return NULL;
    165   // a bigint is really a number from char 0, with diffrent operations...
    166   return (void*)n_Init_bigint((number)data, currRing->cf, currRing->cf);
     165  // a bigint is really a number from char 0, with diffrent
     166  // operations...
     167  number n = n_Init_bigint((number)data, coeffs_BIGINT, currRing->cf);
     168  n_Delete((number *)&data, coeffs_BIGINT); 
     169  return (void*)n;
    167170}
    168171
  • Tst/New.lst

    ra15586 r61b2e16  
    11New/algext_numbers.tst
     2New/bigints.tst
    23New/gf_coeff_short.tst
    34New/gf_fetch.tst
  • libpolys/coeffs/coeffs.h

    ra15586 r61b2e16  
    186186   /// Inplace: a *= b
    187187   void    (*cfInpMult)(number &a, number b, const coeffs r);
    188    /// maps the bigint i (from dummy) into the coeffs dst
     188
     189   /// maps the bigint i (from dummy == coeffs_BINGINT!!!) into the
     190   /// coeffs dst
     191   /// TODO: to be exchanged with a map!!!
    189192   number  (*cfInit_bigint)(number i, const coeffs dummy, const coeffs dst);
    190193
  • libpolys/coeffs/gnumpc.cc

    ra15586 r61b2e16  
    427427  n->cfSetChar=ngcSetChar;
    428428
     429//  r->cfInit_bigint=ngcInit_bigint;
    429430
    430431/*
  • libpolys/polys/ext_fields/algext.cc

    ra15586 r61b2e16  
    224224}
    225225
     226number naInit_bigint(number longratBigIntNumber, const coeffs src, const coeffs cf)
     227{
     228  assume( cf != NULL );
     229
     230  const ring A = cf->extRing;
     231
     232  assume( A != NULL );
     233
     234  const coeffs C = A->cf;
     235
     236  assume( C != NULL );
     237
     238  number n = n_Init_bigint(longratBigIntNumber, src, C);
     239
     240  if ( n_IsZero(n, C) )
     241  {
     242    n_Delete(&n, C);
     243    return NULL;
     244  }
     245 
     246  return (number)p_NSet(n, A);
     247}
     248
     249
     250
    226251number naInit(int i, const coeffs cf)
    227252{
     
    746771  cf->cfIsMOne       = naIsMOne;
    747772  cf->cfInit         = naInit;
     773  cf->cfInit_bigint  = naInit_bigint; 
    748774  cf->cfInt          = naInt;
    749775  cf->cfNeg          = naNeg;
  • libpolys/polys/ext_fields/transext.cc

    ra15586 r61b2e16  
    300300}
    301301
     302number ntInit_bigint(number longratBigIntNumber, const coeffs src, const coeffs cf)
     303{
     304  assume( cf != NULL );
     305
     306  const ring A = cf->extRing;
     307
     308  assume( A != NULL );
     309
     310  const coeffs C = A->cf;
     311
     312  assume( C != NULL );
     313
     314  number n = n_Init_bigint(longratBigIntNumber, src, C);
     315
     316  if ( n_IsZero(n, C) )
     317  {
     318    n_Delete(&n, C);
     319    return NULL;
     320  }   
     321
     322  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
     323
     324  NUM(result) = p_NSet(n, A);
     325  DEN(result) = NULL;
     326  COM(result) = 0;
     327  return (number)result;
     328}
     329
     330   
    302331number ntInit(int i, const coeffs cf)
    303332{
     
    12511280  cf->cfIsMOne       = ntIsMOne;
    12521281  cf->cfInit         = ntInit;
     1282  cf->cfInit_bigint  = ntInit_bigint;
    12531283  cf->cfInt          = ntInt;
    12541284  cf->cfNeg          = ntNeg;
Note: See TracChangeset for help on using the changeset viewer.