Changeset 31c731 in git
- Timestamp:
- Sep 27, 2011, 12:05:01 PM (12 years ago)
- Branches:
- (u'spielwiese', 'd1ba061a762c62d3a25159d8da8b6e17332291fa')
- Children:
- 1577ebd5335ce968d500335fe1900d966692ef82
- Parents:
- e9039a74ae2d173584dadd1c33af0b75e429a59b
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-09-27 12:05:01+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:36+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/ext_fields/transext.cc
re9039a7 r31c731 270 270 definiteGcdCancellation(a, cf, FALSE); 271 271 fraction f = (fraction)a; 272 return DENIS1(f) && NUMIS1(f);272 return (f!=NULL) && DENIS1(f) && NUMIS1(f); 273 273 } 274 274 … … 278 278 definiteGcdCancellation(a, cf, FALSE); 279 279 fraction f = (fraction)a; 280 if ( !DENIS1(f)) return FALSE;280 if ((f==NULL) || (!DENIS1(f))) return FALSE; 281 281 poly g = NUM(f); 282 282 if (!p_IsConstant(g, ntRing)) return FALSE; … … 983 983 } 984 984 985 number ntCopyAlg(number a, const coeffs src, const coeffs dst) 986 { 987 if (n_IsZero(a, src)) return NULL; 988 fraction f = (fraction)omAlloc0Bin(fractionObjectBin); 989 NUM(f) = p_Copy((poly)a,src->extRing);// DEN(f) = NULL; COM(f) = 0; 990 return (number)f; 991 } 992 985 993 /* assumes that src = Q, dst = Z/p(t_1, ..., t_s) */ 986 994 number ntMap0P(number a, const coeffs src, const coeffs dst) … … 999 1007 p_SetCoeff(g, q, dst->extRing); 1000 1008 fraction f = (fraction)omAlloc0Bin(fractionObjectBin); 1001 NUM(f) = g; DEN(f) = NULL; COM(f) = 0;1009 NUM(f) = g; // DEN(f) = NULL; COM(f) = 0; 1002 1010 return (number)f; 1003 1011 } … … 1045 1053 /* for the time being, we only provide maps if h = 1 and if b is Q or 1046 1054 some field Z/pZ: */ 1055 if (h==0) 1056 { 1057 if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst)) 1058 return ntMap00; /// Q --> Q(T) 1059 if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst)) 1060 return ntMapP0; /// Z/p --> Q(T) 1061 if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst)) 1062 return ntMap0P; /// Q --> Z/p(T) 1063 if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst)) 1064 { 1065 if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T) 1066 else return ntMapUP; /// Z/u --> Z/p(T) 1067 } 1068 } 1047 1069 if (h != 1) return NULL; 1048 1070 if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL; … … 1053 1075 of the form t_1, ..., t_w with w <= s. */ 1054 1076 1055 if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst))1056 return ntMap00; /// Q --> Q(T)1057 1058 if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))1059 return ntMapP0; /// Z/p --> Q(T)1060 1061 if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))1062 return ntMap0P; /// Q --> Z/p(T)1063 1064 if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))1065 {1066 if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)1067 else return ntMapUP; /// Z/u --> Z/p(T)1068 }1069 1070 1077 coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */ 1071 1078 if (h != 1) return NULL; … … 1078 1085 if (strcmp(rRingVar(i, src->extRing), 1079 1086 rRingVar(i, dst->extRing)) != 0) return NULL; 1080 return ntCopyMap; /// Q(T') --> Q(T) 1087 if (src->type==n_transExt) 1088 return ntCopyMap; /// Q(T') --> Q(T) 1089 else 1090 return ntCopyAlg; 1081 1091 } 1082 1092 … … 1087 1097 if (strcmp(rRingVar(i, src->extRing), 1088 1098 rRingVar(i, dst->extRing)) != 0) return NULL; 1089 return ntCopyMap; /// Z/p(T') --> Z/p(T) 1099 if (src->type==n_transExt) 1100 return ntCopyMap; /// Z/p(T') --> Z/p(T) 1101 else 1102 return ntCopyAlg; 1090 1103 } 1091 1104 … … 1093 1106 } 1094 1107 1095 void ntKillChar(coeffs cf) { 1108 void ntKillChar(coeffs cf) 1109 { 1096 1110 if ((--cf->extRing->ref) == 0) 1097 1111 rDelete(cf->extRing);
Note: See TracChangeset
for help on using the changeset viewer.