Changeset 738208 in git


Ignore:
Timestamp:
Dec 20, 2013, 2:07:40 PM (10 years ago)
Author:
Jakob Kröker <kroeker@…>
Branches:
(u'spielwiese', 'd1b01e9d51ade4b46b745d3bada5c5f3696be3a8')
Children:
3e032aa23883008eaeb717bed37aa560c44de867e33e5f31dc44bc1a57ac4a6531b88cfaa8486004
Parents:
4e4e24bd5220c690dc16529b1fb431b5ef67482c
git-author:
Jakob Kröker <kroeker@math.uni-hannover.de>2013-12-20 14:07:40+01:00
git-committer:
Jakob Kroeker <kroeker@uni-math.gwdg.de>2014-01-28 02:12:51+01:00
Message:
fix slocus bug 526(trac)
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ring.lib

    r4e4e24b r738208  
    849849  r;
    850850}
     851
     852
     853
     854
     855proc isQuotientRing( rng )
     856"USAGE: isQuotientRing ( rng );
     857RETURN:  1 if rng is a quotient ring, 0 otherwise.
     858PURPOSE: check if typeof a rng "qring"
     859KEYWORDS: qring ring ideal 'factor ring'
     860EXAMPLE: example isQuotientRing ; shows an example
     861"
     862{
     863    return ( size(ideal(rng)) != 0 );
     864}
     865example
     866{
     867  ring rng = 0,x,dp;
     868  isQuotientRing(rng); //no
     869  // if a certain method does not support quotient rings,
     870  // then a parameter test could be performed:
     871   ASSUME( 0, 0==isQuotientRing(basering));
     872
     873  qring q= ideal(x);  // constructs rng/ideal(x)
     874  isQuotientRing(q);  // yes
     875}
     876
     877static proc testIsQuotientRing()
     878{
     879   ring rng = real,x,dp;
     880   ASSUME(0, 0== isQuotientRing(rng) ) ;
     881
     882   qring qrng = 1;
     883   ASSUME(0, isQuotientRing(qrng) ) ;
     884
     885   ring rng2 = integer,x,dp;
     886   ASSUME(0, 0 == isQuotientRing(rng2) ) ;
     887
     888   qring qrng2=0;
     889   ASSUME(0, isQuotientRing(qrng2) ) ;
     890
     891   ring rng3 = 0,x,dp;
     892   ASSUME(0, 0 == isQuotientRing(rng3) ) ;
     893
     894   qring qrng3=1;
     895   ASSUME(0, isQuotientRing(qrng3) ) ;
     896}
     897
     898
     899
     900
     901
     902proc hasIntegerCoefficientRing( rng )
     903"USAGE: hasIntegerCoefficientRing ( rng );
     904RETURN:  1 if rng is has integer ring coefficients, 0 otherwise.
     905KEYWORDS: integer ring coefficients
     906EXAMPLE: example hasIntegerCoefficientRing ; shows an example
     907"
     908proc hasIntegerCoefficientRing(rng)
     909{
     910  def rl = ringlist(rng);
     911  if ( not (typeof(rl[1][1])=="string")    ) { return (0); }
     912  return ( rl[1][1]=="integer" );
     913}
     914example
     915{
     916  ring rng = integer,x,dp;
     917  hasIntegerCoefficientRing(rng); //yes
     918  // if a certain method supports only rings with integer coefficients,
     919  // then a parameter test could be performed:
     920   ASSUME( 0, hasIntegerCoefficientRing(basering)); //ok
     921
     922  ring rng2 = 0, x, dp;
     923  hasIntegerCoefficientRing(rng2);  // no
     924}
     925
     926
     927static proc testHasIntegerCoefficientRing()
     928{
     929   ring rng = integer,x,dp;
     930   ASSUME(0, hasIntegerCoefficientRing( rng ) );
     931
     932   qring q = ideal(x);
     933   ASSUME(0, hasIntegerCoefficientRing( q ) );
     934
     935   ring rng2 = 0,x,dp;
     936   ASSUME(0, 0==hasIntegerCoefficientRing( rng2 ) );
     937
     938   ring rng3 = (0,a),x,dp;
     939   ASSUME(0, 0==hasIntegerCoefficientRing( rng3 ) );
     940
     941   ring rng4 = (real,a),x,dp;
     942   ASSUME(0, 0==hasIntegerCoefficientRing( rng4 ) );
     943
     944   ring rng5 = (real),x,dp;
     945   ASSUME(0, 0==hasIntegerCoefficientRing( rng5 ) );
     946}
     947
     948
     949
     950
  • Singular/LIB/sing.lib

    r4e4e24b r738208  
    362362///////////////////////////////////////////////////////////////////////////////
    363363
    364 proc slocus (ideal i)
     364proc slocus(ideal i)
    365365"USAGE:   slocus(i);  i ideal
    366 RETURN:  ideal of singular locus of i
     366RETURN:  ideal of singular locus of i. Quotient rings and rings with integer coefficients are currently not supported.
    367367EXAMPLE: example slocus; shows an example
    368368"
    369369{
     370  // quotient rings currently not supported
     371  ASSUME( 0, 0==isQuotientRing(basering) );
     372  // integer coefficient rings currently not supported
     373  ASSUME( 0, 0==hasIntegerCoefficientRing(basering) );
     374
     375
    370376  def R=basering;
    371377  int j,k;
     
    415421{
    416422  ideal ist=std(i);
    417   if(deg(ist[1])==0){return(ist);}
    418   int cod  = nvars(basering)-dim(ist);
    419   i        = i+minor(jacob(i),cod);
     423  if ( size(ist)==0 ) // we have a zero ideal
     424  {
     425     // the zero locus of the zero ideal is nonsingular
     426     return( ideal(1) ) ;
     427  }
     428  if( deg( ist[1] ) == 0 ) // the ideal has a constant generator
     429  {
     430    return(ist);
     431  }
     432  int cod  = nvars(basering) - dim(ist);
     433  i        = i + minor( jacob(i), cod );
    420434  return(i);
    421435}
  • Tst/Short.lst

    r4e4e24b r738208  
    5151Short/bug_51.tst
    5252Short/bug_52.tst
     53Short/bug_526.tst
    5354Short/bug_53.tst
    5455Short/bug_54.tst
     
    229230Short/ringmodn.tst
    230231Short/ringsum.tst
     232Short/ringutils_s.tst
    231233Short/ringz.tst
    232234Short/rInit.tst
Note: See TracChangeset for help on using the changeset viewer.