Changeset b24fe3 in git


Ignore:
Timestamp:
Nov 28, 2014, 11:49:45 AM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'd1b01e9d51ade4b46b745d3bada5c5f3696be3a8')
Children:
ba19a8a94da4931a7c4fb8ea6bc91256251c15ec
Parents:
25e8609473c8b0c0bf29a493b620176e064e7790
Message:
chg: hasGFCoefficient
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/hnoether.lib

    r25e860 rb24fe3  
    279279  if (size(parstr(altring))==1) { mipl=string(minpoly); }
    280280 //---- test: char = (p^k,a) (-> gcd not implemented) or (p,a) (gcd works) ----
    281   if ((char(basering)!=0) and (charstr(basering)!=string(char(basering)))) {
    282     string tststr=charstr(basering);
    283     tststr=tststr[1..find(tststr,",")-1];           //-> "p^k" bzw. "p"
    284     gcd_ok=(tststr==string(char(basering)));
    285   }
     281  //if ((char(basering)!=0) and (charstr(basering)!=string(char(basering))))
     282  gcd_ok= ! hasGFCoefficient(basering);
    286283  execute("ring rsqrf = ("+charstr(altring)+"),(x,y),dp;");
    287284  if ((gcd_ok!=0) && (mipl!="0")) { execute("minpoly="+mipl+";"); }
     
    27402737
    27412738 //--------- Falls Ring (p^k,a),...: Wechsel in (p,a),... + minpoly -----------
    2742  if ( (find(charstr(basering),string(char(basering)))!=1) &&
    2743       (charstr(basering)<>"real")&&
    2744       (charstr(basering)<>"complex") ) {
     2739 if ( hasGFCoefficient(basering) )
     2740 {
    27452741   string strmip=string(minpoly);
    27462742   string strf=string(f);
     
    29072903   " Warning: all variables except the first two will be ignored!");
    29082904 }
    2909  if (find(charstr(basering),string(char(basering)))!=1) {
    2910    " ring of type (p^k,a) not implemented";
     2905 if (hasGFCoefficient(basering))
     2906 {
     2907   ERROR(" ring of type (p^k,a) not implemented");
    29112908 //----------------------------------------------------------------------------
    29122909 // weder primitives Element noch factorize noch map "char p^k" -> "char -p"
    29132910 // [(p^k,a)->(p,a) ground field] noch fetch
    29142911 //----------------------------------------------------------------------------
    2915    return(list());
    29162912 }
    29172913 //----------------- Definition eines neuen Ringes: HNEring -------------------
    29182914 string namex=varstr(1); string namey=varstr(2);
    2919  if (string(char(altring))==charstr(altring)) { // kein Parameter, nicht 'real'
     2915 if ((npars(altring)==0)&&(find(charstr(altring),"real")==0)) { // kein Parameter, nicht 'real'
    29202916   ring HNEring = char(altring),(x,y),ls;
    29212917   map m=altring,x,y;
  • Singular/LIB/ring.lib

    r25e860 rb24fe3  
    2525 optionIsSet(opt)         check if as a string given option is set or not.
    2626 hasFieldCoefficient      check if the coefficient ring is considered a field
     27 hasGFCoefficient         check if the coefficient ring is GF(p,k)
    2728 hasNumericCoeffs(rng)    check for use of floating point numbers
    2829 hasCommutativeVars(rng)  non-commutive or commnuative polynomial ring
     
    996997}
    997998
     999proc hasGFCoefficient(def rng )
     1000"USAGE: hasGFCoefficient ( rng );
     1001RETURN:  1 if the coeffcients form GF(p,k), 0 otherwise.
     1002KEYWORDS: ring coefficients
     1003EXAMPLE: example hasGFCoefficient; shows an example
     1004"
     1005{
     1006  return((charstr(rng)!=string(char(rng))) &&
     1007  (npars(rng)==1) &&
     1008  (find(charstr(rng),string(char(rng)))!=1) &&
     1009  (charstr(basering)<>"real")&&
     1010  (charstr(basering)<>"complex") );
     1011}
     1012example
     1013{
     1014  ring r1 = integer,x,dp;
     1015  hasGF(r1);
     1016  ring r2 = (4,a),x,dp;
     1017  hasGF(r2);
     1018}
     1019
    9981020proc hasGlobalOrdering (def rng)
    9991021"USAGE: hasGlobalOrdering ( rng );
Note: See TracChangeset for help on using the changeset viewer.