Changeset e10683 in git for Singular/polys.cc
- Timestamp:
- Nov 30, 2000, 5:46:09 PM (23 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 379305282702a4d34d62437d3dfe5bf09925c710
- Parents:
- 50268a871f223956bed4c2b84352e38f543a574b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/polys.cc
r50268a re10683 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1.6 8 2000-11-09 16:32:53 obachmanExp $ */4 /* $Id: polys.cc,v 1.69 2000-11-30 16:46:09 Singular Exp $ */ 5 5 6 6 /* … … 55 55 pLDeg=r->pLDeg; 56 56 pLexOrder=r->LexOrder; 57 57 58 58 if (complete) 59 59 { … … 140 140 * convert monomial given as string to poly, e.g. 1x3y5z 141 141 */ 142 poly pmInit(char *st, BOOLEAN &ok)142 char * p_Read(char *st, poly &rc, ring r) 143 143 { 144 144 int i,j; 145 ok=FALSE; 146 BOOLEAN b=FALSE; 147 poly rc = pInit(); 148 char *s = nRead(st,&(rc->coef)); 145 rc = p_Init(r); 146 char *s = r->cf->nRead(st,&(rc->coef)); 149 147 if (s==st) 150 148 /* i.e. it does not start with a coeff: test if it is a ringvar*/ … … 154 152 { 155 153 pIncrExp(rc,1+j); 154 while (*s!='\0') s++; 156 155 goto done; 157 156 } 158 157 } 159 else160 b=TRUE;161 158 while (*s!='\0') 162 159 { … … 164 161 ss[0] = *s++; 165 162 ss[1] = '\0'; 166 j = r IsRingVar(ss);163 j = r_IsRingVar(ss,r); 167 164 if (j >= 0) 168 165 { 169 166 s = eati(s,&i); 170 p AddExp(rc,1+j, (Exponent_t)i);167 p_AddExp(rc,1+j, (Exponent_t)i, r); 171 168 } 172 169 else 173 170 { 174 if ((s!=st)&&isdigit(st[0])) 175 { 176 errorreported=TRUE; 177 } 178 pDelete(&rc); 179 return NULL; 171 s--; 172 return s; 180 173 } 181 174 } 182 175 done: 176 if (r->cf->nIsZero(pGetCoeff(rc))) p_DeleteLm(&rc,r); 177 else 178 { 179 p_Setm(rc,r); 180 } 181 return s; 182 } 183 184 poly pmInit(char *st, BOOLEAN &ok) 185 { 186 poly p; 187 char *s=p_Read(st,p,currRing); 188 if (*s!='\0') 189 { 190 if ((s!=st)&&isdigit(st[0])) 191 { 192 errorreported=TRUE; 193 } 194 ok=FALSE; 195 pDelete(&p); 196 return NULL; 197 } 183 198 ok=!errorreported; 184 if (nIsZero(pGetCoeff(rc))) pDeleteLm(&rc); 185 else 186 { 187 pSetm(rc); 188 } 189 return rc; 199 return p; 190 200 } 191 201 … … 229 239 return q; 230 240 } 231 232 241 233 242 /*2
Note: See TracChangeset
for help on using the changeset viewer.