Ignore:
Timestamp:
Aug 12, 2011, 5:29:12 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
45c9bd3cc75a93224a2ce248f62c450b05c2ec61
Parents:
94a065cc1eef470efefb950abf185f50c06ba20d
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-12 17:29:12+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:22:44+01:00
Message:
ADD: new function "int n_IsParam(number m, const ring r)" a-la onld p_Var
File:
1 edited

Legend:

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

    r94a065c re82417  
    5454
    5555#include "ext_fields/transext.h"
    56 
    57 
    58 
    59 
    6056
    6157
     
    11321128
    11331129
    1134 number ntParam(short iParameter, const coeffs cf)
     1130number ntParam(const short iParameter, const coeffs cf)
    11351131{
    11361132  assume(getCoeffType(cf) == ID);
     
    11381134  const ring R = cf->extRing;
    11391135  assume( R != NULL ); 
    1140   assume( 0 <= iParameter && iParameter < rVar(R) );
     1136  assume( 0 < iParameter && iParameter <= rVar(R) );
    11411137
    11421138  poly p = p_One(R); p_SetExp(p, iParameter, 1, R); p_Setm(p, R);
     
    11511147  return (number)f;
    11521148}
     1149
     1150
     1151/// if m == var(i)/1 => return i,
     1152int ntIsParam(number m, const coeffs cf)
     1153{
     1154  assume(getCoeffType(cf) == ID);
     1155
     1156  const ring R = cf->extRing;
     1157  assume( R != NULL );
     1158
     1159  fraction f = (fraction)m;
     1160
     1161  if( DEN(f) != NULL )
     1162    return 0;
     1163
     1164  return p_Var( NUM(f), R );
     1165}
Note: See TracChangeset for help on using the changeset viewer.