Changeset 95eb6d in git
- Timestamp:
- Aug 11, 2011, 4:58:09 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 8a5c493dd06549f9120fe7fda0d889a440420073
- Parents:
- e635762ac89855572d3b5a9ff0bd5ede49811d20
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-11 16:58:09+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:19:17+01:00
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
re63576 r95eb6d 9 9 #define HAVE_WALK 1 10 10 11 #include <kernel/mod2.h> 12 #include <misc/auxiliary.h> 13 14 #ifdef HAVE_FACTORY 15 // #define SI_DONT_HAVE_GLOBAL_VARS 16 #include <factory/factory.h> 17 #endif 18 19 11 20 #include <stdlib.h> 12 21 #include <stdio.h> … … 14 23 #include <ctype.h> 15 24 #include <signal.h> 16 #include <kernel/mod2.h>17 #include <misc_ip.h>18 25 19 26 #ifdef TIME_WITH_SYS_TIME … … 35 42 #include <unistd.h> 36 43 37 #include <Singular/tok.h>38 44 #include <misc/options.h> 39 #include <Singular/ipid.h> 45 46 // #include <coeffs/ffields.h> 47 #include <coeffs/coeffs.h> 48 #include <coeffs/mpr_complex.h> 49 50 #include <polys/monomials/ring.h> 40 51 #include <polys/polys.h> 41 #include <Singular/lists.h> 42 #include <kernel/kutil.h> 43 #include <Singular/cntrlc.h> 52 53 #include <polys/monomials/maps.h> 54 #include <polys/matpol.h> 55 56 // #include <kernel/longalg.h> 57 #include <polys/prCopy.h> 58 #include <polys/weight.h> 59 60 61 #include <kernel/fast_mult.h> 62 #include <kernel/digitech.h> 44 63 #include <kernel/stairc.h> 45 #include <Singular/ipshell.h>46 64 #include <kernel/modulop.h> 47 65 #include <kernel/febase.h> 48 #include <polys/matpol.h>49 //#include <kernel/longalg.h>50 66 #include <kernel/ideals.h> 51 67 #include <kernel/kstd1.h> 52 68 #include <kernel/syz.h> 53 #include <Singular/sdb.h> 54 #include <Singular/feOpt.h> 55 #include <Singular/distrib.h> 56 #include <polys/prCopy.h> 57 #include <coeffs/mpr_complex.h> 58 #include <coeffs/ffields.h> 59 #include <Singular/minpoly.h> 69 #include <kernel/kutil.h> 70 71 #include <kernel/shiftgb.h> 72 #include <kernel/linearAlgebra.h> 73 74 // for tests of t-rep-GB 75 #include <kernel/tgb.h> 76 77 78 #include "tok.h" 79 #include "ipid.h" 80 #include "lists.h" 81 #include "cntrlc.h" 82 #include "ipshell.h" 83 #include "sdb.h" 84 #include "feOpt.h" 85 #include "fehelp.h" 86 #include "distrib.h" 87 88 #include "minpoly.h" 89 #include "misc_ip.h" 90 91 #include "attrib.h" 92 93 #include "silink.h" 94 #include "walk.h" 95 96 60 97 61 98 #ifdef HAVE_RINGS … … 69 106 70 107 #ifdef HAVE_F5 71 #include < Singular/f5gb.h>108 #include <kernel/f5gb.h> 72 109 #endif 73 110 74 111 #ifdef HAVE_WALK 75 #include <Singular/walk.h>112 #include "walk.h" 76 113 #endif 77 114 78 #include <polys/weight.h>79 #include <kernel/fast_mult.h>80 #include <kernel/digitech.h>81 115 82 116 #ifdef HAVE_SPECTRUM … … 88 122 #endif 89 123 90 #include <Singular/attrib.h>91 92 124 #if defined(HPUX_10) || defined(HPUX_9) 93 125 extern "C" int setenv(const char *name, const char *value, int overwrite); 94 126 #endif 95 127 96 #include <polys/nc//sca.h> 128 97 129 #ifdef HAVE_PLURAL 98 #include <polys/ monomials/ring.h>130 #include <polys/nc/nc.h> 99 131 #include <polys/nc/ncSAMult.h> // for CMultiplier etc classes 100 #include <Singular/ipconv.h> 101 #include <polys/monomials/ring.h> 132 #include <polys/nc/sca.h> 133 #include <kernel/nc.h> 134 #include "ipconv.h" 102 135 #ifdef HAVE_RATGRING 103 136 #include <kernel/ratgring.h> … … 108 141 /* #include "WinDllTest.h" */ 109 142 #ifdef HAVE_DL 110 #include < Singular/mod_raw.h>143 #include <polys/mod_raw.h> 111 144 #endif 112 145 #endif 113 146 114 // for tests of t-rep-GB115 #include <kernel/tgb.h>116 147 117 148 // Define to enable many more system commands … … 123 154 #ifdef HAVE_FACTORY 124 155 #define SI_DONT_HAVE_GLOBAL_VARS 156 157 ////// #include <libfac/factor.h> //////????? 158 125 159 #include <polys/clapconv.h> 126 160 #include <kernel/kstdfac.h> 127 #include <libfac/factor.h>128 161 #endif 162 129 163 #include <polys/clapsing.h> 130 164 131 #include <Singular/silink.h>132 #include <Singular/walk.h>133 134 #include <polys/monomials/maps.h>135 136 #include <kernel/shiftgb.h>137 #include <kernel/linearAlgebra.h>138 139 165 #ifdef HAVE_EIGENVAL 140 #include <Singular/eigenval_ip.h>166 #include "eigenval_ip.h" 141 167 #endif 142 168 143 169 #ifdef HAVE_GMS 144 #include <Singular/gms.h>170 #include "gms.h" 145 171 #endif 146 172 … … 154 180 155 181 #ifdef HAVE_PCV 156 #include <Singular/pcv.h>182 #include "pcv.h" 157 183 #endif 158 184 … … 196 222 { 197 223 entry = p_GetCoeff(p, currRing); 198 entryAsInt = n_Int(entry, currRing );199 if (entryAsInt < 0) entryAsInt += currRing->ch;224 entryAsInt = n_Int(entry, currRing->cf); 225 if (entryAsInt < 0) entryAsInt += n_GetChar(currRing->cf); 200 226 } 201 227 else … … 299 325 300 326 /*==================== gen ==================================*/ 301 if(strcmp(sys_cmd,"gen")==0) 302 { 303 res->rtyp=INT_CMD; 304 res->data=(void *)(long)npGen; 305 return FALSE; 306 } 307 else 327 // // This seems to be obsolette...?! 328 // // TODO: cleanup doc/reference.doc:6998 to system("gen") 329 // if(strcmp(sys_cmd,"gen")==0) 330 // { 331 // res->rtyp=INT_CMD; 332 // res->data=(void *)(long)npGen; 333 // return FALSE; 334 // } 335 // else 308 336 /*==================== sh ==================================*/ 309 337 if(strcmp(sys_cmd,"sh")==0) … … 627 655 if ( h->next!=NULL && h->next->Typ()==INT_CMD ) 628 656 { 629 if ( !rField_is_long_C( ) )657 if ( !rField_is_long_C(currRing) ) 630 658 { 631 659 Werror( "unsupported ground field!"); … … 655 683 if(strcmp(sys_cmd,"getPrecDigits")==0) 656 684 { 657 if ( !rField_is_long_C( ) && !rField_is_long_R() )685 if ( !rField_is_long_C(currRing) && !rField_is_long_R(currRing) ) 658 686 { 659 687 Werror( "unsupported ground field!"); … … 679 707 mpz_inp_str(m, f, 10); 680 708 fclose(f); 681 number n = mpz2number(m);709 number n = n_Init(m, coeffs_BIGINT); 682 710 res->rtyp = BIGINT_CMD; 683 711 res->data = (void*)n; … … 956 984 { 957 985 res->rtyp=STRING_CMD; 958 res->data=(void *)singclap_neworder((ideal)h->Data() );986 res->data=(void *)singclap_neworder((ideal)h->Data(), currRing); 959 987 return FALSE; 960 988 } … … 1336 1364 { 1337 1365 poly p = (poly)IDDATA(w); 1338 res->data = pOppose(Rop, p);1366 res->data = pOppose(Rop, p, currRing); // into CurrRing? 1339 1367 res->rtyp = POLY_CMD; 1340 1368 return FALSE; … … 2295 2323 /* == now the work starts == */ 2296 2324 2297 short * iv=iv2array(v );2325 short * iv=iv2array(v, currRing); 2298 2326 poly r=0; 2299 2327 poly hp=ppJetW(f,n,iv); 2300 2328 int s=MATCOLS(m); 2301 2329 int j=0; 2302 matrix T=mp InitI(s,1,0);2330 matrix T=mp_InitI(s,1,0, currRing); 2303 2331 2304 2332 while (hp != NULL) … … 2332 2360 } 2333 2361 2334 matrix Temp=mp Transp((matrix) idVec2Ideal(r));2362 matrix Temp=mp_Transp((matrix) idVec2Ideal(r), currRing); 2335 2363 matrix R=mpNew(MATCOLS((matrix) idVec2Ideal(f)),1); 2336 2364 for (int k=1;k<=MATROWS(Temp);k++) … … 2537 2565 #endif 2538 2566 /*==================== naIdeal ==================================*/ 2539 if(strcmp(sys_cmd,"naIdeal")==0) 2540 { 2541 if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 2542 { 2543 naSetIdeal((ideal)h->Data()); 2544 return FALSE; 2545 } 2546 else 2547 WerrorS("ideal expected"); 2548 } 2549 else 2567 // // This seems to be obsolette with the new Frank's alg.ext field... 2568 // if(strcmp(sys_cmd,"naIdeal")==0) 2569 // { 2570 // if ((h!=NULL) &&(h->Typ()==IDEAL_CMD)) 2571 // { 2572 // naSetIdeal((ideal)h->Data()); 2573 // return FALSE; 2574 // } 2575 // else 2576 // WerrorS("ideal expected"); 2577 // } 2578 // else 2550 2579 /*==================== isSqrFree =============================*/ 2551 2580 #ifdef HAVE_FACTORY … … 2555 2584 { 2556 2585 res->rtyp=INT_CMD; 2557 res->data=(void *)(long) singclap_isSqrFree((poly)h->Data() );2586 res->data=(void *)(long) singclap_isSqrFree((poly)h->Data(), currRing); 2558 2587 return FALSE; 2559 2588 } … … 2791 2820 matrix m = (matrix)h->Data(); 2792 2821 int n = m->rows(); 2793 unsigned long p = (unsigned long) currRing->ch;2822 unsigned long p = (unsigned long)n_GetChar(currRing->cf); 2794 2823 if (n != m->cols()) 2795 2824 { … … 2853 2882 int c=rChar(currRing); 2854 2883 setCharacteristic( c,nfMinPoly[0], currRing->parameter[0][0] ); 2855 CanonicalForm F( convSingGFFactoryGF( (poly)h->Data() ) );2884 CanonicalForm F( convSingGFFactoryGF( (poly)h->Data(), currRing ) ); 2856 2885 res->rtyp=POLY_CMD; 2857 res->data=convFactoryGFSingGF( F );2886 res->data=convFactoryGFSingGF( F, currRing ); 2858 2887 return FALSE; 2859 2888 } … … 3450 3479 return TRUE; 3451 3480 } 3452 if (!rField_is_Q( ))3481 if (!rField_is_Q(currRing)) 3453 3482 { 3454 3483 WerrorS("coeff field must be Q"); … … 3459 3488 int sw_rat=isOn(SW_RATIONAL); 3460 3489 On(SW_RATIONAL); 3461 CanonicalForm F( convSingPClapP((poly)(h->Data()) ));3490 CanonicalForm F( convSingPClapP((poly)(h->Data()), currRing)); 3462 3491 B.bifac(F, 1); 3463 3492 CFFList L=B.getFactors(); … … 3476 3505 new_ring->parameter=names; 3477 3506 new_ring->extRing=alg_ring; 3478 new_ring->ch=1; 3507 new_ring->ch=1; // WTF!!??? :( 3479 3508 rComplete(new_ring,TRUE); 3480 3509 // set the mipo =============================================== … … 3594 3623 if (h->Typ()==MATRIX_CMD) 3595 3624 { 3596 res->data=(char *)singntl_HNF((matrix)h->Data() );3625 res->data=(char *)singntl_HNF((matrix)h->Data(), currRing); 3597 3626 return FALSE; 3598 3627 } 3599 3628 else if (h->Typ()==INTMAT_CMD) 3600 3629 { 3601 res->data=(char *)singntl_HNF((intvec*)h->Data() );3630 res->data=(char *)singntl_HNF((intvec*)h->Data(), currRing); 3602 3631 return FALSE; 3603 3632 } … … 3614 3643 if (h->Typ()==MATRIX_CMD) 3615 3644 { 3616 res->data=(char *)singntl_LLL((matrix)h->Data() );3645 res->data=(char *)singntl_LLL((matrix)h->Data(), currRing); 3617 3646 return FALSE; 3618 3647 } 3619 3648 else if (h->Typ()==INTMAT_CMD) 3620 3649 { 3621 res->data=(char *)singntl_LLL((intvec*)h->Data() );3650 res->data=(char *)singntl_LLL((intvec*)h->Data(), currRing); 3622 3651 return FALSE; 3623 3652 } … … 3633 3662 if (h!=NULL && (h->Typ()== POLY_CMD) && ((h->next != NULL) && h->next->Typ() == STRING_CMD)) 3634 3663 { 3635 CanonicalForm F= convSingPFactoryP((poly)(h->Data()) );3664 CanonicalForm F= convSingPFactoryP((poly)(h->Data()), currRing); 3636 3665 char *s=(char *)h->next->Data(); 3637 3666 double error= atof (s); -
Singular/maps_ip.cc
re63576 r95eb6d 213 213 poly pSubstPar(poly p, int par, poly image) 214 214 { 215 ideal theMapI =idInit(rPar(currRing),1);216 nMapFunc nMap =n_SetMap(currRing->cf->extRing->cf, currRing->cf->extRing->cf);215 ideal theMapI = idInit(rPar(currRing),1); 216 nMapFunc nMap = n_SetMap(currRing->cf->extRing->cf, currRing->cf->extRing->cf); 217 217 218 218 int i; 219 219 poly pp; 220 for(i =rPar(currRing);i>0;i--)220 for(i = rPar(currRing);i>0;i--) 221 221 { 222 222 if (i!=par) -
Singular/misc_ip.cc
re63576 r95eb6d 34 34 #include "silink.h" 35 35 36 void number2mpz(number n, mpz_t m) 37 { 38 n_MPZ(m, n, coeffs_BIGINT); 39 } 40 41 number mpz2number(mpz_t m) 42 { 43 return n_Init(m, coeffs_BIGINT); 44 } 36 // the following 2 inline functions are just convenience shortcuts for Frank's code: 37 static inline void number2mpz(number n, mpz_t m){ n_MPZ(m, n, coeffs_BIGINT); } 38 static inline number mpz2number(mpz_t m){ return n_Init(m, coeffs_BIGINT); } 45 39 46 40 -
libpolys/coeffs/modulop.h
re63576 r95eb6d 22 22 #define NV_MAX_PRIME 32003 23 23 24 extern int npGen; 24 // extern int npGen; // obsolete 25 25 26 26 BOOLEAN npInitChar(coeffs r, void* p);
Note: See TracChangeset
for help on using the changeset viewer.