Changeset 5a9405 in git


Ignore:
Timestamp:
Apr 16, 2010, 7:17:56 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
f5071ec27a184f35ac683643fbcb1eb088007333
Parents:
18640237cc3e76a4bdf4279f3fc1ac7fb9cdb4c3
Message:
gmp stuff/factory

git-svn-id: file:///usr/local/Singular/svn/trunk@12732 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/clapconv.cc

    r186402 r5a9405  
    2424#include "ffields.h"
    2525
     26typedef __mpz_struct lint;
     27
    2628void out_cf(char *s1,const CanonicalForm &f,char *s2);
    2729
     
    5658      if ( n->s == 3 )
    5759      {
    58         term = make_cf( n->z );
     60        lint dummy;
     61        mpz_init_set( &dummy,n->z );
     62        term = make_cf( dummy );
    5963      }
    6064      else
    6165      {
    6266        // assume s==0 or s==1
     67        lint num, den;
    6368        On(SW_RATIONAL);
    64         term = make_cf(  n->z,  n->n, ( n->s != 1 ));
     69        mpz_init_set( &num, n->z );
     70        mpz_init_set( &den, n->n );
     71        term = make_cf( num, den, ( n->s != 1 ));
    6572      }
    6673    }
     
    179186        if ( pGetCoeff( p )->s == 3 )
    180187        {
    181           term = make_cf( pGetCoeff( p )->z );
     188          lint dummy;
     189          mpz_init_set( &dummy, (pGetCoeff( p )->z) );
     190          term = make_cf( dummy );
    182191        }
    183192        else
    184193        {
    185194          // assume s==0 or s==1
     195          lint num, den;
    186196          On(SW_RATIONAL);
    187           term = make_cf( pGetCoeff( p )->z, pGetCoeff( p )->n,
    188                           ( pGetCoeff( p )->s != 1 ));
     197          mpz_init_set( &num, (pGetCoeff( p )->z) );
     198          mpz_init_set( &den, (pGetCoeff( p )->n) );
     199          term = make_cf( num, den, ( pGetCoeff( p )->s != 1 ));
    189200        }
    190201      }
     
    311322        if ( napGetCoeff( p )->s == 3 )
    312323        {
    313           term = make_cf( napGetCoeff( p )->z );
     324          lint dummy;
     325          mpz_init_set( &dummy, (napGetCoeff( p )->z) );
     326          term = make_cf( dummy );
    314327        }
    315328        else
    316329        {
    317330          // assume s==0 or s==1
     331          lint num, den;
    318332          On(SW_RATIONAL);
    319           term = make_cf( napGetCoeff( p )->z, napGetCoeff( p )->n,
    320                           (napGetCoeff( p )->s != 1 ));
     333          mpz_init_set( &num, (napGetCoeff( p )->z) );
     334          mpz_init_set( &den, (napGetCoeff( p )->n) );
     335          term = make_cf( num, den, ( napGetCoeff( p )->s != 1 ));
    321336        }
    322337      }
Note: See TracChangeset for help on using the changeset viewer.