Changeset 3373e32 in git
- Timestamp:
- Aug 12, 2011, 8:14:45 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 3da9f4eecf506fa238a5377a07d73051db6ceb9b
- Parents:
- 8c6ae50ebf0a50c5c19b2b5b0dad7b35be193f9b
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-08-12 20:14:45+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:30:46+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipshell.cc
r8c6ae50 r3373e32 2098 2098 2099 2099 if ( 2100 2100 ((ch!=0) && (ch<2) && (is_gf_char=-1)) // TODO for Hans!: negative characteristic? 2101 2101 #ifndef NV_OPS 2102 2102 || (ch > 32003) … … 2127 2127 { 2128 2128 ch = (int)(long)LL->m[0].Data(); 2129 2130 2129 2130 // TODO: check that ch is a supported (by our GF impl.) power of a prime 2131 2131 while ((ch != fftable[is_gf_char]) && (fftable[is_gf_char])) is_gf_char++; 2132 2132 2133 2133 if (fftable[is_gf_char]==0) is_gf_char=-1; 2134 2134 } … … 2137 2137 { 2138 2138 ring extRing = rCompose((lists)L->m[0].Data()); 2139 2139 2140 2140 if (extRing==NULL) 2141 2141 { … … 2147 2147 else 2148 2148 ch = 1; // WTF? 2149 2149 2150 2150 // extRing->names = (char**)omAlloc0(rPar(R)*sizeof(char_ptr)); // obsolete? 2151 2151 2152 2152 int i; 2153 2153 2154 2154 // for( i = rPar(R) - 1; i >= 0; i--) extRing->names[i] = omStrDup(extRing->names[i]); 2155 /* 2155 /* 2156 2156 // Obsolete? 2157 2157 if (extRing->qideal!=NULL) … … 2165 2165 R->cf->extRing->qideal->m[0]=NULL; 2166 2166 idDelete(&(R->cf->extRing->qideal)); 2167 2167 2168 2168 redefineFunctionPointers(); 2169 2169 } … … 2308 2308 if (R->block1[j]>R->N) 2309 2309 { 2310 2311 2310 R->block1[j]=R->N; 2311 iv_len=R->block1[j]-R->block0[j]+1; 2312 2312 } 2313 2313 //Print("block %d from %d to %d\n",j,R->block0[j], R->block1[j]); … … 2333 2333 R->block1[j]=si_max(R->block0[j],R->block0[j]+(int)sqrt((double)(iv->length()-1))); 2334 2334 if (R->block1[j]>R->N) 2335 2336 2337 2338 2335 { 2336 WerrorS("ordering matrix too big"); 2337 goto rCompose_err; 2338 } 2339 2339 break; 2340 2340 case ringorder_ls: … … 2821 2821 { 2822 2822 res->data=singclap_resultant((poly)u->CopyD(),(poly)v->CopyD(), 2823 2823 (poly)w->CopyD(), currRing); 2824 2824 return errorreported; 2825 2825 } … … 3276 3276 ( fast==1 ? computeWC( nph,(Rational)rVar(currRing), currRing ) : 3277 3277 /* fast==2 */computeWC( nph, 3278 3278 ((Rational)rVar(currRing))/(Rational)2, currRing ) ) ); 3279 3279 3280 3280 #ifdef SPECTRUM_DEBUG … … 4176 4176 4177 4177 if ( !(rField_is_R(currRing) || rField_is_long_R(currRing) || \ 4178 4178 rField_is_long_C(currRing)) ) 4179 4179 { 4180 4180 unsigned long int ii = (unsigned long int)arg2->Data(); … … 4189 4189 4190 4190 int ldummy; 4191 int deg= pLDeg( gls, &ldummy, currRing );4191 int deg= currRing->pLDeg( gls, &ldummy, currRing ); 4192 4192 // int deg= pDeg( gls ); 4193 4193 int len= pLength( gls ); … … 4437 4437 return TRUE; 4438 4438 else if ( !(rField_is_R(currRing) || rField_is_long_R(currRing) || \ 4439 4439 rField_is_long_C(currRing)) ) 4440 4440 { 4441 4441 unsigned long int ii=(unsigned long int)v->Data(); … … 4573 4573 onepoint->m[j].rtyp=STRING_CMD; 4574 4574 onepoint->m[j].data=(void *)complexToStr((*roots[j])[i],oprec, 4575 4575 currRing->cf); 4576 4576 } 4577 4577 else … … 4949 4949 // get ch of ground field 4950 4950 int numberOfAllocatedBlocks; 4951 4952 coeffs cf=NULL; 4951 4953 4952 4954 if (pn->Typ()==INT_CMD) 4953 4955 { 4954 4956 ch=(int)(long)pn->Data(); 4957 if (pn->next==NULL) 4958 cf=nInitChar(ch==0 ? n_Q : n_Zp, (void*)(long)ch); 4959 else 4960 { 4961 if ((ch!=0) && (ch!=IsPrime(ch))) 4962 { 4963 cf=nInitChar(n_GF,(void*)(long)ch); 4964 if (cf==NULL) goto rInitError; 4965 else ffChar=TRUE; 4966 } 4967 /* parameter -------------------------------------------------------*/ 4968 pn=pn->next; 4969 if (cf==NULL) cf=nInitChar(n_transExt,NULL); 4970 R->cf=cf; 4971 if (pn!=NULL) 4972 { 4973 int pars=pn->listLength(); 4974 if (!ffChar) R->cf->extRing->N=pars; 4975 if ((pars > 1) && (ffChar)) 4976 { 4977 WerrorS("too many parameters"); 4978 goto rInitError; 4979 } 4980 if (!ffChar) R->cf->extRing->names=(char**)omAlloc0(rPar(R)*sizeof(char_ptr)); 4981 if (rSleftvList2StringArray(pn, R->cf->extRing->names)) 4982 { 4983 WerrorS("parameter expected"); 4984 goto rInitError; 4985 } 4986 } 4987 } 4955 4988 } 4956 4989 else if ((pn->name != NULL) … … 4958 4991 { 4959 4992 BOOLEAN complex_flag=(strcmp(pn->name,"complex")==0); 4960 ch= -1;4993 ch=0; 4961 4994 if ((pn->next!=NULL) && (pn->next->Typ()==INT_CMD)) 4962 4995 { 4996 WarnS("not implemented: size for real/complex"); 4963 4997 float_len=(int)(long)pn->next->Data(); 4964 4998 float_len2=float_len; … … 4967 5001 { 4968 5002 float_len2=(int)(long)pn->next->Data(); 5003 WarnS("not implemented: size for real/complex"); 4969 5004 pn=pn->next; 4970 5005 } … … 4975 5010 pn->next->name=omStrDup("i"); 4976 5011 } 5012 else 5013 WarnS("not implemented: name for i (complex)"); 5014 cf=nInitChar(complex_flag ? n_long_C: n_long_R,NULL); 4977 5015 } 4978 5016 #ifdef HAVE_RINGS … … 4996 5034 } 4997 5035 } 5036 else 5037 cf=nInitChar(n_Z,NULL); 4998 5038 if ((mpz_cmp_ui(modBase, 1) == 0) && (mpz_cmp_ui(modBase, 0) < 0)) 4999 5039 { … … 5006 5046 goto rInitError; 5007 5047 } 5008 // module is 0 ---> integers 5009 if (mpz_cmp_ui(modBase, 0) == 0) 5010 { 5011 ch = 0; 5012 ringtype = 4; 5013 } 5048 // module is 0 ---> integers ringtype = 4; 5014 5049 // we have an exponent 5015 elseif (modExponent > 1)5050 if (modExponent > 1) 5016 5051 { 5017 5052 ch = modExponent; … … 5021 5056 depending on the size of a long on the respective platform */ 5022 5057 ringtype = 1; // Use Z/2^ch 5058 cf=nInitChar(n_Z2m,(void*)(long)modExponent); 5023 5059 } 5024 5060 else 5025 5061 { 5026 5062 ringtype = 3; 5063 cf=nInitChar(n_Zn,(void*)(long)modBase); 5027 5064 } 5028 5065 } … … 5032 5069 ringtype = 2; 5033 5070 ch = mpz_get_ui(modBase); 5071 cf=nInitChar(n_Zn,(void*)(long)modBase); 5034 5072 } 5035 5073 } … … 5056 5094 * q q : GF(q=p^n) *names TRUE 5057 5095 */ 5058 if ((ch!=-1) 5059 #ifdef HAVE_RINGS 5060 && (ringtype == 0) 5061 #endif 5062 ) 5063 { 5064 int l = 0; 5065 5066 if (((ch!=0) && (ch<2)) 5067 #ifndef NV_OPS 5068 || (ch > 32003) 5069 #endif 5070 ) 5071 { 5072 Warn("%d is invalid characteristic of ground field. 32003 is used.", ch); 5073 ch=32003; 5074 } 5075 // load fftable, if necessary 5076 if (pn!=NULL) 5077 { 5078 while ((ch!=fftable[l]) && (fftable[l])) l++; 5079 if (fftable[l]==0) ch = IsPrime(ch); 5080 else 5081 { 5082 char *m[1]={(char *)sNoName}; 5083 nfSetChar(ch,m); 5084 if (errorreported) goto rInitError; 5085 else ffChar=TRUE; 5086 } 5087 } 5088 else 5089 { 5090 ch = IsPrime(ch); 5091 } 5096 l = 0; 5097 5098 if (cf==NULL) 5099 { 5100 Warn("%d is invalid characteristic of ground field. 32003 is used.", ch); 5101 ch=32003; 5102 cf=nInitChar(n_Zp, (void*)(long)ch); 5092 5103 } 5093 5104 // allocated ring and set ch 5094 5105 R = (ring) omAlloc0Bin(sip_sring_bin); 5095 R->cf ->ch = ch;5106 R->cf=cf; 5096 5107 #ifdef HAVE_RINGS 5097 5108 R->cf->ringtype = ringtype; … … 5099 5110 R->cf->modExponent = modExponent; 5100 5111 #endif 5101 if (ch == -1)5102 {5103 R->float_len= si_min(float_len,32767);5104 R->float_len2= si_min(float_len2,32767);5105 }5106 5107 /* parameter -------------------------------------------------------*/5108 if (pn!=NULL)5109 {5110 R->cf->extRing->N=pn->listLength();5111 //if ((ffChar|| (ch == 1)) && (rPar(R) > 1))5112 if ((rPar(R) > 1) && (ffChar || (ch == -1)))5113 {5114 WerrorS("too many parameters");5115 goto rInitError;5116 }5117 R->cf->extRing->names=(char**)omAlloc0(rPar(R)*sizeof(char_ptr));5118 if (rSleftvList2StringArray(pn, R->cf->extRing->names))5119 {5120 WerrorS("parameter expected");5121 goto rInitError;5122 }5123 if (ch>1 && !ffChar) R->cf->ch=-ch;5124 else if (ch==0) R->cf->ch=1;5125 }5126 else if (ffChar)5127 {5128 WerrorS("need one parameter");5129 goto rInitError;5130 }5131 /* post-processing of field description */5132 // we have short reals, but no short complex5133 if ((R->cf->ch == - 1)5134 && (rParameter(R) !=NULL)5135 && (R->float_len < SHORT_REAL_LENGTH))5136 {5137 R->float_len = SHORT_REAL_LENGTH;5138 R->float_len2 = SHORT_REAL_LENGTH;5139 }5140 5112 5141 5113 /* names and number of variables-------------------------------------*/
Note: See TracChangeset
for help on using the changeset viewer.