Changeset 482844 in git


Ignore:
Timestamp:
Jul 3, 2000, 12:22:17 PM (24 years ago)
Author:
Wilfred Pohl <pohl@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6361e617ac5bc0e47f935d3e88a540e628f89111
Parents:
db65122f57a5f541c93a6f282e5baf4881b09dca
Message:
bug fix from Hans (hospital)


git-svn-id: file:///usr/local/Singular/svn/trunk@4474 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/clapconv.cc

    rdb65122 r482844  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapconv.cc,v 1.24 2000-06-02 07:46:57 Singular Exp $
     5// $Id: clapconv.cc,v 1.25 2000-07-03 10:22:17 pohl Exp $
    66/*
    77* ABSTRACT: convert data between Singular and factory
     
    4444  CanonicalForm result = 0;
    4545  int e, n = pVariables;
     46  assume( rPar(currRing)==0);
    4647
    4748  while ( p != NULL )
     
    311312  CanonicalForm result = 0;
    312313  int e, n = pVariables;
     314  int off=rPar(currRing);
    313315
    314316  On(SW_RATIONAL);
     
    319321    {
    320322      if ( (e = pGetExp( p, i )) != 0 )
    321         term *= power( Variable( i+1 ), e );
     323        term *= power( Variable( i + off), e );
    322324    }
    323325    result += term;
     
    329331poly convClapAPSingAP ( const CanonicalForm & f )
    330332{
    331   int n = pVariables+1+1 /* =rPar(currRing)*/;
    332   /* ASSERT( level( f ) <= pVariables, "illegal number of variables" ); */
     333  int n = pVariables+1+1/*rPar(currRing)*/;
    333334  int * exp = new int[n];
    334335  // for ( int i = 0; i < n; i++ ) exp[i] = 0;
     
    345346  if (f == 0)
    346347    return;
     348  int off=rPar(currRing);
    347349  if ( ! f.inCoeffDomain() )
    348350  {
    349351    int l = f.level();
    350     if (l==1) PrintS("f.inCoeffDomain()=FALSE and level=1 ?\n");
    351352    for ( CFIterator i = f; i.hasTerms(); i++ )
    352353    {
    353       exp[l-1] = i.exp();
     354      exp[l] = i.exp();
    354355      convRecAP( i.coeff(), exp, result );
    355356    }
    356     exp[l-1] = 0;
     357    exp[l] = 0;
    357358  }
    358359  else
     
    363364      poly term = pInit();
    364365      pNext( term ) = NULL;
    365       for ( int i = 1; i <= pVariables; i++ )
    366         pSetExp( term, i , exp[i]);
     366      int i;
     367      for ( i = 1; i <= pVariables; i++ )
     368        pSetExp( term, i , exp[i+off]);
    367369      pSetComp(term, 0);
     370      for ( i = 0; i < off; i++ )
     371        z->e[i]+=exp[i+1];
    368372      pGetCoeff(term)=(number)Alloc0SizeOf(rnumber);
    369373      ((lnumber)pGetCoeff(term))->z=z;
     
    382386  {
    383387    CanonicalForm term;
    384     /* does only work for finite fields */
    385     if ( getCharacteristic() != 0 )
     388    /* does only work for finite fields:Z/p */
     389    if ( rField_is_Zp_a() )
    386390    {
    387391      Off(SW_USE_EZGCD);
     
    394398      //&&  ( napGetCoeff( p )->s == 0))
    395399      //  naNormalize( naGetCoeff( p ) );
    396       if ( (int)(napGetCoeff( p )) & 1 )
     400      if ( (int)(napGetCoeff( p )) & SR_INT )
    397401        term = nlInt( napGetCoeff( p ) );
     402        //term = SR_TO_INT(napGetCoeff( p )) ;
    398403      else
    399404      {
     
    503508{
    504509  int n = pVariables+1;
    505   /* ASSERT( level( f ) <= pVariables, "illegal number of variables" ); */
    506510  int * exp = new int[n];
    507511  // for ( int i = 0; i < n; i++ ) exp[i] = 0;
  • Singular/clapsing.cc

    rdb65122 r482844  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapsing.cc,v 1.67 2000-06-14 07:29:59 Singular Exp $
     5// $Id: clapsing.cc,v 1.68 2000-07-03 10:22:17 pohl Exp $
    66/*
    77* ABSTRACT: interface between Singular and factory
     
    133133  StringSetS( tag ); \
    134134  napWrite( f ); \
    135   PrintS(StringAppendS("\n"));
     135  pRINtS(StringAppendS("\n"));
    136136// CanonicalForm f, represents transcendent extension
    137137#define FACTORY_CFTROUT_POLY( tag, f ) \
     
    294294    if (currRing->minpoly!=NULL)
    295295    {
    296       Variable X(i+rPar(currRing));
     296      Variable X(i);
    297297      CanonicalForm mipo=convSingTrClapP(((lnumber)currRing->minpoly)->z);
    298298      Variable a=rootOf(mipo);
  • Singular/longrat.cc

    rdb65122 r482844  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longrat.cc,v 1.28 2000-05-02 14:55:41 Singular Exp $ */
     4/* $Id: longrat.cc,v 1.29 2000-07-03 10:21:20 pohl Exp $ */
    55/*
    66* ABSTRACT: computation with long rational numbers (Hubert Grassmann)
     
    106106/*#define SR_INT    1*/
    107107/*#define INT_TO_SR(INT)  ((number) (((long)INT << 2) + SR_INT))*/
    108 #define SR_TO_INT(SR)   (((long)SR) >> 2)
     108// #define SR_TO_INT(SR)   (((long)SR) >> 2)
    109109
    110110#define MP_SMALL 1
  • Singular/longrat.h

    rdb65122 r482844  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: longrat.h,v 1.15 1999-11-15 17:20:20 obachman Exp $ */
     6/* $Id: longrat.h,v 1.16 2000-07-03 10:21:21 pohl Exp $ */
    77/*
    88* ABSTRACT: computation with long rational numbers
     
    3030#define SR_INT    1
    3131#define INT_TO_SR(INT)  ((number) (((long)INT << 2) + SR_INT))
     32#define SR_TO_INT(SR)   (((long)SR) >> 2)
     33
    3234
    3335#define MP_SMALL 1
  • Singular/subexpr.cc

    rdb65122 r482844  
    55* ABSTRACT: handling of leftv
    66*/
    7 /* $Id: subexpr.cc,v 1.56 2000-04-27 10:07:11 obachman Exp $ */
     7/* $Id: subexpr.cc,v 1.57 2000-07-03 10:21:21 pohl Exp $ */
    88
    99#include <stdlib.h>
     
    978978  if (rtyp == IDHDL)
    979979  {
    980     (void*) IDDATA((idhdl)data) = what;
     980    IDDATA((idhdl)data) = (char *)what;
    981981  }
    982982  else
Note: See TracChangeset for help on using the changeset viewer.