Changeset e7e815 in git
- Timestamp:
- Aug 12, 2011, 8:35:56 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- f5bef2f630405aa4f809d8c3e3d981f72f87a74d
- Parents:
- 2b7f4e1c2533023f1826c2b3ff11a6470249af65
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-12 20:35:56+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:12:16+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipshell.cc
r2b7f4e re7e815 61 61 62 62 #include <math.h> 63 64 #include <polys/ext_fields/algext.h> 65 #include <polys/ext_fields/transext.h> 63 66 64 67 // define this if you want to use the fast_map routine for mapping ideals … … 2078 2081 // 4: C 2079 2082 // 5: D 2080 ring R = (ring) omAlloc0Bin(sip_sring_bin); 2083 2084 ring R = (ring) omAlloc0Bin(sip_sring_bin); // why 2081 2085 2082 2086 2083 assume( R->cf == NULL ); 2084 int ch; 2085 int is_gf_char = 0; 2086 2087 assume( R->cf == NULL ); 2088 2087 2089 // ------------------------------------------------------------------ 2088 2090 // 0: char: 2089 2091 if (L->m[0].Typ()==INT_CMD) 2090 2092 { 2091 ch = (int)(long)L->m[0].Data();2093 int ch = (int)(long)L->m[0].Data(); 2092 2094 assume( ch >= 0 ); 2093 2094 2095 if (ch != -1) // WTF? 2096 { 2097 int l=0; 2098 2099 if ( 2100 ((ch!=0) && (ch<2) && (is_gf_char=-1)) // TODO for Hans!: negative characteristic? 2101 #ifndef NV_OPS 2102 || (ch > 32003) 2103 #endif 2104 || ((l=IsPrime(ch))!=ch) 2105 ) 2106 { 2107 Warn("%d is invalid characteristic of ground field. %d is used.", ch,l); 2095 2096 if (ch == 0) // Q? 2097 R->cf = nInitChar(n_Q, NULL); 2098 else 2099 { 2100 int l = IsPrime(ch); // Zp? 2101 if( l != ch ) 2102 { 2103 Warn("%d is invalid characteristic of ground field. %d is used.", ch, l); 2108 2104 ch = l; 2109 } 2110 } 2111 } 2112 else if (L->m[0].Typ()==LIST_CMD) 2105 } 2106 R->cf = nInitChar(n_Zp, (void*)ch); 2107 } 2108 } 2109 else if (L->m[0].Typ()==LIST_CMD) // something complicated... 2113 2110 { 2114 2111 lists LL=(lists)L->m[0].Data(); 2112 2115 2113 #ifdef HAVE_RINGS 2116 if (LL->m[0].Typ() == STRING_CMD) 2117 { 2118 rComposeRing(LL, R); /* Ring */2114 if (LL->m[0].Typ() == STRING_CMD) // 1st comes a string? 2115 { 2116 rComposeRing(LL, R); // Ring!? 2119 2117 } 2120 2118 else 2121 2119 #endif 2122 if (LL->nr <3)2123 rComposeC(LL,R); / * R, long_R, long_C */2120 if (LL->nr < 3) 2121 rComposeC(LL,R); // R, long_R, long_C 2124 2122 else 2125 { 2123 { 2126 2124 if (LL->m[0].Typ()==INT_CMD) 2127 { 2125 { 2128 2126 ch = (int)(long)LL->m[0].Data(); 2129 2130 // TODO: check that ch is a supported (by our GF impl.) power of a prime 2131 while ((ch != fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++; 2132 2133 if (fftable[is_gf_char]==0) is_gf_char=-1; 2134 } 2135 2136 if (is_gf_char==-1) 2127 2128 if( ch != 0 ) // TODO: GF-Test ch! 2129 { 2130 GFInfo param; 2131 2132 param.GFChar = ch; 2133 param.GFDegree = 1; 2134 param.GFPar_name = (const char*)(((lists)(LL->m[1].Data()))->m[0].Data()); 2135 2136 // nfInitChar should be able to handle the case when ch is in fftables! 2137 R->cf = nInitChar(n_GF, (void*)¶m); 2138 } 2139 } 2140 2141 if( R->cf == NULL ) 2137 2142 { 2138 2143 ring extRing = rCompose((lists)L->m[0].Data()); … … 2140 2145 if (extRing==NULL) 2141 2146 { 2142 WerrorS("could not create rational functioncoefficient field");2147 WerrorS("could not create the specified coefficient field"); 2143 2148 goto rCompose_err; 2144 2149 } 2145 if (extRing->cf->ch > 0) 2146 ch = - extRing->cf->ch; // TODO: this is obsolete! 2147 else 2148 ch = 1; // WTF? 2149 2150 // extRing->names = (char**)omAlloc0(rPar(R)*sizeof(char_ptr)); // obsolete? 2151 2152 int i; 2153 2154 // for( i = rPar(R) - 1; i >= 0; i--) extRing->names[i] = omStrDup(extRing->names[i]); 2155 /* 2156 // Obsolete? 2157 if (extRing->qideal!=NULL) 2150 2151 if( extRing->qideal != NULL ) // Algebraic extension 2158 2152 { 2159 if (IDELEMS(extRing->qideal) == 1) 2160 { 2161 extRing->qideal->m[0] = naInit(1,R); 2162 lnumber n=(lnumber)R->minpoly; 2163 n->z = extRing->qideal->m[0]; 2164 // naMinimalPoly = n->z; 2165 R->cf->extRing->qideal->m[0]=NULL; 2166 idDelete(&(R->cf->extRing->qideal)); 2167 2168 redefineFunctionPointers(); 2169 } 2170 else 2171 { 2172 WerrorS("not implemented yet."); 2173 } 2153 AlgExtInfo extParam; 2154 2155 extParam.i = extRing->qideal; 2156 extParam.r = extRing; 2157 2158 extRing->qideal = NULL; // ??? 2159 2160 R->cf = nInitChar(type, (void*)&extParam); 2161 } else // Transcendental extension 2162 { 2163 TransExtInfo extParam; 2164 extParam.r = r; 2165 2166 R->cf = nInitChar(n_transExt, &extParam); 2174 2167 } 2175 */ 2176 } 2177 else 2178 { // gf-char 2179 // ch = fftable[is_gf_char]; 2180 extRing->N=1; 2181 extRing->names=(char**)omAlloc0(1*sizeof(char_ptr)); 2182 extRing->names[0]=omStrDup((char*)((lists)(LL->m[1].Data()))->m[0].Data()); 2183 } 2168 2169 } 2184 2170 } 2185 2171 } … … 2189 2175 goto rCompose_err; 2190 2176 } 2191 rRenameVars(R); 2192 rComplete(R); 2193 2194 #ifdef HAVE_RINGS 2195 // This was a BUG IN SINGULAR: There is no HABE_RINGS!!! 2196 2197 // currently, coefficients which are ring elements require a global ordering: 2198 if (rField_is_Ring(R) && (R->pOrdSgn==-1)) 2199 { 2200 WerrorS("global ordering required for these coefficients"); 2177 2178 if( R->cf == NULL ) 2179 { 2180 WerrorS("could not create coefficient field described by the input!"); 2201 2181 goto rCompose_err; 2202 2182 } 2203 #endif 2204 2205 2206 2207 2208 2209 2210 2211 2212 2183 2213 2184 // ------------------------- VARS --------------------------- 2214 2185 if (L->m[1].Typ()==LIST_CMD) … … 2407 2378 goto rCompose_err; 2408 2379 } 2380 2381 // ------------------------ ??????? -------------------- 2382 2383 rRenameVars(R); 2384 rComplete(R); 2385 2386 #ifdef HAVE_RINGS 2387 // This was a BUG IN SINGULAR: There is no HABE_RINGS!!! 2388 2389 // currently, coefficients which are ring elements require a global ordering: 2390 if (rField_is_Ring(R) && (R->pOrdSgn==-1)) 2391 { 2392 WerrorS("global ordering required for these coefficients"); 2393 goto rCompose_err; 2394 } 2395 #endif 2396 2397 2409 2398 // ------------------------ Q-IDEAL ------------------------ 2410 2399
Note: See TracChangeset
for help on using the changeset viewer.