Changeset 6637ee in git


Ignore:
Timestamp:
Aug 12, 2011, 4:20:38 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '45e267b9942dec9429fe249ce3e5e44ab80a6a3a')
Children:
e92b071a14e237753ca43c8b8faad5e5199cd077
Parents:
1f414c83d736799f4aa2169403778da7b6403897
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-12 16:20:38+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:21:28+01:00
Message:
ADD: new function: number n_Param(iParameter,ring) - creates a number representing the specified parameter in the given alg./trans. extension
Location:
libpolys/polys
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/algext.cc

    r1f414c8 r6637ee  
    677677  return FALSE;
    678678}
     679
     680
     681number naParam(short iParameter, const coeffs cf)
     682{
     683  assume(getCoeffType(cf) == ID);
     684 
     685  const ring R = cf->extRing;
     686  assume( R != NULL ); 
     687  assume( 0 <= iParameter && iParameter < rVar(R) );
     688 
     689  poly p = p_One(R); p_SetExp(p, iParameter, 1, R); p_Setm(p, R);
     690 
     691  return (number) p;
     692}
  • libpolys/polys/ext_fields/algext.h

    r1f414c8 r6637ee  
    7979*/
    8080
     81/// return the specified parameter as a number in the given alg. field
     82number naParam(short iParameter, const coeffs cf);
    8183
    8284#endif
  • libpolys/polys/ext_fields/transext.cc

    r1f414c8 r6637ee  
    11301130  return FALSE;
    11311131}
     1132
     1133
     1134number ntParam(short iParameter, const coeffs cf)
     1135{
     1136  assume(getCoeffType(cf) == ID);
     1137
     1138  const ring R = cf->extRing;
     1139  assume( R != NULL ); 
     1140  assume( 0 <= iParameter && iParameter < rVar(R) );
     1141
     1142  poly p = p_One(R); p_SetExp(p, iParameter, 1, R); p_Setm(p, R);
     1143
     1144//  return (number) p;
     1145
     1146  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
     1147  NUM(f) = p;
     1148  DEN(f) = NULL;
     1149  COM(f) = 0;
     1150
     1151  return (number)f;
     1152}
  • libpolys/polys/ext_fields/transext.h

    r1f414c8 r6637ee  
    121121*/
    122122
    123 #ifdef LDEBUG
    124 #define ntTest(a) ntDBTest(a,__FILE__,__LINE__,cf)
    125 BOOLEAN  ntDBTest(number a, const char *f, const int l, const coeffs r);
    126 #else
    127 #define ntTest(a)
    128 #endif
    129 
    130 /* our own type */
    131 #define ntID n_transExt
    132 
    133 /* polynomial ring in which the numerators and denominators of our
    134    numbers live */
    135 #define ntRing cf->extRing
    136 
    137 /* coeffs object in which the coefficients of our numbers live;
    138  * methods attached to ntCoeffs may be used to compute with the
    139  * coefficients of our numbers, e.g., use ntCoeffs->nAdd to add
    140  * coefficients of our numbers */
    141 #define ntCoeffs cf->extRing->cf
     123/// return the specified parameter as a number in the given trans.ext.
     124number ntParam(short iParameter, const coeffs cf);
    142125
    143126#endif
  • libpolys/polys/monomials/ring.cc

    r1f414c8 r6637ee  
    55585558}
    55595559
     5560
     5561
     5562number n_Param(const short iParameter, const ring r)
     5563{
     5564  assume(r != NULL);
     5565  const coeffs C = r->cf;
     5566  assume(C != NULL);
     5567
     5568  const n_coeffType _filed_type = getCoeffType(C);
     5569
     5570  if ( iParameter < 0 || iParameter >= rPar(r) )
     5571    // Wrong parameter
     5572    return NULL;
     5573
     5574  if( _filed_type == n_algExt )
     5575  {
     5576    extern number naParam(short iParameter, const coeffs cf);
     5577    return naParam(iParameter, C);
     5578  }
     5579 
     5580  if( _filed_type == n_transExt )
     5581  {
     5582    extern number ntParam(short iParameter, const coeffs cf);
     5583    return ntParam(iParameter, C);
     5584  }
     5585   
     5586  return NULL;
     5587}
     5588
  • libpolys/polys/monomials/ring.h

    r1f414c8 r6637ee  
    560560  return NULL;
    561561}
     562
     563/// return the specified parameter as a (new!) number in the given
     564/// polynomial ring, or NULL if invalid
     565number n_Param(const short iParameter, const ring r);
     566
    562567   
    563568/* R, Q, Fp: FALSE */
Note: See TracChangeset for help on using the changeset viewer.