Changeset 740e1f7 in git
- Timestamp:
- Apr 1, 1999, 12:01:18 AM (24 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 6c87725945caa48b135d716568d9cf8b968ba527
- Parents:
- faeebb0f49e5d8530450d15bad2788dc567e342a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/pcv.cc
rfaeebb r740e1f7 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: pcv.cc,v 1.1 7 1999-03-19 11:09:42 Singular Exp $ */4 /* $Id: pcv.cc,v 1.18 1999-03-31 22:01:18 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: conversion between polys and coef vectors … … 8 8 9 9 #include "mod2.h" 10 #ifdef HAVE_PCV 11 #if !defined(HAVE_DYNAMIC_LOADING) || defined(BUILD_MODULE) 12 10 13 #include "tok.h" 11 14 #include "ipid.h" … … 22 25 static unsigned** pcvIndex=NULL; 23 26 27 #ifndef HAVE_DYNAMIC_LOADING 28 /* Without dynamic-loading we need to provides following functions */ 29 30 BOOLEAN pcvMinDeg(leftv res,leftv h) 31 { 32 if(h) 33 { 34 if(h->Typ()==POLY_CMD) 35 { 36 res->rtyp=INT_CMD; 37 res->data=(void*)pcvMinDeg((poly)h->Data()); 38 return FALSE; 39 } 40 } 41 WerrorS("<poly> expected"); 42 return TRUE; 43 } 44 45 BOOLEAN pcvMaxDeg(leftv res,leftv h) 46 { 47 if(h) 48 { 49 if(h->Typ()==POLY_CMD) 50 { 51 res->rtyp=INT_CMD; 52 res->data=(void*)pcvMaxDeg((poly)h->Data()); 53 return FALSE; 54 } 55 } 56 WerrorS("<poly> expected"); 57 return TRUE; 58 } 59 60 BOOLEAN pcvP2CV(leftv res,leftv h) 61 { 62 if(currRingHdl) 63 { 64 if(h&&h->Typ()==LIST_CMD) 65 { 66 lists pl=(lists)h->Data(); 67 h=h->next; 68 if(h&&h->Typ()==INT_CMD) 69 { 70 int d0=(int)h->Data(); 71 h=h->next; 72 if(h&&h->Typ()==INT_CMD) 73 { 74 int d1=(int)h->Data(); 75 res->rtyp=LIST_CMD; 76 res->data=pcvP2CV(pl,d0,d1); 77 return FALSE; 78 } 79 } 80 } 81 WerrorS("<list>,<int>,<int> expected"); 82 return TRUE; 83 } 84 WerrorS("no ring active"); 85 return TRUE; 86 } 87 88 BOOLEAN pcvCV2P(leftv res,leftv h) 89 { 90 if(currRingHdl) 91 { 92 if(h&&h->Typ()==LIST_CMD) 93 { 94 lists pl=(lists)h->Data(); 95 h=h->next; 96 if(h&&h->Typ()==INT_CMD) 97 { 98 int d0=(int)h->Data(); 99 h=h->next; 100 if(h&&h->Typ()==INT_CMD) 101 { 102 int d1=(int)h->Data(); 103 res->rtyp=LIST_CMD; 104 res->data=pcvCV2P(pl,d0,d1); 105 return FALSE; 106 } 107 } 108 } 109 WerrorS("<list>,<int>,<int> expected"); 110 return TRUE; 111 } 112 WerrorS("no ring active"); 113 return TRUE; 114 } 115 116 BOOLEAN pcvDim(leftv res,leftv h) 117 { 118 if(currRingHdl) 119 { 120 if(h&&h->Typ()==INT_CMD) 121 { 122 int d0=(int)h->Data(); 123 h=h->next; 124 if(h&&h->Typ()==INT_CMD) 125 { 126 int d1=(int)h->Data(); 127 res->rtyp=INT_CMD; 128 res->data=(void*)pcvDim(d0,d1); 129 return FALSE; 130 } 131 } 132 WerrorS("<int>,<int> expected"); 133 return TRUE; 134 } 135 WerrorS("no ring active"); 136 return TRUE; 137 } 138 139 BOOLEAN pcvBasis(leftv res,leftv h) 140 { 141 if(currRingHdl) 142 { 143 if(h&&h->Typ()==INT_CMD) 144 { 145 int d0=(int)h->Data(); 146 h=h->next; 147 if(h&&h->Typ()==INT_CMD) 148 { 149 int d1=(int)h->Data(); 150 res->rtyp=LIST_CMD; 151 res->data=pcvBasis(d0,d1); 152 return FALSE; 153 } 154 } 155 WerrorS("<int>,<int> expected"); 156 return TRUE; 157 } 158 WerrorS("no ring active"); 159 return TRUE; 160 } 161 162 #endif /* HAVE_DYNAMIC_LOADING */ 163 24 164 int pcvDeg(poly p) 25 165 { … … 55 195 } 56 196 return md; 57 }58 59 BOOLEAN pcvMinDeg(leftv res,leftv h)60 {61 if(h)62 {63 if(h->Typ()==POLY_CMD)64 {65 res->rtyp=INT_CMD;66 res->data=(void*)pcvMinDeg((poly)h->Data());67 return FALSE;68 }69 }70 WerrorS("<poly> expected");71 return TRUE;72 }73 74 BOOLEAN pcvMaxDeg(leftv res,leftv h)75 {76 if(h)77 {78 if(h->Typ()==POLY_CMD)79 {80 res->rtyp=INT_CMD;81 res->data=(void*)pcvMaxDeg((poly)h->Data());82 return FALSE;83 }84 }85 WerrorS("<poly> expected");86 return TRUE;87 197 } 88 198 … … 234 344 } 235 345 236 BOOLEAN pcvP2CV(leftv res,leftv h)237 {238 if(currRingHdl)239 {240 if(h&&h->Typ()==LIST_CMD)241 {242 lists pl=(lists)h->Data();243 h=h->next;244 if(h&&h->Typ()==INT_CMD)245 {246 int d0=(int)h->Data();247 h=h->next;248 if(h&&h->Typ()==INT_CMD)249 {250 int d1=(int)h->Data();251 res->rtyp=LIST_CMD;252 res->data=pcvP2CV(pl,d0,d1);253 return FALSE;254 }255 }256 }257 WerrorS("<list>,<int>,<int> expected");258 return TRUE;259 }260 WerrorS("no ring active");261 return TRUE;262 }263 264 BOOLEAN pcvCV2P(leftv res,leftv h)265 {266 if(currRingHdl)267 {268 if(h&&h->Typ()==LIST_CMD)269 {270 lists pl=(lists)h->Data();271 h=h->next;272 if(h&&h->Typ()==INT_CMD)273 {274 int d0=(int)h->Data();275 h=h->next;276 if(h&&h->Typ()==INT_CMD)277 {278 int d1=(int)h->Data();279 res->rtyp=LIST_CMD;280 res->data=pcvCV2P(pl,d0,d1);281 return FALSE;282 }283 }284 }285 WerrorS("<list>,<int>,<int> expected");286 return TRUE;287 }288 WerrorS("no ring active");289 return TRUE;290 }291 292 346 int pcvDim(int d0,int d1) 293 347 { … … 298 352 pcvClean(); 299 353 return d; 300 }301 302 BOOLEAN pcvDim(leftv res,leftv h)303 {304 if(currRingHdl)305 {306 if(h&&h->Typ()==INT_CMD)307 {308 int d0=(int)h->Data();309 h=h->next;310 if(h&&h->Typ()==INT_CMD)311 {312 int d1=(int)h->Data();313 res->rtyp=INT_CMD;314 res->data=(void*)pcvDim(d0,d1);315 return FALSE;316 }317 }318 WerrorS("<int>,<int> expected");319 return TRUE;320 }321 WerrorS("no ring active");322 return TRUE;323 354 } 324 355 … … 356 387 } 357 388 358 BOOLEAN pcvBasis(leftv res,leftv h) 359 { 360 if(currRingHdl) 361 { 362 if(h&&h->Typ()==INT_CMD) 363 { 364 int d0=(int)h->Data(); 365 h=h->next; 366 if(h&&h->Typ()==INT_CMD) 367 { 368 int d1=(int)h->Data(); 369 res->rtyp=LIST_CMD; 370 res->data=pcvBasis(d0,d1); 371 return FALSE; 372 } 373 } 374 WerrorS("<int>,<int> expected"); 375 return TRUE; 376 } 377 WerrorS("no ring active"); 378 return TRUE; 379 } 389 #endif /* !defined(HAVE_DYNAMIC_LOADING) || defined(BUILD_MODULE) */ 390 #endif /* HAVE_PCV */
Note: See TracChangeset
for help on using the changeset viewer.