Changeset a8ee9f in git


Ignore:
Timestamp:
Aug 10, 2011, 7:47:18 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
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
Message:
FIX: use new MPZ<->NUMBER conversions for coeffs + coeffs_BIGINT
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/misc_ip.cc

    r5ff1d3 ra8ee9f  
    66 * This file provides miscellaneous functionality.
    77 *
    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.
    129 *
    1310 * @internal @version \$Id$
     
    1815// include header files
    1916#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"
    2527
    2628void number2mpz(number n, mpz_t m)
    2729{
    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);
    3031}
    3132
    3233number mpz2number(mpz_t m)
    3334{
    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
    4038
    4139void divTimes(mpz_t n, mpz_t d, int* times)
     
    111109  else
    112110  {
    113     number nn = nlRInit(ui);
    114     mpz_set_ui(nn->z,ui);
     111    number nn = n_Init(ui, coeffs_BIGINT);
    115112    L->m[index].rtyp = BIGINT_CMD; L->m[index].data = (void*)nn;
    116113  }
     
    176173*/
    177174
     175
     176
    178177/* n and pBound are assumed to be bigint numbers */
    179178lists primeFactorisation(const number n, const number pBound)
     
    188187  int positive=1; int probTest = 0;
    189188
    190   if (!nlIsZero(n))
    191   {
    192     if (!nlGreaterZero(n))
     189  if (!n_IsZero(n, coeffs_BIGINT))
     190  {
     191    if (!n_GreaterZero(n, coeffs_BIGINT))
    193192    {
    194193      positive=-1;
     
    332331}
    333332
    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>
    341334#include <omalloc/mylimits.h>
    342 #include <omalloc/omalloc.h>
     335
    343336#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>
    352337#include <misc/intvec.h>
     338
    353339#include <polys/monomials/ring.h>
    354340#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
    362356#ifdef HAVE_STATIC
    363357#undef HAVE_DYN_RL
     
    372366#ifdef HAVE_FACTORY
    373367#define SI_DONT_HAVE_GLOBAL_VARS
    374 #include <factory/factory.h>
     368//#include <factory/factory.h>
    375369// libfac:
    376370  extern const char * libfac_version;
     
    399393*}
    400394*/
     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
    401403
    402404void singular_example(char *str)
  • Singular/misc_ip.h

    r5ff1d3 ra8ee9f  
    1515 *           these algorithms have been moved to the C/C++ kernel.
    1616 *
    17  * @author Frank Seelisch
     17 * @author Frank Seelisch, Oleksandr Motsak
    1818 *
    1919 * @internal @version \$Id$
     
    2525#define MISC_H
    2626
     27#include <misc/auxiliary.h>
     28#include <coeffs/coeffs.h>
     29
     30#include <kernel/structs.h>
    2731#include <coeffs/si_gmp.h>
    28 #include <kernel/structs.h>
    2932
    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>
    4834
    4935/**
Note: See TracChangeset for help on using the changeset viewer.