Changeset 43fa86 in git
- Timestamp:
- Jul 9, 2018, 2:39:57 PM (5 years ago)
- Branches:
- (u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
- Children:
- 113a802e445da6c564286206f2eb02f93a3167a3
- Parents:
- a527a41aee3e0ac9b4976e8cb9864ff4632dac44
- Location:
- libpolys/coeffs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/numbers.cc
ra527a41 r43fa86 567 567 } 568 568 569 coeffs nFindCoeffByName(const char *cf_name) 569 struct nFindCoeffByName_s; 570 typedef struct nFindCoeffByName_s* nFindCoeffByName_p; 571 572 struct nFindCoeffByName_s 573 { 574 n_coeffType n; 575 cfInitCfByNameProc p; 576 nFindCoeffByName_p next; 577 }; 578 579 nFindCoeffByName_p nFindCoeffByName_Root=NULL; 580 void nRegisterCfByName(cfInitCfByNameProc p,n_coeffType n) 581 { 582 nFindCoeffByName_p h=(nFindCoeffByName_p)omAlloc0(sizeof(*h)); 583 h->p=p; 584 h->n=n; 585 h->next=nFindCoeffByName_Root; 586 nFindCoeffByName_Root=h; 587 } 588 589 coeffs nFindCoeffByName(char *cf_name) 570 590 { 571 591 n_Procs_s* n=cf_root; 592 // try existings coeffs: 572 593 while(n!=NULL) 573 594 { … … 577 598 } 578 599 // TODO: parametrized cf, e.g. flint:Z/26[a] 600 // try existing types: 601 nFindCoeffByName_p p=nFindCoeffByName_Root; 602 while(p!=NULL) 603 { 604 coeffs cf=p->p(cf_name,p->n); 605 if (cf!=NULL) return cf; 606 p=p->next; 607 } 579 608 return NULL; 580 609 } -
libpolys/coeffs/numbers.h
ra527a41 r43fa86 96 96 n_coeffType nRegister(n_coeffType n, cfInitCharProc p); 97 97 98 /// initialize an object of type coeffs by its name, return NULL otherwise 99 typedef coeffs (*cfInitCfByNameProc)(char *s,n_coeffType n); 100 void nRegisterCfByName(cfInitCfByNameProc p,n_coeffType n); 101 98 102 /// find an existing coeff by its "CoeffName" 99 coeffs nFindCoeffByName(c onst char *n);103 coeffs nFindCoeffByName(char *n); 100 104 101 105 /// divide by the first (leading) number and return it, i.e. make monic
Note: See TracChangeset
for help on using the changeset viewer.