Changeset 95eb6d in git


Ignore:
Timestamp:
Aug 11, 2011, 4:58:09 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
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
Message:
FIX: headers
FIX: almost done with extra.cc (save for ITIMER_VIRTUAL, setitimer)
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    re63576 r95eb6d  
    99#define HAVE_WALK 1
    1010
     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
    1120#include <stdlib.h>
    1221#include <stdio.h>
     
    1423#include <ctype.h>
    1524#include <signal.h>
    16 #include <kernel/mod2.h>
    17 #include <misc_ip.h>
    1825
    1926#ifdef TIME_WITH_SYS_TIME
     
    3542#include <unistd.h>
    3643
    37 #include <Singular/tok.h>
    3844#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>
    4051#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>
    4463#include <kernel/stairc.h>
    45 #include <Singular/ipshell.h>
    4664#include <kernel/modulop.h>
    4765#include <kernel/febase.h>
    48 #include <polys/matpol.h>
    49 //#include <kernel/longalg.h>
    5066#include <kernel/ideals.h>
    5167#include <kernel/kstd1.h>
    5268#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
    6097
    6198#ifdef HAVE_RINGS
     
    69106
    70107#ifdef HAVE_F5
    71 #include <Singular/f5gb.h>
     108#include <kernel/f5gb.h>
    72109#endif
    73110
    74111#ifdef HAVE_WALK
    75 #include <Singular/walk.h>
     112#include "walk.h"
    76113#endif
    77114
    78 #include <polys/weight.h>
    79 #include <kernel/fast_mult.h>
    80 #include <kernel/digitech.h>
    81115
    82116#ifdef HAVE_SPECTRUM
     
    88122#endif
    89123
    90 #include <Singular/attrib.h>
    91 
    92124#if defined(HPUX_10) || defined(HPUX_9)
    93125extern "C" int setenv(const char *name, const char *value, int overwrite);
    94126#endif
    95127
    96 #include <polys/nc//sca.h>
     128
    97129#ifdef HAVE_PLURAL
    98 #include <polys/monomials/ring.h>
     130#include <polys/nc/nc.h>
    99131#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"
    102135#ifdef HAVE_RATGRING
    103136#include <kernel/ratgring.h>
     
    108141/* #include "WinDllTest.h" */
    109142#ifdef HAVE_DL
    110 #include <Singular/mod_raw.h>
     143#include <polys/mod_raw.h>
    111144#endif
    112145#endif
    113146
    114 // for tests of t-rep-GB
    115 #include <kernel/tgb.h>
    116147
    117148// Define to enable many more system commands
     
    123154#ifdef HAVE_FACTORY
    124155#define SI_DONT_HAVE_GLOBAL_VARS
     156
     157////// #include <libfac/factor.h> //////?????
     158
    125159#include <polys/clapconv.h>
    126160#include <kernel/kstdfac.h>
    127 #include <libfac/factor.h>
    128161#endif
     162
    129163#include <polys/clapsing.h>
    130164
    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 
    139165#ifdef HAVE_EIGENVAL
    140 #include <Singular/eigenval_ip.h>
     166#include "eigenval_ip.h"
    141167#endif
    142168
    143169#ifdef HAVE_GMS
    144 #include <Singular/gms.h>
     170#include "gms.h"
    145171#endif
    146172
     
    154180
    155181#ifdef HAVE_PCV
    156 #include <Singular/pcv.h>
     182#include "pcv.h"
    157183#endif
    158184
     
    196222      {
    197223        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);
    200226      }
    201227      else
     
    299325
    300326/*==================== 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
    308336/*==================== sh ==================================*/
    309337    if(strcmp(sys_cmd,"sh")==0)
     
    627655          if ( h->next!=NULL && h->next->Typ()==INT_CMD )
    628656          {
    629             if ( !rField_is_long_C() )
     657            if ( !rField_is_long_C(currRing) )
    630658              {
    631659                Werror( "unsupported ground field!");
     
    655683      if(strcmp(sys_cmd,"getPrecDigits")==0)
    656684      {
    657         if ( !rField_is_long_C() && !rField_is_long_R() )
     685        if ( !rField_is_long_C(currRing) && !rField_is_long_R(currRing) )
    658686        {
    659687          Werror( "unsupported ground field!");
     
    679707          mpz_inp_str(m, f, 10);
    680708          fclose(f);
    681           number n = mpz2number(m);
     709          number n = n_Init(m, coeffs_BIGINT);
    682710          res->rtyp = BIGINT_CMD;
    683711          res->data = (void*)n;
     
    956984        {
    957985          res->rtyp=STRING_CMD;
    958           res->data=(void *)singclap_neworder((ideal)h->Data());
     986          res->data=(void *)singclap_neworder((ideal)h->Data(), currRing);
    959987          return FALSE;
    960988        }
     
    13361364          {
    13371365            poly p = (poly)IDDATA(w);
    1338             res->data = pOppose(Rop,p);
     1366            res->data = pOppose(Rop, p, currRing); // into CurrRing?
    13391367            res->rtyp = POLY_CMD;
    13401368            return FALSE;
     
    22952323                /* == now the work starts == */
    22962324
    2297                 short * iv=iv2array(v);
     2325                short * iv=iv2array(v, currRing);
    22982326                poly r=0;
    22992327                poly hp=ppJetW(f,n,iv);
    23002328                int s=MATCOLS(m);
    23012329                int j=0;
    2302                 matrix T=mpInitI(s,1,0);
     2330                matrix T=mp_InitI(s,1,0, currRing);
    23032331
    23042332                while (hp != NULL)
     
    23322360                }
    23332361
    2334                 matrix Temp=mpTransp((matrix) idVec2Ideal(r));
     2362                matrix Temp=mp_Transp((matrix) idVec2Ideal(r), currRing);
    23352363                matrix R=mpNew(MATCOLS((matrix) idVec2Ideal(f)),1);
    23362364                for (int k=1;k<=MATROWS(Temp);k++)
     
    25372565#endif
    25382566  /*==================== 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
    25502579  /*==================== isSqrFree =============================*/
    25512580  #ifdef HAVE_FACTORY
     
    25552584        {
    25562585          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);
    25582587          return FALSE;
    25592588        }
     
    27912820          matrix m = (matrix)h->Data();
    27922821          int n = m->rows();
    2793           unsigned long p = (unsigned long)currRing->ch;
     2822          unsigned long p = (unsigned long)n_GetChar(currRing->cf);
    27942823          if (n != m->cols())
    27952824          {
     
    28532882          int c=rChar(currRing);
    28542883          setCharacteristic( c,nfMinPoly[0], currRing->parameter[0][0] );
    2855           CanonicalForm F( convSingGFFactoryGF( (poly)h->Data() ) );
     2884          CanonicalForm F( convSingGFFactoryGF( (poly)h->Data(), currRing ) );
    28562885          res->rtyp=POLY_CMD;
    2857           res->data=convFactoryGFSingGF( F );
     2886          res->data=convFactoryGFSingGF( F, currRing );
    28582887          return FALSE;
    28592888        }
     
    34503479          return TRUE;
    34513480        }
    3452         if (!rField_is_Q())
     3481        if (!rField_is_Q(currRing))
    34533482        {
    34543483          WerrorS("coeff field must be Q");
     
    34593488        int sw_rat=isOn(SW_RATIONAL);
    34603489        On(SW_RATIONAL);
    3461         CanonicalForm F( convSingPClapP((poly)(h->Data())));
     3490        CanonicalForm F( convSingPClapP((poly)(h->Data()), currRing));
    34623491        B.bifac(F, 1);
    34633492        CFFList L=B.getFactors();
     
    34763505        new_ring->parameter=names;
    34773506        new_ring->extRing=alg_ring;
    3478         new_ring->ch=1;
     3507        new_ring->ch=1; // WTF!!??? :(
    34793508        rComplete(new_ring,TRUE);
    34803509        // set the mipo ===============================================
     
    35943623          if (h->Typ()==MATRIX_CMD)
    35953624          {
    3596             res->data=(char *)singntl_HNF((matrix)h->Data());
     3625            res->data=(char *)singntl_HNF((matrix)h->Data(), currRing);
    35973626            return FALSE;
    35983627          }
    35993628          else if (h->Typ()==INTMAT_CMD)
    36003629          {
    3601             res->data=(char *)singntl_HNF((intvec*)h->Data());
     3630            res->data=(char *)singntl_HNF((intvec*)h->Data(), currRing);
    36023631            return FALSE;
    36033632          }
     
    36143643          if (h->Typ()==MATRIX_CMD)
    36153644          {
    3616             res->data=(char *)singntl_LLL((matrix)h->Data());
     3645            res->data=(char *)singntl_LLL((matrix)h->Data(), currRing);
    36173646            return FALSE;
    36183647          }
    36193648          else if (h->Typ()==INTMAT_CMD)
    36203649          {
    3621             res->data=(char *)singntl_LLL((intvec*)h->Data());
     3650            res->data=(char *)singntl_LLL((intvec*)h->Data(), currRing);
    36223651            return FALSE;
    36233652          }
     
    36333662        if (h!=NULL && (h->Typ()== POLY_CMD) && ((h->next != NULL) && h->next->Typ() == STRING_CMD))
    36343663        {
    3635           CanonicalForm F= convSingPFactoryP((poly)(h->Data()));
     3664          CanonicalForm F= convSingPFactoryP((poly)(h->Data()), currRing);
    36363665          char *s=(char *)h->next->Data();
    36373666          double error= atof (s);
  • Singular/maps_ip.cc

    re63576 r95eb6d  
    213213poly pSubstPar(poly p, int par, poly image)
    214214{
    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);
    217217
    218218  int i;
    219219  poly pp;
    220   for(i=rPar(currRing);i>0;i--)
     220  for(i = rPar(currRing);i>0;i--)
    221221  {
    222222    if (i!=par)
  • Singular/misc_ip.cc

    re63576 r95eb6d  
    3434#include "silink.h"
    3535
    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:
     37static inline void number2mpz(number n, mpz_t m){ n_MPZ(m, n, coeffs_BIGINT); }
     38static inline number mpz2number(mpz_t m){ return n_Init(m, coeffs_BIGINT); }
    4539
    4640
  • libpolys/coeffs/modulop.h

    re63576 r95eb6d  
    2222#define NV_MAX_PRIME 32003
    2323
    24 extern int npGen;
     24// extern int npGen; // obsolete
    2525
    2626BOOLEAN npInitChar(coeffs r, void* p);
Note: See TracChangeset for help on using the changeset viewer.