Changeset 028192 in git


Ignore:
Timestamp:
Mar 31, 2011, 7:37:45 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
ccd3333fa9eb4f770c3cca33d5e125c9565938ec
Parents:
3f2fb2cdc5019bbfc97d4fa27121402be181a8a3
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-03-31 19:37:45+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:04:17+01:00
Message:
FIX: p_polys.cc, ring.cc (mostly NC-stuff + ideals/matrices/numbers)
Location:
libpolys
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    r3f2fb2 r028192  
    4242#endif
    4343
    44 // the access methods (part 1) (see also part2 below):
    45 //
    46 // the routines w.r.t. currRing:
    47 // (should only be used in the context of currRing, i.e. in the interpreter)
    48 #define nCopy(n)          n_Copy(n, currRing->cf)
    49 #define nDelete(n)        n_Delete(n, currRing->cf)
    50 #define nMult(n1, n2)     n_Mult(n1, n2, currRing->cf)
    51 #define nAdd(n1, n2)      n_Add(n1, n2, currRing->cf)
    52 #define nIsZero(n)        n_IsZero(n, currRing->cf)
    53 #define nEqual(n1, n2)    n_Equal(n1, n2, currRing->cf)
    54 #define nNeg(n)           n_Neg(n, currRing->cf)
    55 #define nSub(n1, n2)      n_Sub(n1, n2, currRing->cf)
    56 #define nGetChar()        nInternalChar(currRing->cf)
    57 #define nInit(i)          n_Init(i, currRing->cf)
    58 #define nIsOne(n)         n_IsOne(n, currRing->cf)
    59 #define nIsMOne(n)        n_IsMOne(n, currRing->cf)
    60 #define nGreaterZero(n)   n_GreaterZero(n, currRing->cf)
    61 #define nWrite(n)         n_Write(n,currRing->cf)
    62 #define nNormalize(n)     n_Normalize(n,currRing->cf)
    63 #define nGcd(a, b)        n_Gcd(a,b,currRing->cf)
    64 #define nIntDiv(a, b)     n_IntDiv(a,b,currRing->cf)
    65 #define nDiv(a, b)        n_Div(a,b,currRing->cf)
    66 #define nInvers(a)        n_Invers(a,currRing->cf)
    67 #define nExactDiv(a, b)   n_ExactDiv(a,b,currRing->cf)
    68 #define nTest(a)          n_Test(a,currRing->cf)
    69 
    70 #define nInpMult(a, b)    n_InpMult(a,b,currRing->cf)
    71 #define nPower(a, b, res) n_Power(a,b,res,currRing->cf)
    72 #define nSize(n)          n_Size(n,currRing->cf)
    73 #define nGetDenom(N)      n_GetDenom((N),currRing->cf)
    74 #define nGetNumerator(N)  n_GetNumerator((N),currRing->cf)
    75 
    76 #define nSetMap(R)        n_SetMap(R,currRing->cf)
     44
     45
     46
    7747
    7848struct n_Procs_s;
     
    404374{ return nInternalChar(r); }
    405375
    406 #endif
    407 
     376
     377
     378/*
     379// the access methods (part 1) (see also part2 below):
     380//
     381// the routines w.r.t. currRing:
     382// (should only be used in the context of currRing, i.e. in the interpreter)
     383#define nCopy(n)          n_Copy(n, currRing->cf)
     384#define nDelete(n)        n_Delete(n, currRing->cf)
     385#define nMult(n1, n2)     n_Mult(n1, n2, currRing->cf)
     386#define nAdd(n1, n2)      n_Add(n1, n2, currRing->cf)
     387#define nIsZero(n)        n_IsZero(n, currRing->cf)
     388#define nEqual(n1, n2)    n_Equal(n1, n2, currRing->cf)
     389#define nNeg(n)           n_Neg(n, currRing->cf)
     390#define nSub(n1, n2)      n_Sub(n1, n2, currRing->cf)
     391#define nGetChar()        nInternalChar(currRing->cf)
     392#define nInit(i)          n_Init(i, currRing->cf)
     393#define nIsOne(n)         n_IsOne(n, currRing->cf)
     394#define nIsMOne(n)        n_IsMOne(n, currRing->cf)
     395#define nGreaterZero(n)   n_GreaterZero(n, currRing->cf)
     396#define nWrite(n)         n_Write(n,currRing->cf)
     397#define nNormalize(n)     n_Normalize(n,currRing->cf)
     398#define nGcd(a, b)        n_Gcd(a,b,currRing->cf)
     399#define nIntDiv(a, b)     n_IntDiv(a,b,currRing->cf)
     400#define nDiv(a, b)        n_Div(a,b,currRing->cf)
     401#define nInvers(a)        n_Invers(a,currRing->cf)
     402#define nExactDiv(a, b)   n_ExactDiv(a,b,currRing->cf)
     403#define nTest(a)          n_Test(a,currRing->cf)
     404
     405#define nInpMult(a, b)    n_InpMult(a,b,currRing->cf)
     406#define nPower(a, b, res) n_Power(a,b,res,currRing->cf)
     407#define nSize(n)          n_Size(n,currRing->cf)
     408#define nGetDenom(N)      n_GetDenom((N),currRing->cf)
     409#define nGetNumerator(N)  n_GetNumerator((N),currRing->cf)
     410
     411#define nSetMap(R)        n_SetMap(R,currRing->cf)
     412*/
     413
     414#endif
     415
  • libpolys/polys/ideals.h

    r3f2fb2 r028192  
    88* ABSTRACT - all basic methods to manipulate ideals
    99*/
    10 #include <kernel/structs.h>
    11 #include <kernel/ring.h>
     10// #include <kernel/structs.h>
     11
     12#include <polys/monomials/ring.h>
    1213
    1314struct sip_sideal
     
    1819  int ncols;
    1920  #define IDELEMS(i) ((i)->ncols)
     21  #define MATCOLS(i) ((i)->ncols)
     22  #define MATROWS(i) ((i)->nrows)
     23  #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1]
     24   
    2025};
    2126
     
    2833};
    2934
     35class ip_smatrix;
     36typedef ip_smatrix *       matrix;
     37
    3038struct sideal_list;
    3139typedef struct sideal_list *      ideal_list;
     40
    3241struct sideal_list
    3342{
     
    5160
    5261/// delete an ideal
    53 #define idDelete(h) id_Delete(h, currRing)
     62// #define idDelete(h) id_Delete(h, currRing)
    5463void id_Delete (ideal* h, ring r);
    5564void id_ShallowDelete (ideal* h, ring r);
     
    92101
    93102ideal id_Copy (ideal h1,const ring r);
    94 #define idCopy(A) id_Copy(A,currRing)
     103#ifdef PDEBUG
     104ideal idDBCopy(ideal h1,const char *f,int l,const ring r);
     105#define id_DBCopy(A,r) idDBCopy(A,__FILE__,__LINE__,r)
     106#define idCopy(A,r) id_DBCopy(A,r)
     107#else
     108#define idCopy(A,r) id_Copy(A,r)
     109#endif
     110
     111
    95112  /*adds two ideals without simplifying the result*/
    96113ideal idSimpleAdd (ideal h1,ideal h2);
     
    109126
    110127long idRankFreeModule(ideal m, ring lmRing, ring tailRing);
    111 inline long idRankFreeModule(ideal m, ring r = currRing)
    112 {return idRankFreeModule(m, r, r);}
     128
     129static inline long idRankFreeModule(ideal m, ring r){ return idRankFreeModule(m, r, r); }
     130
    113131// returns TRUE, if idRankFreeModule(m) > 0
    114 BOOLEAN idIsModule(ideal m, ring r = currRing);
     132BOOLEAN idIsModule(ideal m, const ring r);
    115133BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
    116134BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
     
    195213ideal   idTransp(ideal a);
    196214// version of "ideal idTransp(ideal)" which works within a given ring.
    197 ideal id_Transp(ideal a, const ring rRing = currRing);
     215ideal id_Transp(ideal a, const ring rRing);
    198216
    199217intvec *idQHomWeight(ideal id);
     
    209227ideal idFarey(ideal x, number N);
    210228
    211 ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing = currRing); // image of certain map for BGG
     229ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
    212230
    213231#ifdef PDEBUG
    214232/* Shows an ideal -- only for debugging */
    215 void idShow(const ideal id, const ring lmRing = currRing, const ring tailRing = currRing, const int debugPrint = 0);
     233void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint = 0);
    216234#else
    217235#define idShow(id, lmRing, tailRing, debugPrint) ((void)0)
  • libpolys/polys/matpol.h

    r3f2fb2 r028192  
    88* ABSTRACT
    99*/
    10 #include <kernel/structs.h>
    11 #include <kernel/ring.h>
     10
     11// #include <kernel/structs.h>
     12#include <polys/monomials/ring.h>
    1213
    1314// THIS IS REALLY DIRTY: ip_smatrix HAS TO BE IDENTICAL TO ip_sideal
     
    3233matrix mpNew(int r, int c);
    3334matrix mpCopy(matrix a);
    34 void   mpDelete(matrix* a, const ring r = currRing);
    35 matrix mpCopy(const matrix a, const ring rSrc, const ring rDst = currRing);
     35void   mpDelete(matrix* a, const ring r);
     36matrix mpCopy(const matrix a, const ring rSrc, const ring rDst);
    3637matrix mpInitP(int r, int c, poly p);
    3738matrix mpInitI(int r, int c, int v);
     
    4950poly mpDet (matrix m);
    5051matrix mpWedge(matrix a, int ar);
    51 BOOLEAN mpJacobi(leftv res,leftv a);
    52 BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL);
     52// BOOLEAN mpJacobi(leftv res,leftv a);
     53// BOOLEAN mpKoszul(leftv res,leftv b/*in*/, leftv c/*ip*/, leftv id=NULL);
    5354poly mpDetBareiss (matrix a);
    5455
  • libpolys/polys/monomials/maps.cc

    r3f2fb2 r028192  
    77*/
    88
     9#include <omalloc/omalloc.h>
    910#include <misc/options.h>
    10 #include <monomials/p_polys.h>
     11
    1112#include <coeffs/coeffs.h>
    1213#include <coeffs/numbers.h>
    13 #include <monomials/ring.h>
    14 #include <simpleideals.h>
    15 #include <omalloc/omalloc.h>
     14
     15#include <polys/monomials/p_polys.h>
     16#include <polys/monomials/ring.h>
     17#include <polys/simpleideals.h>
    1618#include <polys/prCopy.h>
    17 #include <polys/ext_fields/longtrans.h>
     19// #include <polys/ext_fields/longtrans.h>
    1820#include <polys/monomials/maps.h>
    1921
    2022#ifdef HAVE_PLURAL
    21 #include <kernel/gring.h>
     23#include <polys/nc/nc.h>
    2224#endif
    2325
  • libpolys/polys/monomials/p_polys.cc

    r3f2fb2 r028192  
    2121
    2222#include <polys/weight.h>
     23#include <polys/ideals.h>
    2324
    2425#include <polys/monomials/ring.h>
  • libpolys/polys/monomials/p_polys.h

    r3f2fb2 r028192  
    7474 *
    7575 ***************************************************************/
     76
     77poly p_One(const ring r);
     78
    7679int p_MinDeg(poly p,intvec *w, const ring R);
    7780
  • libpolys/polys/monomials/ring.cc

    r3f2fb2 r028192  
    3030// #include "../Singular/ipshell.h"
    3131#include <polys/templates/p_Procs.h>
     32
     33#include <polys/matpol.h>
     34#include <polys/ideals.h>
     35
    3236#ifdef HAVE_PLURAL
    33 // #include <gring.h>
    34 // #include <sca.h>
     37#include <polys/nc/nc.h>
     38#include <polys/nc/sca.h>
    3539#endif
    3640// #include <???/maps.h>
     
    405409      for (j = i+1; j<=r->N; j++)
    406410      {
    407         nl = nIsOne(p_GetCoeff(MATELEM(r->GetNC()->C,i,j),r->GetNC()->basering));
     411        nl = n_IsOne(p_GetCoeff(MATELEM(r->GetNC()->C,i,j),r->GetNC()->basering), r->cf);
    408412        if ( (MATELEM(r->GetNC()->D,i,j)!=NULL) || (!nl) )
    409413        {
     
    14321436        {
    14331437          assume(MATELEM(C1,i,j) != NULL);
    1434           MATELEM(C,i,j) = pPermPoly(MATELEM(C1,i,j), perm1, R1, sum, nMap1, par_perm1, rPar(R1)); // need ADD + CMP ops.
     1438          MATELEM(C,i,j) = p_PermPoly(MATELEM(C1,i,j), perm1, R1, sum, nMap1, par_perm1, rPar(R1)); // need ADD + CMP ops.
    14351439
    14361440          if (MATELEM(D1,i,j) != NULL)
    1437             MATELEM(D,i,j) = pPermPoly(MATELEM(D1,i,j), perm1, R1, sum, nMap1, par_perm1, rPar(R1));
     1441            MATELEM(D,i,j) = p_PermPoly(MATELEM(D1,i,j), perm1, R1, sum, nMap1, par_perm1, rPar(R1));
    14381442        }
    14391443
     
    14481452        {
    14491453          assume(MATELEM(C2,i,j) != NULL);
    1450           MATELEM(C,rVar(R1)+i,rVar(R1)+j) = pPermPoly(MATELEM(C2,i,j),perm2,R2,nMap2,par_perm2,rPar(R2));
     1454          MATELEM(C,rVar(R1)+i,rVar(R1)+j) = p_PermPoly(MATELEM(C2,i,j),perm2,R2,sum, nMap2,par_perm2,rPar(R2));
    14511455
    14521456          if (MATELEM(D2,i,j) != NULL)
    1453             MATELEM(D,rVar(R1)+i,rVar(R1)+j) = pPermPoly(MATELEM(D2,i,j),perm2,R2,nMap2,par_perm2,rPar(R2));
     1457            MATELEM(D,rVar(R1)+i,rVar(R1)+j) = p_PermPoly(MATELEM(D2,i,j),perm2,R2,sum, nMap2,par_perm2,rPar(R2));
    14541458        }
    14551459
     
    42164220   
    42174221    pFDeg_CASE(p_Totaldegree); else
    4218       pFDeg_CASE(pWFirstTotalDegree); else
    4219       pFDeg_CASE(pWTotaldegree); else
    4220       pFDeg_CASE(pDeg); else
     4222      pFDeg_CASE(p_WFirstTotalDegree); else
     4223      pFDeg_CASE(p_WTotaldegree); else
     4224      pFDeg_CASE(p_Deg); else
    42214225      Print("(%p)", r->pFDeg); // default case
    42224226   
     
    49064910/// Finds p^th IS ordering, and returns its position in r->typ[]
    49074911/// returns -1 if something went wrong!
    4908 int rGetISPos(const int p = 0, const ring r = currRing)
     4912int rGetISPos(const int p, const ring r)
    49094913{
    49104914  // Put the reference set F into the ring -ordering -recor
     
    54825486
    54835487        assume(MATELEM(src->GetNC()->C,i,j) != NULL);
    5484         MATELEM(C,nj,ni) = pPermPoly(MATELEM(src->GetNC()->C,i,j),perm,src,nMap,par_perm,src->P);
     5488        MATELEM(C,nj,ni) = p_PermPoly(MATELEM(src->GetNC()->C,i,j),perm,src,r, nMap,par_perm,src->P);
    54855489
    54865490        if(MATELEM(src->GetNC()->D,i,j) != NULL)
    5487           MATELEM(D,nj,ni) = pPermPoly(MATELEM(src->GetNC()->D,i,j),perm,src,nMap,par_perm,src->P);
     5491          MATELEM(D,nj,ni) = p_PermPoly(MATELEM(src->GetNC()->D,i,j),perm,src,r, nMap,par_perm,src->P);
    54885492      }
    54895493    }
  • libpolys/polys/monomials/ring.h

    r3f2fb2 r028192  
    3434typedef kBucket*           kBucket_pt;
    3535
     36struct sip_sideal;
     37typedef struct sip_sideal *       ideal;
     38
     39struct sip_smap;
     40typedef struct sip_smap *         map;
     41
     42
    3643#if SIZEOF_LONG == 4
    3744typedef long long int64;
     
    4855typedef void     (*p_SetmProc)(poly p, const ring r);
    4956
    50 struct sip_sideal
    51 {
    52   poly*  m;
    53   long rank;
    54   int nrows;
    55   int ncols;
    56   #define IDELEMS(i) ((i)->ncols)
    57   #define MATCOLS(i) ((i)->ncols)
    58   #define MATROWS(i) ((i)->nrows)
    59   #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1]
    60 };
    61 typedef struct sip_sideal *       ideal;
    62 
    63 struct sip_smap
    64 {
    65   poly *m;
    66   char *preimage;
    67   int nrows;
    68   int ncols;
    69 };
    70 typedef struct sip_smap *         map;
     57
    7158
    7259typedef enum
     
    325312    inline nc_struct*& GetNC() { return _nc; }; // public!!!
    326313#endif
     314 public:
     315  operator coeffs() const { return cf; }
    327316};
    328317
  • libpolys/polys/nc/gring.h

    r3f2fb2 r028192  
    1616#include <kernel/matpol.h>
    1717
    18 // the part, related to the interface
    19 // Changes r, Assumes that all other input belongs to curr
    20 BOOLEAN nc_CallPlural(matrix cc, matrix dd, poly cn, poly dn, ring r,
    21                       bool bSetupQuotient = false,
    22                       bool bCopyInput = true,
    23                       bool bBeQuiet = false,
    24                       ring curr = currRing,
    25                       bool dummy_ring = false
    26                       /* allow to create a nc-ring with 1 variable*/);
    27 
    2818// BOOLEAN nc_CheckOrdCondition(matrix D, ring r);
    2919// BOOLEAN nc_CheckOrdCondition(ring r); // with D == r->GetNC()->D
     
    4131// this should be used by p_ProcsSet in p_Procs_Set.h
    4232void nc_p_ProcsSet(ring rGR, p_Procs_s* p_Procs);
    43 
    44 // this function should be used inside QRing definition!
    45 // we go from rG into factor ring rGR with factor ideal rGR->qideal.
    46 bool nc_SetupQuotient(ring rGR, const ring rG = NULL, bool bCopy = false); // rG == NULL means that there is no base G-algebra
    4733
    4834
     
    5238ring nc_rCreateNCcomm(ring r);
    5339
    54 void nc_rKill(ring r); // complete destructor
    55 
    56 BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient = true); // in ring.cc
    57 
    58 bool nc_rCopy(ring res, const ring r, bool bSetupQuotient);
    59 
    6040
    6141// poly _gnc_p_Mult_q(poly p, poly q, const int copy, const ring r);
     
    6545poly _nc_pp_Mult_qq(const poly p, const poly q, const ring r);
    6646
    67 
    68 /* subst: */
    69 poly nc_pSubst(poly p, int n, poly e);
    7047
    7148/* copy : */
     
    9370
    9471poly p_CopyEmbed(poly p, ring srcRing, int shift, int par_shift);
    95 poly pOppose(ring Rop, poly p);
    96 ideal idOppose(ring Rop, ideal I);
    9772
    9873
     
    243218
    244219
    245 // Macros used to access upper triangle matrices C,D... (which are actually ideals) // afaik
    246 #define UPMATELEM(i,j,nVar) ( (nVar * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1)-(i) )
    247220
    248221
  • libpolys/polys/nc/nc.h

    r3f2fb2 r028192  
    3737// //////////////////////////////////////////////////////
    3838
     39// Macros used to access upper triangle matrices C,D... (which are actually ideals) // afaik
     40#define UPMATELEM(i,j,nVar) ( (nVar * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1)-(i) )
     41
     42/// complete destructor
     43void nc_rKill(ring r);
    3944
    4045
     
    303308
    304309
     310// the part, related to the interface
     311// Changes r, Assumes that all other input belongs to curr
     312BOOLEAN nc_CallPlural(matrix cc, matrix dd, poly cn, poly dn, ring r,
     313                      bool bSetupQuotient, //< false
     314                      bool bCopyInput, //< true
     315                      bool bBeQuiet, //< false
     316                      ring curr,
     317                      bool dummy_ring = false
     318                      /* allow to create a nc-ring with 1 variable*/);
     319
     320
     321BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient = true); // in ring.cc
     322
     323// this function should be used inside QRing definition!
     324// we go from rG into factor ring rGR with factor ideal rGR->qideal.
     325bool nc_SetupQuotient(ring rGR, const ring rG = NULL, bool bCopy = false); // rG == NULL means that there is no base G-algebra
     326
     327
     328bool nc_rCopy(ring res, const ring r, bool bSetupQuotient);
     329
     330poly pOppose(ring Rop_src, poly p, const ring Rop_dst);
     331ideal idOppose(ring Rop_src, ideal I, const ring Rop_dst);
     332
    305333#endif /* HAVE_PLURAL */
    306334
  • libpolys/polys/pInline0.h

    r3f2fb2 r028192  
    2121#include <polys/monomials/ring.h>
    2222
    23 /***************************************************************
    24  *
    25  * poly things which are independent of ring
    26  *
    27  ***************************************************************/
    28 
    29 
    30 /*2
    31 * returns the length of a (numbers of monomials)
    32 * respect syzComp
    33 */
    34 poly pLast(poly a, int &l);
    3523
    3624#endif // PINLINE_CC
Note: See TracChangeset for help on using the changeset viewer.