Changeset 8cfee1c in git
- Timestamp:
- Feb 27, 2001, 7:05:16 PM (22 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 2d19a1bcc1aee3296e6608f8ae49f22b191d6880
- Parents:
- fcafdb560b501f01e41712af76bb8c58bd2f1a22
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/units.cc
rfcafdb r8cfee1c 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: units.cc,v 1. 7 2001-02-23 18:30:59 levandovExp $ */4 /* $Id: units.cc,v 1.8 2001-02-27 18:05:16 mschulze Exp $ */ 5 5 /* 6 6 * ABSTRACT: procedures to compute with units … … 9 9 #include "mod2.h" 10 10 #include "tok.h" 11 #include "febase.h" 11 12 #include "ipid.h" 12 #include "febase.h"13 13 #include "numbers.h" 14 14 #include "polys.h" 15 15 #include "ideals.h" 16 #include "intvec.h" 16 17 #include "matpol.h" 17 18 #include "kstd1.h" 18 19 #include "units.h" 19 20 20 matrix invunit(int n,matrix U) 21 { 22 assume(MATCOLS(U)==MATROWS(U)); 23 for(int i=MATCOLS(U);i>=1;i--) 24 MATELEM(U,i,i)=pInvers(n,MATELEM(U,i,i)); 25 return U; 26 } 27 28 ideal rednf(ideal N,ideal M,matrix U=NULL) 21 ideal redNF(ideal N,ideal M,matrix U=NULL,int d=-1,intvec *w=NULL) 29 22 { 30 23 matrix U0=NULL; … … 41 34 } 42 35 ideal M0=idInit(IDELEMS(M),M->rank); 43 ideal M1=kNF(N,currQuotient,M );44 while(idElem(M1)>0 )36 ideal M1=kNF(N,currQuotient,M,0,2); 37 while(idElem(M1)>0&&(d==-1||idMinDegW(M1,w)<=d)) 45 38 { 46 39 for(int i=IDELEMS(M)-1;i>=0;i--) … … 54 47 } 55 48 idDelete(&M1); 56 M1=kNF(N,currQuotient,M );49 M1=kNF(N,currQuotient,M,0,2); 57 50 } 58 51 idDelete(&M1); … … 64 57 } 65 58 66 poly red nf(ideal N,poly p,poly u=NULL)59 poly redNF(ideal N,poly p,poly u=NULL,int d=-1,intvec *w=NULL) 67 60 { 68 61 ideal M=idInit(1,pGetComp(p)); … … 70 63 ideal M0; 71 64 if(u==NULL) 72 M0=red nf(N,M);65 M0=redNF(N,M,NULL,d,w); 73 66 else 74 67 { 75 68 matrix U=mpNew(1,1); 76 69 MATELEM(U,1,1)=u; 77 M0=red nf(N,M,U);70 M0=redNF(N,M,U,d,w); 78 71 idDelete((ideal*)&U); 79 72 } … … 83 76 return p0; 84 77 } 78 -
Singular/units.h
rfcafdb r8cfee1c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: units.h,v 1. 4 2001-02-08 13:13:05 SingularExp $ */4 /* $Id: units.h,v 1.5 2001-02-27 18:05:16 mschulze Exp $ */ 5 5 /* 6 6 * ABSTRACT: procedures to compute with units … … 10 10 #define UNITS_H 11 11 12 BOOLEAN invunit(leftv res,leftv h); 13 poly invunit(int n,poly u); 14 matrix invunit(int n,matrix U); 15 ideal rednf(ideal N,ideal M,matrix U=NULL); 16 poly rednf(ideal N,poly p,poly u=NULL); 12 ideal redNF(ideal N,ideal M,matrix U=NULL,int d=-1,intvec *w=NULL); 13 poly redNF(ideal N,poly p,poly u=NULL,int d=-1,intvec *w=NULL); 17 14 18 15 #endif
Note: See TracChangeset
for help on using the changeset viewer.