Changeset 6fc941 in git


Ignore:
Timestamp:
May 29, 2006, 6:10:50 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
9f738e4e4d9a2396fedb4bf644b5fc7cbac460ad
Parents:
7145030af0d072406bdbbd5f4cbd550cdea8ccba
Message:
*hannes: bigint prep (3)


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

Legend:

Unmodified
Added
Removed
  • Singular/ipconv.cc

    r714503 r6fc941  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipconv.cc,v 1.28 2005-07-27 15:47:57 Singular Exp $ */
     4/* $Id: ipconv.cc,v 1.29 2006-05-29 16:10:50 Singular Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    1717#include "subexpr.h"
    1818#include "numbers.h"
     19#include "modulop.h"
     20#include "longalg.h"
    1921#include "matpol.h"
    2022#include "silink.h"
     
    9698  return (void *)m;
    9799}
     100static void * iiBI2N(void *d)
     101{
     102  void *r=NULL;
     103  if (rField_is_Q())
     104    r=d;
     105  else
     106  {
     107    number n=(number)d;
     108    if (rField_is_Zp())
     109    {
     110      r=(void *)npMap0(n);
     111    }
     112    else if (rField_is_Q_a())
     113    {
     114      r=(void *)naMap00(n);
     115    }
     116    else if (rField_is_Zp_a())
     117    {
     118      r=(void *)naMap0P(n);
     119    }
     120    else
     121      WerrorS("cannot convert bigint to this field");
     122    nlDelete(&n,NULL);
     123  }
     124  return r;
     125}
     126
     127static void * iiN2P(void *data);
     128static void * iiBI2P(void *d)
     129{
     130  void *r=iiBI2N(d);
     131  if(errorreported) return NULL;
     132  else              return iiN2P(r);
     133}
    98134
    99135static void * iiDummy(void *data)
     
    124160{
    125161  number n=nInit((int)(long)data);
     162  return (void *)n;
     163}
     164
     165static void * iiI2BI(void *data)
     166{
     167  number n=nlInit((int)(long)data);
    126168  return (void *)n;
    127169}
     
    211253{
    212254//   input type       output type     convert procedure
     255//  int -> bigint
     256   { INT_CMD,         BIGINT_CMD,     iiI2BI , NULL },
    213257//  int -> number
    214258   { INT_CMD,         NUMBER_CMD,     iiI2N , NULL },
     
    229273//  intmat -> matrix
    230274   { INTMAT_CMD,      MATRIX_CMD,     iiIm2Ma , NULL },
     275//  bigint -> number
     276   { BIGINT_CMD,      NUMBER_CMD,     iiBI2N , NULL },
     277//  bigint -> poly
     278   { BIGINT_CMD,      NUMBER_CMD,     iiBI2P , NULL },
    231279//  number -> poly
    232280   { NUMBER_CMD,      POLY_CMD,       iiN2P  , NULL },
  • Singular/ipid.cc

    r714503 r6fc941  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipid.cc,v 1.74 2006-05-29 15:14:29 Singular Exp $ */
     4/* $Id: ipid.cc,v 1.75 2006-05-29 16:10:50 Singular Exp $ */
    55
    66/*
     
    251251      case BIGINT_CMD:
    252252        IDNUMBER(h) = nlInit(0);
    253         break;
     253        break;
    254254      case IDEAL_CMD:
    255255      case MODUL_CMD:
     
    342342      {
    343343        goto errlabel;
    344       } 
     344      }
    345345      if (BVERBOSE(V_REDEFINE))
    346346        Warn("redefining %s **",s);
     
    717717  if (h2!=NULL) return h2;
    718718  if (h!=NULL) return h;
    719 #ifdef HAVE_NS 
     719#ifdef HAVE_NS
    720720  if (basePack!=currPack)
    721721    return basePack->idroot->get(n,myynest);
    722 #endif     
    723   return NULL; 
     722#endif
     723  return NULL;
    724724}
    725725
     
    727727{
    728728  if (hasFlag(h,FLAG_STD)) PrintS(" (SB)");
    729 #ifdef HAVE_PLURAL 
     729#ifdef HAVE_PLURAL
    730730  if (hasFlag(h,FLAG_TWOSTD)) PrintS(" (2SB)");
    731 #endif 
     731#endif
    732732}
    733733
Note: See TracChangeset for help on using the changeset viewer.