Changeset 8e176b in git
- Timestamp:
- Apr 24, 2014, 10:48:27 AM (10 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 423ed4132d991ece24b8528843d5c19c0ef08e3d493e3de68a992f8a472eb2c2c57ca110ca7ef492
- Parents:
- 5b267b814940e31df029cf3b609a965ad80cebfc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ring.lib
r5b267b8 r8e176b 23 23 (parameters in square brackets [] are optional) 24 24 optionIsSet(opt) check if as a string given option is set or not. 25 hasRingCoefficientRing check if the coefficient ring is not a field 26 hasNumericCoeffs(rng) check for use of floating point numbers 27 hasCommutativeVars(rng) non-commutive or commnuative polynomial ring 28 hasGlobalOrdering(rng) global versus mixed/local monomial ordering 29 isSubModule(I,J) check if I is in J as submodule 25 30 "; 26 31 … … 47 52 } 48 53 example 49 { 54 { 50 55 // check if the option "warn" is set. 51 56 optionIsSet("warn"); … … 908 913 ring rng = 0,x,dp; 909 914 isQuotientRing(rng); //no 910 // if a certain method does not support quotient rings, 915 // if a certain method does not support quotient rings, 911 916 // then a parameter test could be performed: 912 917 ASSUME( 0, 0==isQuotientRing(basering)); 913 918 914 qring q= ideal(x); // constructs rng/ideal(x) 919 qring q= ideal(x); // constructs rng/ideal(x) 915 920 isQuotientRing(q); // yes 916 921 } … … 937 942 } 938 943 939 940 941 942 943 proc hasIntegerCoefficientRing( rng ) 944 "USAGE: hasIntegerCoefficientRing ( rng ); 945 RETURN: 1 if rng is has integer ring coefficients, 0 otherwise. 946 KEYWORDS: integer ring coefficients 947 EXAMPLE: example hasIntegerCoefficientRing ; shows an example 948 " 949 proc hasIntegerCoefficientRing(rng) 950 { 951 def rl = ringlist(rng); 952 if ( not (typeof(rl[1][1])=="string") ) { return (0); } 953 return ( rl[1][1]=="integer" ); 944 proc hasRingCoefficientRing( rng ) 945 "USAGE: hasRingCoefficientRing ( rng ); 946 RETURN: 1 if rng is has ring coefficients, 0 otherwise. 947 KEYWORDS: ring coefficients 948 EXAMPLE: example hasRingCoefficientRing; shows an example 949 " 950 { 951 return (attrib(rng,"ring_cf")==1); 954 952 } 955 953 example 956 954 { 957 955 ring rng = integer,x,dp; 958 has IntegerCoefficientRing(rng); //yes959 // if a certain method supports only rings with integer coefficients, 956 hasRingCoefficientRing(rng); //yes 957 // if a certain method supports only rings with integer coefficients, 960 958 // then a parameter test could be performed: 961 ASSUME( 0, hasIntegerCoefficientRing(basering)); //ok 962 963 ring rng2 = 0, x, dp; 964 hasIntegerCoefficientRing(rng2); // no 965 } 966 967 968 static proc testHasIntegerCoefficientRing() 969 { 970 ring rng = integer,x,dp; 971 ASSUME(0, hasIntegerCoefficientRing( rng ) ); 972 973 qring q = ideal(x); 974 ASSUME(0, hasIntegerCoefficientRing( q ) ); 975 976 ring rng2 = 0,x,dp; 977 ASSUME(0, 0==hasIntegerCoefficientRing( rng2 ) ); 978 979 ring rng3 = (0,a),x,dp; 980 ASSUME(0, 0==hasIntegerCoefficientRing( rng3 ) ); 981 982 ring rng4 = (real,a),x,dp; 983 ASSUME(0, 0==hasIntegerCoefficientRing( rng4 ) ); 984 985 ring rng5 = (real),x,dp; 986 ASSUME(0, 0==hasIntegerCoefficientRing( rng5 ) ); 987 } 988 989 990 991 959 ring rng2 = 0, x, dp; 960 hasRingCoefficientRing(rng2); // no 961 } 962 963 proc hasGlobalOrdering (rng) 964 "USAGE: hasGlobalOrdering ( rng ); 965 RETURN: 1 if rng has a global monomial ordering, 0 otherwise. 966 KEYWORDS: monomial ordering 967 EXAMPLE: example hasGlobalOrdering; shows an example 968 " 969 { 970 return (attrib(rng,"global")==1); 971 } 972 example 973 { 974 ring rng = integer,x,dp; 975 hasGlobalOrdering(rng); //yes 976 ring rng2 = 0, x, ds; 977 hasGlobalOrdering(rng2); // no 978 } 979 980 proc hasCommutativeVars (rng) 981 "USAGE: hasCommutativeVars ( rng ); 982 RETURN: 1 if rng is a commutative polynomial ring, 0 otherwise. 983 KEYWORDS: plural 984 EXAMPLE: example hasCommutativeVars; shows an example 985 " 986 { 987 list rl=ringlist(rng); 988 return (size(rl)==4); 989 } 990 991 proc hasNumericCoeffs(rng) 992 "USAGE: hasNumericCoeffs ( rng ); 993 RETURN: 1 if rng has inexact coeffcients, 0 otherwise. 994 KEYWORDS: floating point 995 EXAMPLE: example hasNumericCoeffs; shows an example 996 " 997 { 998 ERROR("not yet implemented"); 999 } 1000 1001 proc isSubModule(I,J) 1002 "USAGE: isSubModule(I,J): I, J: ideal or module 1003 RETURN: 1 if module(I) is in module(J), 0 otherwise 1004 EXAMPLE: isSubModule; shows an example 1005 { 1006 if (attrib(J,"isSB")==1) 1007 { return(size(reduce(I,J,1)==0)); } 1008 else 1009 { return(size(reduce(I,groebner(J),1)==0)); } 1010 } 1011 1012 -
Singular/LIB/sing.lib
r5b267b8 r8e176b 371 371 ASSUME( 0, 0==isQuotientRing(basering) ); 372 372 // integer coefficient rings currently not supported 373 ASSUME( 0, 0==has IntegerCoefficientRing(basering) );373 ASSUME( 0, 0==hasRingCoefficientRing(basering) ); 374 374 375 375 -
Tst/Short/ringutils_s.res.gz.uu
r5b267b8 r8e176b 1 begin 664 ringutils_s.res.gz 2 M'XL("/["YU(``W)I;F=U=&EL<U]S+G)E<P!MD#T+PC`0AO?^BJ,XI,M!U-:/ 3 M0@9UL"""5N>B$DN@I-)<<1#_NTV11,4EN8_WY;F[_+#*M@#`!6RR!81D""MU 4 M#M,@?W>&`KIBH;0B%J6!_4$(:)0N6U*5*0QJ>4=#)W*>D0`7C]'',5H*"ZVY 5 MQT2>DWQX)@BWIKX`24/[3GNT(!:Y_A3AX9(9=H]5S>=6GYE=6Y.2NG<R3^#\ 6 M6[@^F4R3+&6SK.7UJB[_/".$ITO&XG<B+XS]^#SQ*_-N%7L^>Y[6,!ZE,$B# 7 )%TG,>MEV`0`` 1 begin 640 ringutils_s.res.gz 2 M'XL(",D5'U,``W)I;F=U=&EL<U]S+G)E<P"-E5]OVC`4Q=_Y%%?1'@*B(;$= 3 M"$*)M'\/2&NE+MMSR8KI+"&GQ&;MQY]#B7T=MA2DB"B<>W['EQN[_/%E?0<` 4 M20'?UI\@T$I'>_$K6(W*\R^D`//P04BAP_%JU'Y#44`CY--1B[UZ4)'D+Y'2 5 ME;8UM`![SR)WGT8M)6AK>Y0YJEA$4#]K4<LP>*D:&8R=+"O@8UG^O/T:QM.S 6 M:*U*KCLE&.UL!I,)'!6'C9#Z#W_<@)!*\VH+]0XV6[[;6+]E85&R[L&2&,-B 7 MR//_$;L"T\39[&;@8Y4D.C40&G/ET/!J/WV=;I^=%?78!BW4_;'6@DO]W12& 8 MIM"@P14PU\#$M/EPLC^\^2=.-L>^/<_#A>D"F68N,C&>IK7\B3>]V,N+EEWF 9 M)AZ#Q(Y!$AR<Y+%3$6PL:_VO[#UC-(2$N?#4A(_]V"2](C;UW='`D@6.37/7 10 M;I*]T^Z>Z7)X@#H=C;WQ\?^*M_%ON)ES\ZZ>19.)K4UPI-^5:K-\KOEN)QYM 11 MM%,-'FU*W'(IM<MMX5LSO.$KDK)K``??/D7V<W_0XH%U$;RP1>^5&5@;\>D9 12 MHB_]23%>U7@@`44)6'Q]`NHE8(E+P-#>P-H$I]W!ANA4_0UB@,5\%MHI6.I8 13 I:<?JD^;7DU*?A+8/EKEC@)D>MT=*>V0<59B,5_!A-?H+JYB*6XH&```` 8 14 ` 9 15 end -
Tst/Short/ringutils_s.tst
r5b267b8 r8e176b 3 3 4 4 5 LIB ("ring.lib");5 LIB"ring.lib"; 6 6 7 proc testRingUtils() 8 { 9 Ring::testIsQuotientRing(); 10 Ring::testHasIntegerCoefficientRing(); 11 } 12 testRingUtils(); 7 option("warn"); 8 ASSUME(0, optionIsSet("warn") ); 9 option("nowarn"); 10 ASSUME(0, 0 == optionIsSet("warn") ); 11 //---------------------------- 12 ring rng = real,x,dp; 13 ASSUME(0, 0== isQuotientRing(rng) ) ; 14 15 qring qrng = 1; 16 ASSUME(0, isQuotientRing(qrng) ) ; 17 18 ring rng2 = integer,x,dp; 19 ASSUME(0, 0 == isQuotientRing(rng2) ) ; 20 21 qring qrng2=0; 22 ASSUME(0, not isQuotientRing(qrng2) ) ; 23 24 ring rng3 = 0,x,dp; 25 ASSUME(0, 0 == isQuotientRing(rng3) ) ; 26 27 qring qrng3=1; 28 ASSUME(0, isQuotientRing(qrng3) ) ; 29 //-------------------------- 30 ring rng = integer,x,dp; 31 ASSUME(0, hasRingCoefficientRing( rng ) ); 32 33 qring q = ideal(x); 34 ASSUME(0, hasRingCoefficientRing( q ) ); 35 36 ring rng2 = 0,x,dp; 37 ASSUME(0, 0==hasRingCoefficientRing( rng2 ) ); 38 39 ring rng3 = (0,a),x,dp; 40 ASSUME(0, 0==hasRingCoefficientRing( rng3 ) ); 41 42 ring rng4 = (real,a),x,dp; 43 ASSUME(0, 0==hasRingCoefficientRing( rng4 ) ); 44 45 ring rng5 = (real),x,dp; 46 ASSUME(0, 0==hasRingCoefficientRing( rng5 ) ); 13 47 14 48
Note: See TracChangeset
for help on using the changeset viewer.