Changeset 7049b2 in git


Ignore:
Timestamp:
Dec 8, 2000, 1:47:37 PM (22 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
2639fd85c62e265b9d5351a9fd025336832879df
Parents:
6aef97b3678a5fb25e12017e60d3dea6563d2494
Message:
*hannes: napSetExp


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

Legend:

Unmodified
Added
Removed
  • Singular/clapconv.cc

    r6aef97b r7049b2  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapconv.cc,v 1.29 2000-12-06 11:03:08 Singular Exp $
     5// $Id: clapconv.cc,v 1.30 2000-12-08 12:47:37 Singular Exp $
    66/*
    77* ABSTRACT: convert data between Singular and factory
     
    2525static void convRec( const CanonicalForm & f, int * exp, poly & result );
    2626
    27 static void convRecAlg( const CanonicalForm & f, int * exp, alg & result );
     27static void convRecAlg( const CanonicalForm & f, int * exp, napoly & result );
    2828
    2929static void convRecPP ( const CanonicalForm & f, int * exp, poly & result );
    3030
    31 static void convRecPTr ( const CanonicalForm & f, int * exp, alg & result );
     31static void convRecPTr ( const CanonicalForm & f, int * exp, napoly & result );
    3232
    3333static void convRecAP ( const CanonicalForm & f, int * exp, poly & result );
     
    240240
    241241CanonicalForm
    242 convSingTrClapP( alg p )
     242convSingTrClapP( napoly p )
    243243{
    244244  CanonicalForm result = 0;
     
    299299}
    300300
    301 alg
     301napoly
    302302convClapPSingTr ( const CanonicalForm & f )
    303303{
     
    308308  // for ( int i = 0; i < n; i++ ) exp[i] = 0;
    309309  memset(exp,0,n*sizeof(int));
    310   alg result = NULL;
     310  napoly result = NULL;
    311311  convRecPTr( f, exp, result );
    312312  delete [] exp;
     
    315315
    316316static void
    317 convRecPTr ( const CanonicalForm & f, int * exp, alg & result )
     317convRecPTr ( const CanonicalForm & f, int * exp, napoly & result )
    318318{
    319319  if (f == 0)
     
    331331  else
    332332  {
    333     alg term = napNew();
     333    napoly term = napNew();
    334334    // napNext( term ) = NULL; //already done by napNew
    335335    for ( int i = 1; i <= napVariables; i++ )
    336       napGetExp( term, i ) = exp[i];
     336      napSetExp( term, i , exp[i]);
    337337    if ( getCharacteristic() != 0 )
    338338    {
     
    426426  else
    427427  {
    428     alg z=(alg)convClapASingA( f );
     428    napoly z=(napoly)convClapASingA( f );
    429429    if (z!=NULL)
    430430    {
     
    435435        pSetExp( term, i , exp[i+off]);
    436436      pSetComp(term, 0);
    437       for ( i = 0; i < off; i++ )
    438         z->e[i]+=exp[i+1];
     437      for ( i = 1; i <= off; i++ )
     438        //z->e[i-1]+=exp[i];
     439        napAddExp(z,i,exp[i]);
    439440      pGetCoeff(term)=(number)omAlloc0Bin(rnumber_bin);
    440441      ((lnumber)pGetCoeff(term))->z=z;
     
    445446}
    446447
    447 CanonicalForm convSingAClapA ( alg p , const Variable & a )
     448CanonicalForm convSingAClapA ( napoly p , const Variable & a )
    448449{
    449450  CanonicalForm result = 0;
     
    529530}
    530531
    531 alg convClapASingA ( const CanonicalForm & f )
    532 {
    533   alg a=NULL;
    534   alg t;
     532napoly convClapASingA ( const CanonicalForm & f )
     533{
     534  napoly a=NULL;
     535  napoly t;
    535536  for( CFIterator i=f; i.hasTerms(); i++)
    536537  {
     
    540541    if (nacIsZero(napGetCoeff(t)))
    541542    {
    542       napDelete(&t);
    543     }
    544     else
    545     {
    546       napGetExp(t,1)=i.exp();
     543      p_Delete(&t, currRing->algring);
     544    }
     545    else
     546    {
     547      napSetExp(t,1,i.exp());
    547548      a=napAdd(a,t);
    548549    }
Note: See TracChangeset for help on using the changeset viewer.