Changeset a8ee9f in git
- Timestamp:
- Aug 10, 2011, 7:47:18 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 5ad2f83d3e2adb737f473c82dc9e1098500624e9
- Parents:
- 5ff1d31f3d80f972b5abf4d4435d01cb9b033ffb
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-10 19:47:18+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:19:14+01:00
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/misc_ip.cc
r5ff1d3 ra8ee9f 6 6 * This file provides miscellaneous functionality. 7 7 * 8 * For more general information, see the documentation in 9 * misc_ip.h. 10 * 11 * @author Frank Seelisch 8 * For more general information, see the documentation in misc_ip.h. 12 9 * 13 10 * @internal @version \$Id$ … … 18 15 // include header files 19 16 #include <kernel/mod2.h> 20 #include <Singular/lists.h> 21 #include <kernel/longrat.h> 22 #include <Singular/misc_ip.h> 23 #include <Singular/feOpt.h> 24 #include <Singular/silink.h> 17 #include <misc/auxiliary.h> 18 19 #include "misc_ip.h" 20 #include "ipid.h" 21 22 #include <coeffs/coeffs.h> 23 // #include <coeffs/longrat.h> 24 25 #include "feOpt.h" 26 #include "silink.h" 25 27 26 28 void number2mpz(number n, mpz_t m) 27 29 { 28 if (SR_HDL(n) & SR_INT) mpz_init_set_si(m, SR_TO_INT(n)); /* n fits in an int */ 29 else mpz_init_set(m, (mpz_ptr)n->z); 30 n_MPZ(m, n, coeffs_BIGINT); 30 31 } 31 32 32 33 number mpz2number(mpz_t m) 33 34 { 34 number z = ALLOC_RNUMBER(); 35 mpz_init_set(z->z, m); 36 mpz_init_set_ui(z->n, 1); 37 z->s = 3; 38 return z; 39 } 35 return n_Init(m, coeffs_BIGINT); 36 } 37 40 38 41 39 void divTimes(mpz_t n, mpz_t d, int* times) … … 111 109 else 112 110 { 113 number nn = nlRInit(ui); 114 mpz_set_ui(nn->z,ui); 111 number nn = n_Init(ui, coeffs_BIGINT); 115 112 L->m[index].rtyp = BIGINT_CMD; L->m[index].data = (void*)nn; 116 113 } … … 176 173 */ 177 174 175 176 178 177 /* n and pBound are assumed to be bigint numbers */ 179 178 lists primeFactorisation(const number n, const number pBound) … … 188 187 int positive=1; int probTest = 0; 189 188 190 if (!n lIsZero(n))191 { 192 if (!n lGreaterZero(n))189 if (!n_IsZero(n, coeffs_BIGINT)) 190 { 191 if (!n_GreaterZero(n, coeffs_BIGINT)) 193 192 { 194 193 positive=-1; … … 332 331 } 333 332 334 #include <string.h> 335 #include <unistd.h> 336 #include <stdio.h> 337 #include <stddef.h> 338 #include <stdlib.h> 339 #include <time.h> 340 333 #include <omalloc/omalloc.h> 341 334 #include <omalloc/mylimits.h> 342 #include <omalloc/omalloc.h> 335 343 336 #include <misc/options.h> 344 #include <kernel/febase.h>345 #include <Singular/cntrlc.h>346 #include <kernel/page.h>347 #include <Singular/ipid.h>348 #include <Singular/ipshell.h>349 #include <kernel/kstd1.h>350 #include <Singular/subexpr.h>351 #include <kernel/timer.h>352 337 #include <misc/intvec.h> 338 353 339 #include <polys/monomials/ring.h> 354 340 #include <polys/templates/p_Procs.h> 355 /* Needed for debug Version of p_SetRingOfLeftv, Oliver */ 356 #ifdef PDEBUG 357 #include <polys/polys.h> 358 #endif 359 #include <Singular/version.h> 360 361 #include <Singular/static.h> 341 342 #include <kernel/febase.h> 343 #include <kernel/page.h> 344 #include <kernel/kstd1.h> 345 #include <kernel/timer.h> 346 347 348 #include "subexpr.h" 349 #include "cntrlc.h" 350 #include "ipid.h" 351 #include "ipshell.h" 352 353 #include "version.h" 354 #include "static.h" 355 362 356 #ifdef HAVE_STATIC 363 357 #undef HAVE_DYN_RL … … 372 366 #ifdef HAVE_FACTORY 373 367 #define SI_DONT_HAVE_GLOBAL_VARS 374 #include <factory/factory.h>368 //#include <factory/factory.h> 375 369 // libfac: 376 370 extern const char * libfac_version; … … 399 393 *} 400 394 */ 395 396 #include <string.h> 397 #include <unistd.h> 398 #include <stdio.h> 399 #include <stddef.h> 400 #include <stdlib.h> 401 #include <time.h> 402 401 403 402 404 void singular_example(char *str) -
Singular/misc_ip.h
r5ff1d3 ra8ee9f 15 15 * these algorithms have been moved to the C/C++ kernel. 16 16 * 17 * @author Frank Seelisch 17 * @author Frank Seelisch, Oleksandr Motsak 18 18 * 19 19 * @internal @version \$Id$ … … 25 25 #define MISC_H 26 26 27 #include <misc/auxiliary.h> 28 #include <coeffs/coeffs.h> 29 30 #include <kernel/structs.h> 27 31 #include <coeffs/si_gmp.h> 28 #include <kernel/structs.h>29 32 30 // include basic SINGULAR structures 31 /* So far nothing is required. */ 32 33 /** 34 * Converts a non-negative bigint number into a GMP number. 35 * 36 **/ 37 void number2mpz(number n, /**< [in] a bigint number >= 0 */ 38 mpz_t m /**< [out] the GMP equivalent */ 39 ); 40 41 /** 42 * Converts a non-negative GMP number into a bigint number. 43 * 44 * @return the bigint number representing the given GMP number 45 **/ 46 number mpz2number(mpz_t m /**< [in] a GMP number >= 0 */ 47 ); 33 #include <Singular/lists.h> 48 34 49 35 /**
Note: See TracChangeset
for help on using the changeset viewer.