Changeset 4c1fc0 in git


Ignore:
Timestamp:
Jun 19, 2020, 10:55:59 AM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3d6980be663538ed4efeec213d1769a026246946
Parents:
a02e2d11b6842e0841b4b9ee0908d69811cb330abd4cb060451e0b667bf3d6fd96cd6bfeff53ce4d
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2020-06-19 10:55:59+02:00
git-committer:
GitHub <noreply@github.com>2020-06-19 10:55:59+02:00
Message:
Merge pull request #1009 from fingolfin/mh/sigcontext

Unify access to sigcontext on Linux + x86
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/cntrlc.cc

    ra02e2d r4c1fc0  
    55* ABSTRACT - interupt handling
    66*/
     7
     8#ifndef _GNU_SOURCE
     9#define _GNU_SOURCE
     10#endif
     11
    712#include "kernel/mod2.h"
    813
     
    155160
    156161/*---------------------------------------------------------------------*/
    157 #if defined(__linux__) && defined(__i386)
    158   #if !defined(HAVE_SIGCONTEXT) && !defined(HAVE_ASM_SIGCONTEXT_H)
    159 // we need the following structure sigcontext_struct.
    160 // if configure finds asm/singcontext.h we assume
    161 // that this file contains the structure and is included
    162 // via signal.h
    163 struct sigcontext_struct {
    164         unsigned short gs, __gsh;
    165         unsigned short fs, __fsh;
    166         unsigned short es, __esh;
    167         unsigned short ds, __dsh;
    168         unsigned long edi;
    169         unsigned long esi;
    170         unsigned long ebp;
    171         unsigned long esp;
    172         unsigned long ebx;
    173         unsigned long edx;
    174         unsigned long ecx;
    175         unsigned long eax;
    176         unsigned long trapno;
    177         unsigned long err;
    178         unsigned long eip;
    179         unsigned short cs, __csh;
    180         unsigned long eflags;
    181         unsigned long esp_at_signal;
    182         unsigned short ss, __ssh;
    183         unsigned long i387;
    184         unsigned long oldmask;
    185         unsigned long cr2;
    186 };
    187 #endif
    188 #define HAVE_SIGSTRUCT
    189 typedef struct sigcontext_struct sigcontext;
    190 #endif
    191 
    192 #if defined(__linux__) && defined(__amd64)
    193 #define HAVE_SIGSTRUCT
    194 #endif
    195 
    196 
    197 #if defined(HAVE_SIGSTRUCT)
     162#if defined(__linux__) && (defined(__i386) || defined(__amd64))
    198163/*2---------------------------------------------------------------------*/
    199164/**
  • factory/FLINTconvert.cc

    rbd4cb06 r4c1fc0  
    303303  CFFList result;
    304304  long i;
     305
     306  result.append (CFFactor(convertFmpz2CF(&fac->c),1));
    305307
    306308  for (i = 0; i < fac->num; i++)
  • factory/cf_factor.cc

    rbd4cb06 r4c1fc0  
    547547      CanonicalForm ic=icontent(fz);
    548548      fz/=ic;
    549       #if 0 // #if defined(HAVE_FLINT) && (__FLINT_RELEASE>=20504)
    550       // use FLINT
    551       fmpz_poly_t f1;
    552       convertFacCF2Fmpz_poly_t (f1, fz);
    553       fmpz_poly_factor_t result;
    554       fmpz_poly_factor_init (result);
    555       fmpz_poly_factor_zassenhaus(result, f1);
    556       F= convertFLINTfmpz_poly_factor2FacCFFList (result, fz.mvar());
    557       fmpz_poly_factor_clear (result);
    558       fmpz_poly_clear (f1);
     549      if (fz.degree()==1)
     550      {
     551        F=CFFList(CFFactor(fz,1));
     552      }
     553      else
     554      #if defined(HAVE_FLINT) && (__FLINT_RELEASE>=20504)
     555      {
     556        // use FLINT
     557        fmpz_poly_t f1;
     558        convertFacCF2Fmpz_poly_t (f1, fz);
     559        fmpz_poly_factor_t result;
     560        fmpz_poly_factor_init (result);
     561        fmpz_poly_factor(result, f1);
     562        F= convertFLINTfmpz_poly_factor2FacCFFList (result, fz.mvar());
     563        fmpz_poly_factor_clear (result);
     564        fmpz_poly_clear (f1);
     565      }
    559566      if ( ! ic.isOne() )
    560567      {
     
    569576      }
    570577      goto end_char0;
    571       #elif defined HAVE_NTL
    572       //USE NTL
    573       ZZ c;
    574       vec_pair_ZZX_long factors;
    575       //factorize the converted polynomial
    576       factor(c,factors,convertFacCF2NTLZZX(fz));
    577 
    578       //convert the result back to Factory
    579       F=convertNTLvec_pair_ZZX_long2FacCFFList(factors,c,fz.mvar());
     578      #elif defined(HAVE_NTL)
     579      {
     580        //USE NTL
     581        ZZ c;
     582        vec_pair_ZZX_long factors;
     583        //factorize the converted polynomial
     584        factor(c,factors,convertFacCF2NTLZZX(fz));
     585
     586        //convert the result back to Factory
     587        F=convertNTLvec_pair_ZZX_long2FacCFFList(factors,c,fz.mvar());
     588      }
    580589      if ( ! ic.isOne() )
    581590      {
Note: See TracChangeset for help on using the changeset viewer.