Changeset fc4977 in git


Ignore:
Timestamp:
Nov 8, 2011, 1:46:01 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
146c6031e29bacb7405aa0a52f67591c3cfd1d1f
Parents:
c3238c9cf73749e83476377e7c488cf63eca07fd
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-11-08 13:46:01+01:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:14:11+01:00
Message:
fix: conversion of transext to/from factory
Location:
libpolys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    rc3238c9 rfc4977  
    203203   int     char_flag;
    204204   int     ref;
     205   /// how many variables of factort are already used by this coeff
     206   int     factoryVarOffset;
    205207   n_coeffType type;
    206208//-------------------------------------------
  • libpolys/polys/clapconv.cc

    rc3238c9 rfc4977  
    6464    poly term = p_Init(r);
    6565    pNext( term ) = NULL;
     66    int varoffset=r->cf->factoryVarOffset;
    6667    for ( int i = 1; i <= r->N; i++ )
    67       p_SetExp( term, i, exp[i], r);
     68      p_SetExp( term, i-varoffset, exp[i], r);
    6869    pGetCoeff( term )=r->cf->convFactoryNSingN(f, r->cf);
    6970    p_Setm( term, r );
     
    9293    if (errorreported) break;
    9394    setChar=FALSE;
     95    int varoffset=r->cf->factoryVarOffset;
    9496    for ( int i = n; i >0; i-- )
    9597    {
    9698      if ( (e = p_GetExp( p, i, r)) != 0 )
    97         term *= power( Variable( i ), e );
     99        term *= power( Variable( i+varoffset ), e );
    98100    }
    99101    result += term;
  • libpolys/polys/ext_fields/transext.cc

    rc3238c9 rfc4977  
    5151#ifdef HAVE_FACTORY
    5252#include <polys/clapsing.h>
     53#include <polys/clapconv.h>
     54#include <factory/factory.h>
    5355#endif
    5456
     
    9092
    9193
    92 extern omBin fractionObjectBin = omGetSpecBin(sizeof(fractionObject));
     94omBin fractionObjectBin = omGetSpecBin(sizeof(fractionObject));
    9395
    9496/// forward declarations
     
    305307    fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
    306308    NUM(result) = p_ISet(i, ntRing);
    307     DEN(result) = NULL;
    308     COM(result) = 0;
     309    //DEN(result) = NULL; // done by omAlloc0Bin
     310    //COM(result) = 0; // done by omAlloc0Bin
    309311    return (number)result;
    310312  }
     
    11991201    rDelete(cf->extRing);
    12001202}
     1203#ifdef HAVE_FACTORY
     1204number ntConvFactoryNSingN( const CanonicalForm n, const coeffs cf)
     1205{
     1206  if (n.isZero()) return NULL;
     1207  poly p=convFactoryPSingP(n,ntRing);
     1208  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
     1209  NUM(result) = p;
     1210  //DEN(result) = NULL; // done by omAlloc0Bin
     1211  //COM(result) = 0; // done by omAlloc0Bin
     1212  return (number)result;
     1213}
     1214CanonicalForm ntConvSingNFactoryN( number n, BOOLEAN setChar, const coeffs cf )
     1215{
     1216  ntTest(n);
     1217  if (IS0(n)) return CanonicalForm(0);
     1218
     1219  fraction f = (fraction)n;
     1220  return convSingPFactoryP(NUM(f),ntRing);
     1221}
     1222#endif
    12011223
    12021224BOOLEAN ntInitChar(coeffs cf, void * infoStruct)
     
    12161238  cf->extRing           = e->r;
    12171239  cf->extRing->ref ++; // increase the ref.counter for the ground poly. ring!
     1240  cf->factoryVarOffset = cf->extRing->cf->factoryVarOffset+rVar(cf->extRing);
    12181241
    12191242  /* propagate characteristic up so that it becomes
     
    12611284  PrintS("//          Hence gcd's cannot be cancelled in any\n");
    12621285  PrintS("//          computed fraction!\n");
     1286#else
     1287  cf->convFactoryNSingN =ntConvFactoryNSingN;
     1288  cf->convSingNFactoryN =ntConvSingNFactoryN;
    12631289#endif
    12641290
Note: See TracChangeset for help on using the changeset viewer.