Changeset e57dd7 in git for Singular/pcv.cc
- Timestamp:
- Nov 18, 1998, 2:00:12 PM (25 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- 8f9d571fb36c428311419e1af2ef2e68ba331ae0
- Parents:
- ce231a8f0acfcf9ed523fee24f2e3e3e5f4546fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/pcv.cc
rce231a re57dd7 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: pcv.cc,v 1. 3 1998-11-12 13:34:48 hannesExp $ */4 /* $Id: pcv.cc,v 1.4 1998-11-18 13:00:12 mschulze Exp $ */ 5 5 /* 6 6 * ABSTRACT: conversion between polys and coeff vectors … … 306 306 short* w=(short*)Alloc(currRing->N*sizeof(short)); 307 307 BOOLEAN defi1=FALSE,defw=FALSE; 308 while(hh !=NULL)308 while(hh) 309 309 { 310 310 if(hh->Typ()==INT_CMD) … … 366 366 * interface to interpreter 367 367 */ 368 BOOLEAN iiPcv Basis(leftv res, leftv h)369 { 370 if( currRingHdl==NULL)368 BOOLEAN iiPcvDim(leftv res, leftv h) 369 { 370 if(!currRingHdl) 371 371 { 372 372 WerrorS("no ring active"); … … 376 376 short* w=(short*)Alloc(currRing->N*sizeof(short)); 377 377 BOOLEAN defi1=FALSE,defw=FALSE; 378 while(h!=NULL) 378 while(h) 379 { 380 if(h->Typ()==INT_CMD) 381 { 382 if(defi1) 383 { 384 i0=i1; 385 i1=(int)h->Data(); 386 } 387 else 388 { 389 i1=(int)h->Data(); 390 defi1=TRUE; 391 } 392 } 393 else 394 if(h->Typ()==INTVEC_CMD) 395 { 396 intvec *iv=(intvec*)h->Data(); 397 if(iv->rows()==currRing->N&&iv->cols()==1) 398 { 399 int i; 400 for(i=0;i<currRing->N;i++) w[i]=(*iv)[i]; 401 defw=TRUE; 402 } 403 } 404 h=h->next; 405 } 406 if(!defw) 407 { 408 int i; 409 for(i=0;i<currRing->N;i++) w[i]=1; 410 } 411 if(defi1) 412 { 413 // "pcvDim"[,<int d0>],<int d1>[,<intvec w>]: 414 // number of monomials m with d0<=w-deg(m)<d1 415 res->rtyp=INT_CMD; 416 res->data=(void*)pcvDimW(i0,i1,w); 417 return FALSE; 418 } 419 Free((ADDRESS)w,(currRing->N)*sizeof(short)); 420 WerrorS("[<int>],<int>[,<intvec>] expected"); 421 return TRUE; 422 } 423 424 /*2 425 * interface to interpreter 426 */ 427 BOOLEAN iiPcvBasis(leftv res, leftv h) 428 { 429 if(!currRingHdl) 430 { 431 WerrorS("no ring active"); 432 return TRUE; 433 } 434 int i0=0,i1; 435 short* w=(short*)Alloc(currRing->N*sizeof(short)); 436 BOOLEAN defi1=FALSE,defw=FALSE; 437 while(h) 379 438 { 380 439 if(h->Typ()==INT_CMD)
Note: See TracChangeset
for help on using the changeset viewer.