Changeset 5402320 in git for Singular/iparith.cc
- Timestamp:
- Jun 24, 2010, 1:56:07 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 7c4567365d4b984af1971a4e0e08294f46788f75
- Parents:
- be8dbbe24ea3d24955f3335b0be7c4c0bafd4d87
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
rbe8dbb r5402320 58 58 #include "MinorInterface.h" 59 59 #include "linearAlgebra.h" 60 #include "misc.h" 60 61 #ifdef HAVE_FACTORY 61 62 #include "clapsing.h" … … 372 373 { "preimage", 0, PREIMAGE_CMD , CMD_13}, 373 374 { "prime", 0, PRIME_CMD , CMD_1}, 375 { "primefactors",0, PFAC_CMD , CMD_12}, 374 376 { "print", 0, PRINT_CMD , CMD_12}, 375 377 { "prune", 0, PRUNE_CMD , CMD_1}, … … 3181 3183 } 3182 3184 #endif 3185 static BOOLEAN jjPFAC2(leftv res, leftv u, leftv v) 3186 { 3187 number m = (number)u->Data(); 3188 int bound = (int)(long)v->Data(); 3189 number n; 3190 if (u->Typ() == BIGINT_CMD) n = m; 3191 else 3192 { 3193 /* then, we expect some other type of number inside m; 3194 it needs to be converted to bigint; we do this via 'int' */ 3195 int i = n_Int(m, currRing); 3196 n = nlInit(i, NULL); 3197 } 3198 lists l = primeFactorisation(n, bound); 3199 res->data=(char*)l; 3200 return FALSE; 3201 } 3183 3202 static BOOLEAN jjRSUM(leftv res, leftv u, leftv v) 3184 3203 { … … 3652 3671 ,{jjRES, MRES_CMD, RESOLUTION_CMD, MODUL_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING} 3653 3672 //,{nuMPResMat, MPRES_CMD, MODUL_CMD, IDEAL_CMD, INT_CMD, NO_PLURAL |ALLOW_RING} 3673 ,{jjPFAC2, PFAC_CMD, LIST_CMD, BIGINT_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING} 3674 ,{jjPFAC2, PFAC_CMD, LIST_CMD, NUMBER_CMD, INT_CMD, ALLOW_PLURAL |ALLOW_RING} 3654 3675 #ifdef HAVE_PLURAL 3655 3676 ,{jjPlural_num_poly, NCALGEBRA_CMD,NONE, POLY_CMD, POLY_CMD , NO_PLURAL |NO_RING} … … 4441 4462 #define jjLONG2N(D) nlInit((int)D, NULL) 4442 4463 #endif 4464 static BOOLEAN jjPFAC1(leftv res, leftv v) 4465 { 4466 number m = (number)v->Data(); 4467 number n; 4468 if (v->Typ() == BIGINT_CMD) n = m; 4469 else 4470 { 4471 /* then, we expect some other type of number inside m; 4472 it needs to be converted to bigint; we do this via 'int' */ 4473 int i = n_Int(m, currRing); 4474 n = nlInit(i, NULL); 4475 } 4476 lists l = primeFactorisation(n, 0); 4477 res->data=(char*)l; 4478 return FALSE; 4479 } 4443 4480 static BOOLEAN jjLU_DECOMP(leftv res, leftv v) 4444 4481 { … … 5431 5468 ,{jjKBASE, KBASE_CMD, MODUL_CMD, MODUL_CMD , ALLOW_PLURAL |ALLOW_RING} 5432 5469 ,{jjLU_DECOMP, LU_CMD, LIST_CMD, MATRIX_CMD , NO_PLURAL |NO_RING} 5470 ,{jjPFAC1, PFAC_CMD, LIST_CMD, BIGINT_CMD , ALLOW_PLURAL |ALLOW_RING} 5471 ,{jjPFAC1, PFAC_CMD, LIST_CMD, NUMBER_CMD , ALLOW_PLURAL |ALLOW_RING} 5433 5472 ,{atKILLATTR1, KILLATTR_CMD, NONE, IDHDL , ALLOW_PLURAL |ALLOW_RING} 5434 5473 #ifdef MDEBUG
Note: See TracChangeset
for help on using the changeset viewer.