Changeset 0917a96 in git


Ignore:
Timestamp:
Feb 22, 2012, 8:36:43 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
227b7e3065d77cffc07256095d57a99efcf9d4a3
Parents:
860bce8d6f180df9bfb84d6dcde47a7e75486741
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-22 20:36:43+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-23 20:35:10+01:00
Message:
adaptation of dyn_modules/syzextra for spielwiese

fix: fixed dyn_modules/syzextra to work with spielwiese
chg: use n_Init for long -> bigint conversion
NOTE: the resulting bigint may be negative for (implicitly) casted unsigned longs (e.g. for raw poly/vector exponents)
chg: further minor adaptations
Location:
dyn_modules/syzextra
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/syzextra/DebugPrint.cc

    r860bce r0917a96  
    2222
    2323#include <omalloc/omalloc.h>
     24#include <polys/monomials/p_polys.h>
     25
    2426#include <kernel/febase.h>
    25 #include <kernel/p_polys.h>
    2627#include <kernel/ideals.h>
    2728
     
    8788  {
    8889    Print("Module of rank %ld,real rank %ld and %d generators.\n",
    89           id->rank,idRankFreeModule(id, lmRing, tailRing),IDELEMS(id));
     90          id->rank,id_RankFreeModule(id, lmRing, tailRing),IDELEMS(id));
    9091
    9192    int j = (id->ncols*id->nrows) - 1;
  • dyn_modules/syzextra/DebugPrint.h

    r860bce r0917a96  
    2121// include basic definitions
    2222#include "singularxx_defs.h"
    23 #include <kernel/ring.h>
     23#include <kernel/polys.h>
    2424
    2525BEGIN_NAMESPACE_SINGULARXX    BEGIN_NAMESPACE(DEBUG)
     26
     27
    2628
    2729/// debug-print at most nTerms (2 by default) terms from poly/vector p,
  • dyn_modules/syzextra/mod_main.cc

    r860bce r0917a96  
    33#include <omalloc/omalloc.h>
    44
     5#include <misc/intvec.h>
     6
     7#include <coeffs/coeffs.h>
     8
     9#include <polys/monomials/p_polys.h>
     10#include <polys/monomials/ring.h>
     11// #include <kernel/longrat.h>
     12#include <kernel/kstd1.h>
     13
     14#include <kernel/polys.h>
     15
    516#include <kernel/syz.h>
    6 #include <kernel/intvec.h>
    7 #include <kernel/p_polys.h>
    8 #include <kernel/longrat.h>
    9 #include <kernel/kstd1.h>
    10 
    11 #include <kernel/polys.h>
    1217
    1318#include <Singular/tok.h>
     
    1621#include <Singular/attrib.h>
    1722
     23#include <Singular/ipid.h>
     24// extern coeffs coeffs_BIGINT
     25
    1826#include "singularxx_defs.h"
    1927#include "DebugPrint.h"
    2028#include "myNF.h"
    2129
    22 
    23 
    24 extern void rSetISReference(const ideal F, const int rank, const int p, const intvec * componentWeights, const ring r);
     30extern BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p, const intvec * componentWeights);
     31
     32// extern void rSetISReference(const ideal F, const int rank, const int p, const intvec * componentWeights, const ring r);
    2533extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r);
    26 extern ring rCurrRingAssure_SyzComp();
     34// extern ring rCurrRingAssure_SyzComp();
    2735extern ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sign);
    2836extern int rGetISPos(const int p, const ring r);
     
    6371
    6472
    65 
    6673static inline number jjLONG2N(long d)
    6774{
    68 #if SIZEOF_LONG == 8
    69   int i=(int)d;
    70   if ((long)i == d)
    71     return nlInit(i, NULL);
    72   else
    73   {
    74 # if !defined(OM_NDEBUG) && !defined(NDEBUG)
    75     omCheckBin(rnumber_bin);
    76 # endif
    77     number z=(number)omAllocBin(rnumber_bin);
    78 # if defined(LDEBUG)
    79     z->debug=123456;
    80 # endif
    81     z->s=3;
    82     mpz_init_set_si(z->z,d);
    83     return z;
    84   }
    85 #else
    86   return nlInit((int)d, NULL);
    87 #endif
     75  return n_Init(d, coeffs_BIGINT);
    8876}
    8977
     
    223211  { \
    224212    /* const ring rrr = (iLevel > 0) ? save : save; */ \
    225     Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*idRankFreeModule(((s)->v)[iLevel], rrr)*/ ); \
     213    Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \
    226214    PrintLn(); \
    227215  } \
     
    232220    PRINT_RESOLUTION(syzstr, fullres);
    233221
    234     assume (idRankFreeModule (syzstr->res[1], rr) == syzstr->res[1]->rank);
     222    assume (id_RankFreeModule (syzstr->res[1], rr) == syzstr->res[1]->rank);
    235223
    236224    PRINT_RESOLUTION(syzstr, res);
     
    426414
    427415  //    res->data = rCurrRingAssure_SyzComp(); // changes current ring! :(
    428   res->data = reinterpret_cast<void *>(rCurrRingAssure_SyzComp());
     416  res->data = reinterpret_cast<void *>(rAssure_SyzComp(currRing, TRUE));
    429417  res->rtyp = RING_CMD; // return new ring!
    430418  // QRING_CMD?
     
    482470    const int iSyzComp = (int)reinterpret_cast<long>(h->Data());
    483471    assume( iSyzComp > 0 );
    484     rSetSyzComp( iSyzComp );
     472    rSetSyzComp(iSyzComp, currRing);
    485473  }
    486474
     
    530518
    531519    //          Print("before: %d\n", FF->nrows);
    532     //          FF->nrows = idRankFreeModule(FF, r); // ???
     520    //          FF->nrows = id_RankFreeModule(FF, r); // ???
    533521    //          Print("after: %d\n", FF->nrows);
    534522  }
     
    572560    assume(rank >= 0);
    573561  } else
    574     rank = idRankFreeModule(F, r); // Starting syz-comp (1st: i+1)
     562    rank = id_RankFreeModule(F, r); // Starting syz-comp (1st: i+1)
    575563
    576564  int p = 0; // which IS-block? p^th!
     
    593581
    594582  // F & componentWeights belong to that ordering block of currRing now:
    595   rSetISReference(F, rank, p, componentWeights, r); // F and componentWeights will be copied!
     583  rSetISReference(r, F, rank, p, componentWeights); // F and componentWeights will be copied!
    596584  return FALSE;
    597585}
     
    712700      iComp = rGetCurrSyzLimit(r);
    713701    else
    714       iComp = idRankFreeModule(r->typ[posIS].data.is.F, r); // ;
     702      iComp = id_RankFreeModule(r->typ[posIS].data.is.F, r); // ;
    715703  }
    716704
  • dyn_modules/syzextra/myNF.cc

    r860bce r0917a96  
    1919#include <kernel/mod2.h>
    2020
    21 #include "myNF.h"
    2221
    2322#include <omalloc/omalloc.h>
     23
     24#include <misc/intvec.h>
     25
     26#include <misc/options.h>
     27
     28#include <polys/monomials/p_polys.h>
     29#include <polys/kbuckets.h>
     30
     31
    2432#include <kernel/structs.h>
    2533#include <kernel/febase.h>
     
    3038
    3139#include <kernel/syz.h>
    32 #include <kernel/longrat.h>
     40// #include <kernel/longrat.h>
    3341#include <kernel/kutil.h>
    3442#include <kernel/kstd1.h>
    35 #include <kernel/options.h>
    36 
    37 #include <kernel/kbuckets.h>
    38 
    39 #include <kernel/intvec.h>
    40 #include <kernel/p_polys.h>
     43
     44
     45
    4146#include <kernel/polys.h>
    42 #include <kernel/pInline2.h>
     47// #include <kernel/pInline2.h>
     48
     49#include "myNF.h"
    4350
    4451
     
    4653#define PLURAL_INTERNAL_DECLARATIONS 1
    4754#endif
    48 #include <kernel/gring.h>
    49 #include <kernel/sca.h>
     55
     56#include <polys/nc/sca.h>
     57#include <polys/nc/nc.h>
     58#include <kernel/nc.h>
    5059
    5160
     
    214223  //if ((idIs0(F))&&(Q==NULL))
    215224  //  return pCopy(q); /*F=0*/
    216   //strat->ak = idRankFreeModule(F);
     225  //strat->ak = id_RankFreeModule(F, RING!);
    217226  /*- creating temp data structures------------------- -*/
    218227  BITSET save_test=test;
     
    245254    if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
    246255#ifdef HAVE_RINGS
    247     if (rField_is_Ring())
     256    if (rField_is_Ring(currRing))
    248257    {
    249258      p = redtailBba_Z(p,max_ind,strat);
     
    309318  kStrategy strat=new skStrategy;
    310319  strat->syzComp = syzComp;
    311   strat->ak = si_max(idRankFreeModule(F),pMaxComp(p));
     320  strat->ak = si_max(id_RankFreeModule(F, currRing),pMaxComp(p));
    312321  poly res;
    313322
    314   if (pOrdSgn==-1)
     323  if (rHasLocalOrMixedOrdering(currRing)==-1)
    315324    res=kNF1(F,Q,pp,strat,lazyReduce);
    316325  else
  • dyn_modules/syzextra/myNF.h

    r860bce r0917a96  
    2121// include basic definitions
    2222#include "singularxx_defs.h"
    23 #include <kernel/ring.h>
    24 #include <kernel/ideals.h>
     23
     24struct  spolyrec;
     25typedef struct spolyrec    polyrec;
     26typedef polyrec *          poly;
     27
     28struct ip_sring;
     29typedef struct ip_sring *         ring;
     30
     31struct sip_sideal;
     32typedef struct sip_sideal *       ideal;
    2533
    2634BEGIN_NAMESPACE_SINGULARXX    BEGIN_NAMESPACE(NF)
  • dyn_modules/syzextra/noro.sing

    r860bce r0917a96  
    673673number t = (ttN - tN);
    674674number tt = ((ttS - tS) + (ttG - tG));
    675 "Factor: ", t / tt;
    676 "Factor: ", (ttN - tN) / ((ttS - tS) + (ttG - tG));
     675"Factor: ", t div tt;
     676"Factor: ", (ttN - tN) div ((ttS - tS) + (ttG - tG));
    677677
    678678
  • dyn_modules/syzextra/syzextra.tst

    r860bce r0917a96  
    3030
    3131vector v =3 *xyz * [0, 0, 1, x, y, z];
    32 
    3332v;
    3433DetailedPrint(v, 2);
    3534
    36 leadmonom(v);
    37 leadcomp(v);
     35leadmonom(v);leadcomp(v);
    3836leadrawexp(v);
    3937
Note: See TracChangeset for help on using the changeset viewer.