Changeset cd5fefc in git
- Timestamp:
- Jul 3, 2012, 6:58:10 PM (12 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 20409220dfe91ce9647c6b8d12e43f086961aa14
- Parents:
- ff7993e279b46dbac09bfb1762c976061c50eb24
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-03 18:58:10+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:45+02:00
- Location:
- dyn_modules/syzextra
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/syzextra/mod_main.cc
rff7993 rcd5fefc 469 469 } 470 470 471 472 473 474 475 471 /// wrapper around p_Tail and id_Tail 476 472 static BOOLEAN Tail(leftv res, leftv h) 477 473 { … … 480 476 if( h == NULL ) 481 477 { 482 WarnS("Tail needs a nargument...");478 WarnS("Tail needs a poly/vector/ideal/module argument..."); 483 479 return TRUE; 484 480 } … … 486 482 assume( h != NULL ); 487 483 484 const ring r = currRing; 485 488 486 if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) 489 487 { 490 const poly p = (const poly)h->Data(); 491 488 res->data = p_Tail( (const poly)h->Data(), r ); 492 489 res->rtyp = h->Typ(); 493 494 if( p == NULL)495 res->data = NULL;496 else497 res->data = p_Copy( pNext(p), currRing );498 490 499 491 h = h->Next(); assume (h == NULL); … … 504 496 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) 505 497 { 506 const ideal id = (const ideal)h->Data(); 507 498 res->data = id_Tail( (const ideal)h->Data(), r ); 508 499 res->rtyp = h->Typ(); 509 510 if( id == NULL)511 res->data = NULL;512 else513 {514 const ideal newid = idInit(IDELEMS(id),id->rank);515 for (int i=IDELEMS(id) - 1; i >= 0; i--)516 if( id->m[i] != NULL )517 newid->m[i] = p_Copy(pNext(id->m[i]), currRing);518 else519 newid->m[i] = NULL;520 521 newid->rank = id_RankFreeModule(newid, currRing);522 523 res->data = newid;524 }525 500 526 501 h = h->Next(); assume (h == NULL); -
dyn_modules/syzextra/syzextra.cc
rff7993 rcd5fefc 28 28 29 29 30 poly p_Tail(const poly p, const ring r) 31 { 32 if( p == NULL) 33 return NULL; 34 else 35 return p_Copy( pNext(p), r ); 36 } 37 38 39 ideal id_Tail(const ideal id, const ring r) 40 { 41 if( id == NULL) 42 return NULL; 43 44 const ideal newid = idInit(IDELEMS(id),id->rank); 45 46 for (int i=IDELEMS(id) - 1; i >= 0; i--) 47 newid->m[i] = p_Tail( id->m[i], r ); 48 49 newid->rank = id_RankFreeModule(newid, currRing); 50 51 return newid; 52 } 53 30 54 31 55 -
dyn_modules/syzextra/syzextra.h
rff7993 rcd5fefc 34 34 35 35 36 /// return the tail of a given polynomial or vector 37 /// returns NULL if input is NULL, otherwise 38 /// the result is a new polynomial/vector in the ring r 39 poly p_Tail(const poly p, const ring r); 40 41 42 /// return the tail of a given ideal or module 43 /// returns NULL if input is NULL, otherwise 44 /// the result is a new ideal/module in the ring r 45 /// NOTE: the resulting rank is autocorrected 46 ideal id_Tail(const ideal id, const ring r); 47 36 48 37 49
Note: See TracChangeset
for help on using the changeset viewer.