Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
nc.h File Reference
#include <polys/monomials/ring.h>
#include <polys/kbuckets.h>
#include <polys/matpol.h>

Go to the source code of this file.

Data Structures

struct  nc_pProcs
 
struct  nc_struct
 

Macros

#define UPMATELEM(i, j, nVar)   ( (nVar * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1)-(i) )
 

Typedefs

typedef ip_smatrixmatrix
 
typedef poly(* mm_Mult_p_Proc_Ptr) (const poly m, poly p, const ring r)
 
typedef poly(* mm_Mult_pp_Proc_Ptr) (const poly m, const poly p, const ring r)
 
typedef poly(* SPoly_Proc_Ptr) (const poly p1, const poly p2, const ring r)
 
typedef poly(* SPolyReduce_Proc_Ptr) (const poly p1, poly p2, const ring r)
 
typedef void(* bucket_Proc_Ptr) (kBucket_pt b, poly p, number *c)
 

Enumerations

enum  nc_type {
  nc_error = -1, nc_general = 0, nc_skew, nc_comm,
  nc_lie, nc_undef, nc_exterior
}
 

Functions

matrix nc_PrintMat (int a, int b, ring r, int metric)
 returns matrix with the info on noncomm multiplication More...
 
BOOLEAN rIsLikeOpposite (ring rBase, ring rCandidate)
 checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so More...
 
void nc_rKill (ring r)
 complete destructor More...
 
BOOLEAN nc_CheckSubalgebra (poly PolyVar, ring r)
 
static nc_struct *& GetNC (ring r)
 
static nc_typencRingType (nc_struct *p)
 
static nc_type ncRingType (ring r)
 
static void ncRingType (ring r, nc_type t)
 
static void ncRingType (nc_struct *p, nc_type t)
 
static bool rIsSCA (const ring r)
 
poly _nc_p_Mult_q (poly p, poly q, const ring r)
 general NC-multiplication with destruction More...
 
poly _nc_pp_Mult_qq (const poly p, const poly q, const ring r)
 general NC-multiplication without destruction More...
 
poly nc_p_Minus_mm_Mult_qq (poly p, const poly m, const poly q, int &lp, const poly, const ring r)
 for p_Minus_mm_Mult_qq in pInline2.h More...
 
poly nc_p_Plus_mm_Mult_qq (poly p, const poly m, const poly q, int &lp, const int, const ring r)
 
static poly nc_mm_Mult_pp (const poly m, const poly p, const ring r)
 
static poly nc_mm_Mult_p (const poly m, poly p, const ring r)
 
static poly nc_CreateSpoly (const poly p1, const poly p2, const ring r)
 
poly nc_CreateShortSpoly (poly p1, poly p2, const ring r)
 
poly nc_p_Bracket_qq (poly p, const poly q, const ring r)
 returns [p,q], destroys p More...
 
static poly nc_ReduceSpoly (const poly p1, poly p2, const ring r)
 
void nc_PolyPolyRed (poly &b, poly p, number *c, const ring r)
 
static void nc_kBucketPolyRed (kBucket_pt b, poly p, number *c)
 
static void nc_BucketPolyRed_Z (kBucket_pt b, poly p, number *c)
 
poly nc_pSubst (poly p, int n, poly e, const ring r)
 substitute the n-th variable by e in p destroy p e is not a constant More...
 
BOOLEAN nc_CallPlural (matrix cc, matrix dd, poly cn, poly dn, ring r, bool bSetupQuotient, bool bCopyInput, bool bBeQuiet, ring curr, bool dummy_ring=false)
 returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type, DO NOT initialize multiplication but call for it at the end checks the ordering condition and evtl. NDC NOTE: all the data belong to the curr, we change r which may be the same ring, and must have the same representation! More...
 
bool nc_SetupQuotient (ring rGR, const ring rG=NULL, bool bCopy=false)
 
BOOLEAN nc_rComplete (const ring src, ring dest, bool bSetupQuotient=true)
 
bool nc_rCopy (ring res, const ring r, bool bSetupQuotient)
 
poly pOppose (ring Rop_src, poly p, const ring Rop_dst)
 opposes a vector p from Rop to currRing (dst!) More...
 
ideal idOppose (ring Rop_src, ideal I, const ring Rop_dst)
 opposes a module I from Rop to currRing(dst) More...
 
poly p_Lcm (const poly a, const poly b, const long lCompM, const ring r)
 
poly p_Lcm (const poly a, const poly b, const ring r)
 
intgetNCExtensions ()
 
int setNCExtensions (int iMask)
 
bool ncExtensions (int iMask)
 
void nc_p_ProcsSet (ring rGR, p_Procs_s *p_Procs)
 
static poly GetC (const ring r, int i, int j)
 
static poly GetD (const ring r, int i, int j)
 

Variables

const int GENERICMASK = 0x000
 
const int SCAMASK = 0x001
 
const int NOPLURALMASK = 0x002
 
const int NOFORMULAMASK =0x004
 
const int NOCACHEMASK = 0x008
 
const int TESTSYZSCAMASK = 0x0100 | SCAMASK
 

Data Structure Documentation

struct nc_pProcs

Definition at line 63 of file nc.h.

Data Fields
bucket_Proc_Ptr BucketPolyRed
bucket_Proc_Ptr BucketPolyRed_Z
void * GB From "gb_hack.h".
mm_Mult_p_Proc_Ptr mm_Mult_p
mm_Mult_pp_Proc_Ptr mm_Mult_pp
SPolyReduce_Proc_Ptr ReduceSPoly
SPoly_Proc_Ptr SPoly

Macro Definition Documentation

#define UPMATELEM (   i,
  j,
  nVar 
)    ( (nVar * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1)-(i) )

Definition at line 44 of file nc.h.

Typedef Documentation

typedef void(* bucket_Proc_Ptr) (kBucket_pt b, poly p, number *c)

Definition at line 61 of file nc.h.

typedef ip_smatrix* matrix

Definition at line 13 of file nc.h.

typedef poly(* mm_Mult_p_Proc_Ptr) (const poly m, poly p, const ring r)

Definition at line 53 of file nc.h.

typedef poly(* mm_Mult_pp_Proc_Ptr) (const poly m, const poly p, const ring r)

Definition at line 54 of file nc.h.

typedef poly(* SPoly_Proc_Ptr) (const poly p1, const poly p2, const ring r)

Definition at line 58 of file nc.h.

typedef poly(* SPolyReduce_Proc_Ptr) (const poly p1, poly p2, const ring r)

Definition at line 59 of file nc.h.

Enumeration Type Documentation

enum nc_type
Enumerator
nc_error 
nc_general 
nc_skew 
nc_comm 
nc_lie 
nc_undef 
nc_exterior 

Definition at line 20 of file nc.h.

21 {
22  nc_error = -1, // Something's gone wrong!
23  nc_general = 0, /* yx=q xy+... */
24  nc_skew, /*1*/ /* yx=q xy */
25  nc_comm, /*2*/ /* yx= xy */
26  nc_lie, /*3*/ /* yx=xy+... */
27  nc_undef, /*4*/ /* for internal reasons */
28 
29  nc_exterior /*5*/ // Exterior Algebra(SCA): yx= -xy & (!:) x^2 = 0
30 };
Definition: nc.h:25
Definition: nc.h:22
Definition: nc.h:27
Definition: nc.h:24
Definition: nc.h:29
Definition: nc.h:23
Definition: nc.h:26

Function Documentation

poly _nc_p_Mult_q ( poly  p,
poly  q,
const ring  r 
)

general NC-multiplication with destruction

Definition at line 261 of file old.gring.cc.

262 {
263  assume( rIsPluralRing(rRing) );
264 #ifdef PDEBUG
265  p_Test(pPolyP, rRing);
266  p_Test(pPolyQ, rRing);
267 #endif
268 #ifdef RDEBUG
269  rTest(rRing);
270 #endif
271 
272  int lp, lq;
273 
274  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
275 
276  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
277 
278  CPolynomialSummator sum(rRing, bUsePolynomial);
279 
280  if (lq <= lp) // ?
281  {
282  // always length(q) times "p * q[j]"
283  for( ; pPolyQ!=NULL; pPolyQ = p_LmDeleteAndNext( pPolyQ, rRing ) )
284  sum += pp_Mult_mm( pPolyP, pPolyQ, rRing);
285 
286  p_Delete( &pPolyP, rRing );
287  } else
288  {
289  // always length(p) times "p[i] * q"
290  for( ; pPolyP!=NULL; pPolyP = p_LmDeleteAndNext( pPolyP, rRing ) )
291  sum += nc_mm_Mult_pp( pPolyP, pPolyQ, rRing);
292 
293  p_Delete( &pPolyQ, rRing );
294  }
295 
296  return(sum);
297 }
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:721
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:22
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:962
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
#define assume(x)
Definition: mod2.h:405
#define rTest(r)
Definition: ring.h:769
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min)
Definition: p_Mult_q.cc:27
#define p_Test(p, r)
Definition: p_polys.h:160
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
#define NULL
Definition: omList.c:10
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(...
Definition: summator.h:29
poly _nc_pp_Mult_qq ( const poly  p,
const poly  q,
const ring  r 
)

general NC-multiplication without destruction

Definition at line 300 of file old.gring.cc.

301 {
302  assume( rIsPluralRing(rRing) );
303 #ifdef PDEBUG
304  p_Test(pPolyP, rRing);
305  p_Test(pPolyQ, rRing);
306 #endif
307 #ifdef RDEBUG
308  rTest(rRing);
309 #endif
310 
311  int lp, lq;
312 
313  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
314 
315  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
316 
317  CPolynomialSummator sum(rRing, bUsePolynomial);
318 
319  if (lq <= lp) // ?
320  {
321  // always length(q) times "p * q[j]"
322  for( poly q = pPolyQ; q !=NULL; q = pNext(q) )
323  sum += pp_Mult_mm(pPolyP, q, rRing);
324  } else
325  {
326  // always length(p) times "p[i] * q"
327  for( poly p = pPolyP; p !=NULL; p = pNext(p) )
328  sum += nc_mm_Mult_pp( p, pPolyQ, rRing);
329  }
330 
331  return(sum);
332 }
return P p
Definition: myNF.cc:203
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:22
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:962
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
#define rTest(r)
Definition: ring.h:769
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min)
Definition: p_Mult_q.cc:27
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(...
Definition: summator.h:29
static poly GetC ( const ring  r,
int  i,
int  j 
)
inlinestatic

Definition at line 397 of file nc.h.

398 {
399  assume(r!= NULL && rIsPluralRing(r));
400  const matrix C = GetNC(r)->C;
401  assume(C != NULL);
402  const int ncols = C->ncols;
403  assume( (i > 0) && (i < j) && (j <= ncols) );
404  return ( C->m[ncols * ((i)-1) + (j)-1] );
405 }
int ncols
Definition: matpol.h:22
static nc_struct *& GetNC(ring r)
Definition: nc.h:170
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int int ncols
Definition: cf_linsys.cc:32
matrix C
Definition: nc.h:91
static poly GetD ( const ring  r,
int  i,
int  j 
)
inlinestatic

Definition at line 408 of file nc.h.

409 {
410  assume(r!= NULL && rIsPluralRing(r));
411  const matrix D = GetNC(r)->D;
412  assume(D != NULL);
413  const int ncols = D->ncols;
414  assume( (i > 0) && (i < j) && (j <= ncols) );
415  return ( D->m[ncols * ((i)-1) + (j)-1] );
416 }
int ncols
Definition: matpol.h:22
static nc_struct *& GetNC(ring r)
Definition: nc.h:170
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
D(ideal gnc_gr_bba(const ideal, const ideal, const intvec *, const intvec *, kStrategy, const ring _currRing)) D(ideal gnc_gr_mora(const ideal
Modified Plural's Buchberger's algorithmus.
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
matrix D
Definition: nc.h:92
int int ncols
Definition: cf_linsys.cc:32
static nc_struct*& GetNC ( ring  r)
inlinestatic

Definition at line 170 of file nc.h.

171 {
172  return r->GetNC();
173 }
const ring r
Definition: syzextra.cc:208
int& getNCExtensions ( )

Definition at line 75 of file old.gring.cc.

76 {
77  return (iNCExtensions);
78 }
int iNCExtensions
Definition: old.gring.cc:73
ideal idOppose ( ring  Rop_src,
ideal  I,
const ring  Rop_dst 
)

opposes a module I from Rop to currRing(dst)

Definition at line 3453 of file old.gring.cc.

3454 {
3455  /* the simplest case:*/
3456  if ( Rop == dst ) return id_Copy(I, dst);
3457 
3458  /* check Rop == rOpposite(currRing) */
3459  if (!rIsLikeOpposite(dst, Rop))
3460  {
3461  WarnS("an opposite ring should be used");
3462  return NULL;
3463  }
3464  int i;
3465  ideal idOp = idInit(I->ncols, I->rank);
3466  for (i=0; i< (I->ncols)*(I->nrows); i++)
3467  {
3468  idOp->m[i] = pOppose(Rop,I->m[i], dst);
3469  }
3470  id_Test(idOp, dst);
3471  return idOp;
3472 }
ideal id_Copy(ideal h1, const ring r)
#define id_Test(A, lR)
Definition: simpleideals.h:67
poly pOppose(ring Rop, poly p, const ring dst)
opposes a vector p from Rop to currRing (dst!)
Definition: old.gring.cc:3414
const ideal
Definition: gb_hack.h:42
#define WarnS
Definition: emacs.cc:81
BOOLEAN rIsLikeOpposite(ring rBase, ring rCandidate)
checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so ...
Definition: old.gring.cc:3387
int i
Definition: cfEzgcd.cc:123
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
#define NULL
Definition: omList.c:10
static void nc_BucketPolyRed_Z ( kBucket_pt  b,
poly  p,
number *  c 
)
inlinestatic

Definition at line 303 of file nc.h.

304 {
305  const ring r = b->bucket_ring;
306  assume(rIsPluralRing(r));
307 
308 // return gnc_kBucketPolyRed_ZNew(b, p, c);
309 
310  assume(r->GetNC()->p_Procs.BucketPolyRed_Z!=NULL);
311  return r->GetNC()->p_Procs.BucketPolyRed_Z(b, p, c);
312 
313 }
return P p
Definition: myNF.cc:203
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
BOOLEAN nc_CallPlural ( matrix  cc,
matrix  dd,
poly  cn,
poly  dn,
ring  r,
bool  bSetupQuotient,
bool  bCopyInput,
bool  bBeQuiet,
ring  curr,
bool  dummy_ring = false 
)

returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type, DO NOT initialize multiplication but call for it at the end checks the ordering condition and evtl. NDC NOTE: all the data belong to the curr, we change r which may be the same ring, and must have the same representation!

Definition at line 2734 of file old.gring.cc.

2739 {
2740  assume( r != NULL );
2741  assume( curr != NULL );
2742 
2743  if( !bSetupQuotient)
2744  assume( (r->qideal == NULL) ); // The basering must NOT be a qring!??
2745 
2746  assume( rSamePolyRep(r, curr) || bCopyInput ); // wrong assumption?
2747 
2748 
2749  if( r->N == 1 ) // clearly commutative!!!
2750  {
2751  assume(
2752  ( (CCC != NULL) && (MATCOLS(CCC) == 1) && (MATROWS(CCC) == 1) && (MATELEM(CCC,1,1) == NULL) ) ||
2753  ( (CCN == NULL) )
2754  );
2755 
2756  assume(
2757  ( (DDD != NULL) && (MATCOLS(DDD) == 1) && (MATROWS(DDD) == 1) && (MATELEM(DDD,1,1) == NULL) ) ||
2758  ( (DDN == NULL) )
2759  );
2760  if(!dummy_ring)
2761  {
2762  WarnS("commutative ring with 1 variable");
2763  return FALSE;
2764  }
2765  }
2766 
2767  // there must be:
2768  assume( (CCC != NULL) != (CCN != NULL) ); // exactly one data about coeffs (C).
2769  assume( !((DDD != NULL) && (DDN != NULL)) ); // at most one data about tails (D).
2770 
2771 // ring save = currRing;
2772 // if( save != curr )
2773 // rChangeCurrRing(curr);
2774 
2775 
2776 #if OUTPUT
2777  if( CCC != NULL )
2778  {
2779  PrintS("nc_CallPlural(), Input data, CCC: \n");
2780  iiWriteMatrix(CCC, "C", 2, curr, 4);
2781  }
2782  if( DDD != NULL )
2783  {
2784  PrintS("nc_CallPlural(), Input data, DDD: \n");
2785  iiWriteMatrix(DDD, "D", 2, curr, 4);
2786  }
2787 #endif
2788 
2789 
2790 #ifndef SING_NDEBUG
2791  id_Test((ideal)CCC, curr);
2792  id_Test((ideal)DDD, curr);
2793  p_Test(CCN, curr);
2794  p_Test(DDN, curr);
2795 #endif
2796 
2797  if( (!bBeQuiet) && (r->GetNC() != NULL) )
2798  WarnS("going to redefine the algebra structure");
2799 
2800 // if( currRing != r )
2801 // rChangeCurrRing(r);
2802 
2803  matrix CC = NULL;
2804  poly CN = NULL;
2805  matrix C; bool bCnew = false;
2806 
2807  matrix DD = NULL;
2808  poly DN = NULL;
2809  matrix D; bool bDnew = false;
2810 
2811  number nN, pN, qN;
2812 
2813  bool IsSkewConstant = false, tmpIsSkewConstant;
2814  int i, j;
2815 
2816  nc_type nctype = nc_undef;
2817 
2818  //////////////////////////////////////////////////////////////////
2819  // check the correctness of arguments, without any real chagnes!!!
2820 
2821 
2822 
2823  // check C
2824  if ((CCC != NULL) && ( (MATCOLS(CCC)==1) || MATROWS(CCC)==1 ) )
2825  {
2826  CN = MATELEM(CCC,1,1);
2827  }
2828  else
2829  {
2830  if ((CCC != NULL) && ( (MATCOLS(CCC)!=r->N) || (MATROWS(CCC)!=r->N) ))
2831  {
2832  Werror("Square %d x %d matrix expected", r->N, r->N);
2833 
2834 // if( currRing != save )
2835 // rChangeCurrRing(save);
2836  return TRUE;
2837  }
2838  }
2839  if (( CCC != NULL) && (CC == NULL)) CC = CCC; // mp_Copy(CCC, ?); // bug!?
2840  if (( CCN != NULL) && (CN == NULL)) CN = CCN;
2841 
2842  // check D
2843  if ((DDD != NULL) && ( (MATCOLS(DDD)==1) || MATROWS(DDD)==1 ) )
2844  {
2845  DN = MATELEM(DDD,1,1);
2846  }
2847  else
2848  {
2849  if ((DDD != NULL) && ( (MATCOLS(DDD)!=r->N) || (MATROWS(DDD)!=r->N) ))
2850  {
2851  Werror("Square %d x %d matrix expected",r->N,r->N);
2852 
2853 // if( currRing != save )
2854 // rChangeCurrRing(save);
2855  return TRUE;
2856  }
2857  }
2858 
2859  if (( DDD != NULL) && (DD == NULL)) DD = DDD; // mp_Copy(DDD, ?); // ???
2860  if (( DDN != NULL) && (DN == NULL)) DN = DDN;
2861 
2862  // further checks and some analysis:
2863  // all data in 'curr'!
2864  if (CN != NULL) /* create matrix C = CN * Id */
2865  {
2866  if (!p_IsConstant(CN,curr))
2867  {
2868  Werror("Incorrect input : non-constants are not allowed as coefficients (first argument)");
2869  return TRUE;
2870  }
2871  assume(p_IsConstant(CN,curr));
2872 
2873  nN = p_GetCoeff(CN, curr);
2874  if (n_IsZero(nN, curr))
2875  {
2876  Werror("Incorrect input : zero coefficients are not allowed");
2877 
2878 // if( currRing != save )
2879 // rChangeCurrRing(save);
2880  return TRUE;
2881  }
2882 
2883  if (n_IsOne(nN, curr))
2884  nctype = nc_lie;
2885  else
2886  nctype = nc_general;
2887 
2888  IsSkewConstant = true;
2889 
2890  C = mpNew(r->N,r->N); // ring independent!
2891  bCnew = true;
2892 
2893  for(i=1; i<r->N; i++)
2894  for(j=i+1; j<=r->N; j++)
2895  MATELEM(C,i,j) = prCopyR_NoSort(CN, curr, r); // nc_p_CopyPut(CN, r); // copy CN from curr into r
2896 
2897 #ifndef SING_NDEBUG
2898  id_Test((ideal)C, r);
2899 #endif
2900 
2901  } else
2902  if ( (CN == NULL) && (CC != NULL) ) /* copy matrix C */
2903  {
2904  /* analyze C */
2905 
2906  pN = NULL; /* check the consistency later */
2907 
2908  if( r->N > 1 )
2909  if ( MATELEM(CC,1,2) != NULL )
2910  pN = p_GetCoeff(MATELEM(CC,1,2), curr);
2911 
2912  tmpIsSkewConstant = true;
2913 
2914  for(i=1; i<r->N; i++)
2915  for(j=i+1; j<=r->N; j++)
2916  {
2917  if (MATELEM(CC,i,j) == NULL)
2918  qN = NULL;
2919  else
2920  {
2921  if (!p_IsConstant(MATELEM(CC,i,j),curr))
2922  {
2923  Werror("Incorrect input : non-constants are not allowed as coefficients (first argument at [%d, %d])", i, j);
2924  return TRUE;
2925  }
2926  assume(p_IsConstant(MATELEM(CC,i,j),curr));
2927  qN = p_GetCoeff(MATELEM(CC,i,j),curr);
2928  }
2929 
2930 
2931  if ( qN == NULL ) /* check the consistency: Cij!=0 */
2932  // find also illegal pN
2933  {
2934  Werror("Incorrect input : matrix of coefficients contains zeros in the upper triangle");
2935 
2936 // if( currRing != save )
2937 // rChangeCurrRing(save);
2938  return TRUE;
2939  }
2940 
2941  if (!n_Equal(pN, qN, curr->cf)) tmpIsSkewConstant = false;
2942  }
2943 
2944  if( bCopyInput )
2945  {
2946  C = mp_Copy(CC, curr, r); // Copy C into r!!!???
2947 #ifndef SING_NDEBUG
2948  id_Test((ideal)C, r);
2949 #endif
2950  bCnew = true;
2951  }
2952  else
2953  C = CC;
2954 
2955  IsSkewConstant = tmpIsSkewConstant;
2956 
2957  if ( tmpIsSkewConstant && n_IsOne(pN, curr) )
2958  nctype = nc_lie;
2959  else
2960  nctype = nc_general;
2961  }
2962 
2963  /* initialition of the matrix D */
2964  if ( DD == NULL ) /* we treat DN only (it could also be NULL) */
2965  {
2966  D = mpNew(r->N,r->N); bDnew = true;
2967 
2968  if (DN == NULL)
2969  {
2970  if ( (nctype == nc_lie) || (nctype == nc_undef) )
2971  nctype = nc_comm; /* it was nc_skew earlier */
2972  else /* nc_general, nc_skew */
2973  nctype = nc_skew;
2974  }
2975  else /* DN != NULL */
2976  for(i=1; i<r->N; i++)
2977  for(j=i+1; j<=r->N; j++)
2978  MATELEM(D,i,j) = prCopyR_NoSort(DN, curr, r); // project DN into r->GetNC()->basering!
2979 #ifndef SING_NDEBUG
2980  id_Test((ideal)D, r);
2981 #endif
2982  }
2983  else /* DD != NULL */
2984  {
2985  bool b = true; // DD == null ?
2986 
2987  for(int i = 1; (i < r->N) && b; i++)
2988  for(int j = i+1; (j <= r->N) && b; j++)
2989  if (MATELEM(DD, i, j) != NULL)
2990  {
2991  b = false;
2992  break;
2993  }
2994 
2995  if (b) // D == NULL!!!
2996  {
2997  if ( (nctype == nc_lie) || (nctype == nc_undef) )
2998  nctype = nc_comm; /* it was nc_skew earlier */
2999  else /* nc_general, nc_skew */
3000  nctype = nc_skew;
3001  }
3002 
3003  if( bCopyInput )
3004  {
3005  D = mp_Copy(DD, curr, r); // Copy DD into r!!!
3006 #ifndef SING_NDEBUG
3007  id_Test((ideal)D, r);
3008 #endif
3009  bDnew = true;
3010  }
3011  else
3012  D = DD;
3013  }
3014 
3015  assume( C != NULL );
3016  assume( D != NULL );
3017 
3018 #if OUTPUT
3019  PrintS("nc_CallPlural(), Computed data, C: \n");
3020  iiWriteMatrix(C, "C", 2, r, 4);
3021 
3022  PrintS("nc_CallPlural(), Computed data, D: \n");
3023  iiWriteMatrix(D, "D", 2, r, 4);
3024 
3025  Print("\nTemporary: type = %d, IsSkewConstant = %d\n", nctype, IsSkewConstant);
3026 #endif
3027 
3028 
3029  // check the ordering condition for D (both matrix and poly cases):
3030  if ( gnc_CheckOrdCondition(D, r) )
3031  {
3032  if( bCnew ) mp_Delete( &C, r );
3033  if( bDnew ) mp_Delete( &D, r );
3034 
3035  Werror("Matrix of polynomials violates the ordering condition");
3036 
3037 // if( currRing != save )
3038 // rChangeCurrRing(save);
3039  return TRUE;
3040  }
3041 
3042  // okay now we are ready for this!!!
3043 
3044  // create new non-commutative structure
3045  nc_struct *nc_new = (nc_struct *)omAlloc0(sizeof(nc_struct));
3046 
3047  ncRingType(nc_new, nctype);
3048 
3049  nc_new->C = C; // if C and D were given by matrices at the beginning they are in r
3050  nc_new->D = D; // otherwise they should be in r->GetNC()->basering(polynomial * Id_{N})
3051 
3052  nc_new->IsSkewConstant = (IsSkewConstant?1:0);
3053 
3054  // Setup new NC structure!!!
3055  if (r->GetNC() != NULL)
3056  {
3057 #ifndef SING_NDEBUG
3058  WarnS("Changing the NC-structure of an existing NC-ring!!!");
3059 #endif
3060  nc_rKill(r);
3061  }
3062 
3063  r->GetNC() = nc_new;
3064 
3065  r->ext_ref=NULL;
3066 
3067 // if( currRing != save )
3068 // rChangeCurrRing(save);
3069 
3070  return gnc_InitMultiplication(r, bSetupQuotient);
3071 }
poly prCopyR_NoSort(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:77
#define Print
Definition: emacs.cc:83
void nc_rKill(ring r)
complete destructor
Definition: old.gring.cc:2527
#define FALSE
Definition: auxiliary.h:140
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
#define id_Test(A, lR)
Definition: simpleideals.h:67
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
#define WarnS
Definition: emacs.cc:81
Definition: nc.h:83
nc_type
Definition: nc.h:20
Definition: nc.h:25
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
Definition: matpol.cc:738
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1781
Definition: nc.h:27
D(ideal gnc_gr_bba(const ideal, const ideal, const intvec *, const intvec *, kStrategy, const ring _currRing)) D(ideal gnc_gr_mora(const ideal
Modified Plural's Buchberger's algorithmus.
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
Definition: ring.cc:1642
BOOLEAN gnc_InitMultiplication(ring r, bool bSetupQuotient=false)
Definition: old.gring.cc:3087
int i
Definition: cfEzgcd.cc:123
Definition: nc.h:24
void PrintS(const char *s)
Definition: reporter.cc:294
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:464
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:784
#define p_Test(p, r)
Definition: p_polys.h:160
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
BOOLEAN gnc_CheckOrdCondition(matrix D, ring r)
Definition: old.gring.cc:2679
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
Definition: nc.h:23
matrix D
Definition: nc.h:92
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
Definition: coeffs.h:460
#define p_GetCoeff(p, r)
Definition: monomials.h:57
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
matrix C
Definition: nc.h:91
#define MATROWS(i)
Definition: matpol.h:27
int IsSkewConstant
Definition: nc.h:101
const poly b
Definition: syzextra.cc:213
void Werror(const char *fmt,...)
Definition: reporter.cc:199
#define omAlloc0(size)
Definition: omAllocDecl.h:211
Definition: nc.h:26
#define MATELEM(mat, i, j)
Definition: matpol.h:29
BOOLEAN nc_CheckSubalgebra ( poly  PolyVar,
ring  r 
)

Definition at line 2620 of file old.gring.cc.

2621 {
2622 // ring save = currRing;
2623 // int WeChangeRing = 0;
2624 // if (currRing != r)
2625 // rChangeCurrRing(r);
2626 // WeChangeRing = 1;
2627 // }
2628  int rN=r->N;
2629  int *ExpVar=(int*)omAlloc0((rN+1)*sizeof(int));
2630  int *ExpTmp=(int*)omAlloc0((rN+1)*sizeof(int));
2631  p_GetExpV(PolyVar, ExpVar, r);
2632  int i; int j; int k;
2633  poly test=NULL;
2634  int OK=1;
2635  for (i=1; i<rN; i++)
2636  {
2637  if (ExpVar[i]==0) /* i.e. not in PolyVar */
2638  {
2639  for (j=i+1; j<=rN; j++)
2640  {
2641  if (ExpVar[j]==0)
2642  {
2643  test = MATELEM(r->GetNC()->D,i,j);
2644  while (test!=NULL)
2645  {
2646  p_GetExpV(test, ExpTmp, r);
2647  OK=1;
2648  for (k=1;k<=rN;k++)
2649  {
2650  if (ExpTmp[k]!=0)
2651  {
2652  if (ExpVar[k]!=0) OK=0;
2653  }
2654  }
2655  if (!OK)
2656  {
2657 // if ( WeChangeRing )
2658 // rChangeCurrRing(save);
2659  return(TRUE);
2660  }
2661  pIter(test);
2662  }
2663  }
2664  }
2665  }
2666  }
2667  freeT(ExpVar,rN);
2668  freeT(ExpTmp,rN);
2669 // if ( WeChangeRing )
2670 // rChangeCurrRing(save);
2671  return(FALSE);
2672 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
#define FALSE
Definition: auxiliary.h:140
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1448
#define TRUE
Definition: auxiliary.h:144
int k
Definition: cfEzgcd.cc:93
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
polyrec * poly
Definition: hilb.h:10
int i
Definition: cfEzgcd.cc:123
CanonicalForm test
Definition: cfModGcd.cc:4037
#define NULL
Definition: omList.c:10
#define freeT(A, v)
Definition: old.gring.cc:94
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define MATELEM(mat, i, j)
Definition: matpol.h:29
poly nc_CreateShortSpoly ( poly  p1,
poly  p2,
const ring  r 
)

Definition at line 1926 of file old.gring.cc.

1927 {
1928 #ifdef PDEBUG
1929  p_Test(p1, r);
1930  p_Test(p2, r);
1931 #endif
1932 
1933  const long lCompP1 = p_GetComp(p1,r);
1934  const long lCompP2 = p_GetComp(p2,r);
1935 
1936  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
1937  {
1938 #ifdef PDEBUG
1939  Werror("nc_CreateShortSpoly: wrong module components!"); // !!!!
1940 #endif
1941  return(NULL);
1942  }
1943 
1944  poly m;
1945 
1946 #ifdef HAVE_RATGRING
1947  if ( rIsRatGRing(r))
1948  {
1949  /* rational version */
1950  m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
1951  } else
1952 #endif
1953  {
1954  m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
1955  }
1956 
1957 // n_Delete(&p_GetCoeff(m, r), r);
1958 // pSetCoeff0(m, NULL);
1959 
1960 #ifdef PDEBUG
1961 // p_Test(m,r);
1962 #endif
1963 
1964  return(m);
1965 }
poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r)
Definition: old.gring.cc:147
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
Definition: p_polys.cc:1588
polyrec * poly
Definition: hilb.h:10
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static bool rIsRatGRing(const ring r)
Definition: ring.h:366
void Werror(const char *fmt,...)
Definition: reporter.cc:199
static poly nc_CreateSpoly ( const poly  p1,
const poly  p2,
const ring  r 
)
inlinestatic

Definition at line 258 of file nc.h.

259 {
261  assume(r->GetNC()->p_Procs.SPoly!=NULL);
262  return r->GetNC()->p_Procs.SPoly(p1, p2, r);
263 }
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static void nc_kBucketPolyRed ( kBucket_pt  b,
poly  p,
number *  c 
)
inlinestatic

Definition at line 292 of file nc.h.

293 {
294  const ring r = b->bucket_ring;
295  assume(rIsPluralRing(r));
296 
297 // return gnc_kBucketPolyRedNew(b, p, c);
298 
299  assume(r->GetNC()->p_Procs.BucketPolyRed!=NULL);
300  return r->GetNC()->p_Procs.BucketPolyRed(b, p, c);
301 }
return P p
Definition: myNF.cc:203
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static poly nc_mm_Mult_p ( const poly  m,
poly  p,
const ring  r 
)
inlinestatic

Definition at line 250 of file nc.h.

251 {
253  assume(r->GetNC()->p_Procs.mm_Mult_p!=NULL);
254  return r->GetNC()->p_Procs.mm_Mult_p(m, p, r);
255 // return p_Mult_mm( p, m, r);
256 }
return P p
Definition: myNF.cc:203
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
static poly nc_mm_Mult_pp ( const poly  m,
const poly  p,
const ring  r 
)
inlinestatic

Definition at line 240 of file nc.h.

241 {
243  assume(r->GetNC()->p_Procs.mm_Mult_pp!=NULL);
244  return r->GetNC()->p_Procs.mm_Mult_pp(m, p, r);
245 // return pp_Mult_mm( p, m, r);
246 }
return P p
Definition: myNF.cc:203
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
poly nc_p_Bracket_qq ( poly  p,
const poly  q,
const ring  r 
)

returns [p,q], destroys p

Definition at line 2295 of file old.gring.cc.

2296 {
2297  assume(p != NULL && q!= NULL);
2298 
2299  if (!rIsPluralRing(r)) return(NULL);
2300  if (p_ComparePolys(p,q, r)) return(NULL);
2301  /* Components !? */
2302  poly Q=NULL;
2303  number coef=NULL;
2304  poly pres=NULL;
2305  int UseBuckets=1;
2306  if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2))
2308  UseBuckets=0;
2309 
2310 
2311  CPolynomialSummator sum(r, UseBuckets == 0);
2312 
2313  while (p!=NULL)
2314  {
2315  Q=q;
2316  while(Q!=NULL)
2317  {
2318  pres=nc_mm_Bracket_nn(p,Q, r); /* since no coeffs are taken into account there */
2319  if (pres!=NULL)
2320  {
2321  coef = n_Mult(p_GetCoeff(p, r),p_GetCoeff(Q, r), r);
2322  pres = p_Mult_nn(pres,coef,r);
2323 
2324  sum += pres;
2325  n_Delete(&coef, r);
2326  }
2327  pIter(Q);
2328  }
2329  p=p_LmDeleteAndNext(p, r);
2330  }
2331  return(sum);
2332 }
poly nc_mm_Bracket_nn(poly m1, poly m2, const ring r)
returns [m1,m2] for two monoms, destroys nothing without coeffs
Definition: old.gring.cc:2336
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:721
BOOLEAN p_ComparePolys(poly p1, poly p2, const ring r)
returns TRUE if p1 is a skalar multiple of p2 assume p1 != NULL and p2 != NULL
Definition: p_polys.cc:4352
return P p
Definition: myNF.cc:203
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:22
#define Q
Definition: sirandom.c:25
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
static int pLength(poly a)
Definition: p_polys.h:189
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
#define pIter(p)
Definition: monomials.h:44
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition: coeffs.h:633
const ring r
Definition: syzextra.cc:208
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
#define NULL
Definition: omList.c:10
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(...
Definition: summator.h:29
poly nc_p_Minus_mm_Mult_qq ( poly  p,
const poly  m,
const poly  q,
int lp,
const poly  ,
const ring  r 
)

for p_Minus_mm_Mult_qq in pInline2.h

Definition at line 196 of file old.gring.cc.

198 {
199  poly mc = p_Neg( p_Copy(m, r), r );
200  poly mmc = nc_mm_Mult_pp( mc, q, r );
201  p_Delete(&mc, r);
202 
203  int org_p=pLength(p);
204  int org_q=pLength(q);
205 
206  p = p_Add_q(p, mmc, r);
207 
208  shorter = pLength(p)-org_p-org_q; // ring independent!
209 
210  return(p);
211 }
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
const ring r
Definition: syzextra.cc:208
polyrec * poly
Definition: hilb.h:10
int m
Definition: cfEzgcd.cc:119
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
poly nc_p_Plus_mm_Mult_qq ( poly  p,
const poly  m,
const poly  q,
int lp,
const int  ,
const ring  r 
)

Definition at line 214 of file old.gring.cc.

216 {
217  p = p_Add_q(p, nc_mm_Mult_pp( m, q, r ), r);
218 
219  lp = pLength(p);
220 
221  return(p);
222 }
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
void nc_p_ProcsSet ( ring  rGR,
p_Procs_s p_Procs 
)

Definition at line 3251 of file old.gring.cc.

3252 {
3253  assume(rIsPluralRing(rGR));
3254  assume(p_Procs!=NULL);
3255 
3256  gnc_p_ProcsSet(rGR, p_Procs);
3257 
3258  if(rIsSCA(rGR) && ncExtensions(SCAMASK) )
3259  {
3260  sca_p_ProcsSet(rGR, p_Procs);
3261  }
3262 
3263  if( ncExtensions(NOPLURALMASK) )
3265 
3266  if(!rIsSCA(rGR) && !ncExtensions(NOFORMULAMASK))
3268 
3269 }
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
#define assume(x)
Definition: mod2.h:405
void sca_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: sca.cc:1239
#define NULL
Definition: omList.c:10
const int SCAMASK
Definition: nc.h:355
static bool rIsSCA(const ring r)
Definition: nc.h:206
BOOLEAN ncInitSpecialPairMultiplication(ring r)
Definition: ncSAMult.cc:267
const int NOPLURALMASK
Definition: nc.h:369
bool ncInitSpecialPowersMultiplication(ring r)
Definition: ncSAFormula.cc:51
static void gnc_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: old.gring.cc:3187
const int NOFORMULAMASK
Definition: nc.h:370
bool ncExtensions(int iMask)
Definition: old.gring.cc:87
void nc_PolyPolyRed ( poly b,
poly  p,
number *  c,
const ring  r 
)

Definition at line 2282 of file old.gring.cc.

2283 {
2284 #if 0
2285  nc_PolyPolyRedOld(b, p, c, r);
2286 #else
2287  nc_PolyPolyRedNew(b, p, c, r);
2288 #endif
2289 }
return P p
Definition: myNF.cc:203
void nc_PolyPolyRedNew(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2182
const ring r
Definition: syzextra.cc:208
void nc_PolyPolyRedOld(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2148
const poly b
Definition: syzextra.cc:213
matrix nc_PrintMat ( int  a,
int  b,
ring  r,
int  metric 
)

returns matrix with the info on noncomm multiplication

Definition at line 2446 of file old.gring.cc.

2447 {
2448 
2449  if ( (a==b) || !rIsPluralRing(r) ) return(NULL);
2450  int i;
2451  int j;
2452  if (a>b) {j=b; i=a;}
2453  else {j=a; i=b;}
2454  /* i<j */
2455  int rN=r->N;
2456  int size=r->GetNC()->MTsize[UPMATELEM(i,j,rN)];
2457  matrix M = r->GetNC()->MT[UPMATELEM(i,j,rN)];
2458  /* return(M); */
2459 /*
2460  int sizeofres;
2461  if (metric==0)
2462  {
2463  sizeofres=sizeof(int);
2464  }
2465  if (metric==1)
2466  {
2467  sizeofres=sizeof(number);
2468  }
2469 */
2470  matrix res=mpNew(size,size);
2471  int s;
2472  int t;
2473  int length;
2474  long totdeg;
2475  poly p;
2476  for(s=1;s<=size;s++)
2477  {
2478  for(t=1;t<=size;t++)
2479  {
2480  p=MATELEM(M,s,t);
2481  if (p==NULL)
2482  {
2483  MATELEM(res,s,t)=0;
2484  }
2485  else
2486  {
2487  length = pLength(p);
2488  if (metric==0) /* length */
2489  {
2490  MATELEM(res,s,t)= p_ISet(length,r);
2491  }
2492  else if (metric==1) /* sum of deg divided by the length */
2493  {
2494  totdeg=0;
2495  while (p!=NULL)
2496  {
2497  totdeg=totdeg+p_Deg(p,r);
2498  pIter(p);
2499  }
2500  number ntd = n_Init(totdeg, r);
2501  number nln = n_Init(length, r);
2502  number nres= n_Div(ntd,nln, r);
2503  n_Delete(&ntd, r);
2504  n_Delete(&nln, r);
2505  MATELEM(res,s,t)=p_NSet(nres,r);
2506  }
2507  }
2508  }
2509  }
2510  return(res);
2511 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
return P p
Definition: myNF.cc:203
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1448
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:537
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
static int pLength(poly a)
Definition: p_polys.h:189
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
#define M
Definition: sirandom.c:24
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:586
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
polyrec * poly
Definition: hilb.h:10
int i
Definition: cfEzgcd.cc:123
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition: coeffs.h:613
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
const poly b
Definition: syzextra.cc:213
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1302
#define UPMATELEM(i, j, nVar)
Definition: nc.h:44
#define MATELEM(mat, i, j)
Definition: matpol.h:29
poly nc_pSubst ( poly  p,
int  n,
poly  e,
const ring  r 
)

substitute the n-th variable by e in p destroy p e is not a constant

Definition at line 3275 of file old.gring.cc.

3276 {
3277  int rN = r->N;
3278  int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
3279  int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
3280  int i,pow;
3281  number C;
3282  poly suf,pre;
3283  poly res = NULL;
3284  poly out = NULL;
3285  while ( p!= NULL )
3286  {
3287  C = p_GetCoeff(p, r);
3288  p_GetExpV(p, PRE, r); /* faster splitting? */
3289  pow = PRE[n]; PRE[n]=0;
3290  res = NULL;
3291  if (pow!=0)
3292  {
3293  for (i=n+1; i<=rN; i++)
3294  {
3295  SUF[i] = PRE[i];
3296  PRE[i] = 0;
3297  }
3298  res = p_Power(p_Copy(e, r),pow, r);
3299  /* multiply with prefix */
3300  pre = p_One(r);
3301  p_SetExpV(pre,PRE, r);
3302  p_Setm(pre, r);
3303  res = nc_mm_Mult_p(pre,res, r);
3304  /* multiply with suffix */
3305  suf = p_One(r);
3306  p_SetExpV(suf,SUF, r);
3307  p_Setm(suf, r);
3308  res = p_Mult_mm(res,suf, r);
3309  res = p_Mult_nn(res,C, r);
3310  p_SetComp(res,PRE[0], r);
3311  }
3312  else /* pow==0 */
3313  {
3314  res = p_Head(p, r);
3315  }
3316  p = p_LmDeleteAndNext(p, r);
3317  out = p_Add_q(out,res, r);
3318  }
3319  freeT(PRE,rN);
3320  freeT(SUF,rN);
3321  return(out);
3322 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:721
return P p
Definition: myNF.cc:203
static poly p_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:973
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1448
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static void p_SetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1456
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
poly res
Definition: myNF.cc:322
static poly nc_mm_Mult_p(const poly m, poly p, const ring r)
Definition: nc.h:250
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:819
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
polyrec * poly
Definition: hilb.h:10
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:902
#define NULL
Definition: omList.c:10
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define p_GetCoeff(p, r)
Definition: monomials.h:57
#define freeT(A, v)
Definition: old.gring.cc:94
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
Rational pow(const Rational &a, int e)
Definition: GMPrat.cc:418
poly p_Power(poly p, int i, const ring r)
Definition: p_polys.cc:2100
#define omAlloc0(size)
Definition: omAllocDecl.h:211
BOOLEAN nc_rComplete ( const ring  src,
ring  dest,
bool  bSetupQuotient = true 
)

Definition at line 5499 of file ring.cc.

5504 {
5505 // NOTE: Originally used only by idElimination to transfer NC structure to dest
5506 // ring created by dirty hack (without nc_CallPlural)
5507  rTest(src);
5508 
5509  assume(!rIsPluralRing(dest)); // destination must be a newly constructed commutative ring
5510 
5511  if (!rIsPluralRing(src))
5512  {
5513  return FALSE;
5514  }
5515 
5516  const int N = dest->N;
5517 
5518  assume(src->N == N);
5519 
5520 // ring save = currRing;
5521 
5522 // if (dest != save)
5523 // rChangeCurrRing(dest);
5524 
5525  const ring srcBase = src;
5526 
5527  assume( n_SetMap(srcBase->cf,dest->cf) == n_SetMap(dest->cf,dest->cf) ); // currRing is important here!
5528 
5529  matrix C = mpNew(N,N); // ring independent
5530  matrix D = mpNew(N,N);
5531 
5532  matrix C0 = src->GetNC()->C;
5533  matrix D0 = src->GetNC()->D;
5534 
5535  // map C and D into dest
5536  for (int i = 1; i < N; i++)
5537  {
5538  for (int j = i + 1; j <= N; j++)
5539  {
5540  const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase->cf); // src, mapping for coeffs into currRing = dest!
5541  const poly p = p_NSet(n, dest);
5542  MATELEM(C,i,j) = p;
5543  if (MATELEM(D0,i,j) != NULL)
5544  MATELEM(D,i,j) = prCopyR(MATELEM(D0,i,j), srcBase, dest); // ?
5545  }
5546  }
5547  /* One must test C and D _only_ in r->GetNC()->basering!!! not in r!!! */
5548 
5549  id_Test((ideal)C, dest);
5550  id_Test((ideal)D, dest);
5551 
5552  if (nc_CallPlural(C, D, NULL, NULL, dest, bSetupQuotient, false, true, dest)) // also takes care about quotient ideal
5553  {
5554  //WarnS("Error transferring non-commutative structure");
5555  // error message should be in the interpreter interface
5556 
5557  mp_Delete(&C, dest);
5558  mp_Delete(&D, dest);
5559 
5560 // if (currRing != save)
5561 // rChangeCurrRing(save);
5562 
5563  return TRUE;
5564  }
5565 
5566 // mp_Delete(&C, dest); // used by nc_CallPlural!
5567 // mp_Delete(&D, dest);
5568 
5569 // if (dest != save)
5570 // rChangeCurrRing(save);
5571 
5572  assume(rIsPluralRing(dest));
5573  return FALSE;
5574 }
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1448
#define id_Test(A, lR)
Definition: simpleideals.h:67
const ideal
Definition: gb_hack.h:42
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define TRUE
Definition: auxiliary.h:144
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
int j
Definition: myNF.cc:70
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
D(ideal gnc_gr_bba(const ideal, const ideal, const intvec *, const intvec *, kStrategy, const ring _currRing)) D(ideal gnc_gr_mora(const ideal
Modified Plural's Buchberger's algorithmus.
#define rTest(r)
Definition: ring.h:769
int i
Definition: cfEzgcd.cc:123
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:784
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:718
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
BOOLEAN nc_CallPlural(matrix cc, matrix dd, poly cn, poly dn, ring r, bool bSetupQuotient, bool bCopyInput, bool bBeQuiet, ring curr, bool dummy_ring=false)
returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type...
Definition: old.gring.cc:2734
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:451
#define p_GetCoeff(p, r)
Definition: monomials.h:57
#define MATELEM(mat, i, j)
Definition: matpol.h:29
bool nc_rCopy ( ring  res,
const ring  r,
bool  bSetupQuotient 
)

Definition at line 3075 of file old.gring.cc.

3076 {
3077  if (nc_CallPlural(r->GetNC()->C, r->GetNC()->D, NULL, NULL, res, bSetupQuotient, true, true, r))
3078  {
3079  WarnS("Error occured while coping/setuping the NC structure!"); // No reaction!???
3080  return true; // error
3081  }
3082 
3083  return false;
3084 }
#define WarnS
Definition: emacs.cc:81
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
BOOLEAN nc_CallPlural(matrix CCC, matrix DDD, poly CCN, poly DDN, ring r, bool bSetupQuotient, bool bCopyInput, bool bBeQuiet, ring curr, bool dummy_ring)
returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type...
Definition: old.gring.cc:2734
#define NULL
Definition: omList.c:10
static poly nc_ReduceSpoly ( const poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 271 of file nc.h.

272 {
274  assume(r->GetNC()->p_Procs.ReduceSPoly!=NULL);
275 #ifdef PDEBUG
276 // assume(p_LmDivisibleBy(p1, p2, r));
277 #endif
278  return r->GetNC()->p_Procs.ReduceSPoly(p1, p2, r);
279 }
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
void nc_rKill ( ring  r)

complete destructor

Definition at line 2527 of file old.gring.cc.

2529 {
2530  if( r->GetNC()->GetGlobalMultiplier() != NULL )
2531  {
2532  delete r->GetNC()->GetGlobalMultiplier();
2533  r->GetNC()->GetGlobalMultiplier() = NULL;
2534  }
2535 
2536  if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
2537  {
2538  delete r->GetNC()->GetFormulaPowerMultiplier();
2539  r->GetNC()->GetFormulaPowerMultiplier() = NULL;
2540  }
2541 
2542 
2543  int i,j;
2544  int rN=r->N;
2545  if ( rN > 1 )
2546  {
2547  for(i=1;i<rN;i++)
2548  {
2549  for(j=i+1;j<=rN;j++)
2550  {
2551  id_Delete((ideal *)&(r->GetNC()->MT[UPMATELEM(i,j,rN)]),r);
2552  }
2553  }
2554  omFreeSize((ADDRESS)r->GetNC()->MT,rN*(rN-1)/2*sizeof(matrix));
2555  omFreeSize((ADDRESS)r->GetNC()->MTsize,rN*(rN-1)/2*sizeof(int));
2556  id_Delete((ideal *)&(r->GetNC()->COM),r);
2557  }
2558  id_Delete((ideal *)&(r->GetNC()->C),r);
2559  id_Delete((ideal *)&(r->GetNC()->D),r);
2560 
2561  if( rIsSCA(r) && (r->GetNC()->SCAQuotient() != NULL) )
2562  {
2563  id_Delete(&r->GetNC()->SCAQuotient(), r); // Custom SCA destructor!!!
2564  }
2565 
2566 
2567  nc_CleanUp(r);
2568 }
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
void * ADDRESS
Definition: auxiliary.h:161
void nc_CleanUp(nc_struct *p)
Definition: old.gring.cc:2513
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static bool rIsSCA(const ring r)
Definition: nc.h:206
#define UPMATELEM(i, j, nVar)
Definition: nc.h:44
bool nc_SetupQuotient ( ring  rGR,
const ring  rG = NULL,
bool  bCopy = false 
)

Definition at line 3475 of file old.gring.cc.

3476 {
3477  if( rGR->qideal == NULL )
3478  return false; // no quotient = no work! done!? What about factors of SCA?
3479 
3480  bool ret = true;
3481  // currently only super-commutative extension deals with factors.
3482 
3483  if( ncExtensions(SCAMASK) )
3484  {
3485  bool sca_ret = sca_SetupQuotient(rGR, rG, bCopy);
3486 
3487  if(sca_ret) // yes it was dealt with!
3488  ret = false;
3489  }
3490 
3491  if( bCopy )
3492  {
3493  assume(rIsPluralRing(rGR) == rIsPluralRing(rG));
3494  assume((rGR->qideal==NULL) == (rG->qideal==NULL));
3495  assume(rIsSCA(rGR) == rIsSCA(rG));
3496  assume(ncRingType(rGR) == ncRingType(rG));
3497  }
3498 
3499  return ret;
3500 }
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
bool sca_SetupQuotient(ring rGR, ring rG, bool bCopy)
Definition: sca.cc:923
const int SCAMASK
Definition: nc.h:355
static bool rIsSCA(const ring r)
Definition: nc.h:206
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
bool ncExtensions(int iMask)
Definition: old.gring.cc:87
bool ncExtensions ( int  iMask)

Definition at line 87 of file old.gring.cc.

88 {
89  return ((getNCExtensions() & iMask) == iMask);
90 }
int & getNCExtensions()
Definition: old.gring.cc:75
static nc_type& ncRingType ( nc_struct p)
inlinestatic

Definition at line 175 of file nc.h.

176 {
177  assume(p!=NULL);
178  return (p->ncRingType());
179 }
#define assume(x)
Definition: mod2.h:405
nc_type & ncRingType()
Definition: nc.h:124
#define NULL
Definition: omList.c:10
static nc_type ncRingType ( ring  r)
inlinestatic

Definition at line 181 of file nc.h.

182 {
183  if(rIsPluralRing(r))
184  return (ncRingType(r->GetNC()));
185  else
186  return (nc_error);
187 }
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
Definition: nc.h:22
const ring r
Definition: syzextra.cc:208
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
static void ncRingType ( ring  r,
nc_type  t 
)
inlinestatic

Definition at line 189 of file nc.h.

190 {
191  assume((r != NULL) && (r->GetNC() != NULL));
192  ncRingType(r->GetNC()) = t;
193 }
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
static void ncRingType ( nc_struct p,
nc_type  t 
)
inlinestatic

Definition at line 195 of file nc.h.

196 {
197  assume(p!=NULL);
198  ncRingType(p) = t;
199 }
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
poly p_Lcm ( const poly  a,
const poly  b,
const long  lCompM,
const ring  r 
)

Definition at line 147 of file old.gring.cc.

148 {
149  poly m = // p_One( r);
150  p_Init(r);
151 
152  const int pVariables = r->N;
153 
154  for (int i = pVariables; i!=0; i--)
155  {
156  const int lExpA = p_GetExp (a, i, r);
157  const int lExpB = p_GetExp (b, i, r);
158 
159  p_SetExp (m, i, si_max(lExpA, lExpB), r);
160  }
161 
162  p_SetComp (m, lCompM, r);
163 
164  p_Setm(m,r);
165 
166 #ifdef PDEBUG
167 // p_Test(m,r);
168 #endif
169 
170  n_New(&(p_GetCoeff(m, r)), r);
171 
172  return(m);
173 }
#define n_New(n, r)
Definition: coeffs.h:440
const poly a
Definition: syzextra.cc:212
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:236
const ring r
Definition: syzextra.cc:208
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:465
polyrec * poly
Definition: hilb.h:10
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:484
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1248
const poly b
Definition: syzextra.cc:213
poly p_Lcm ( const poly  a,
const poly  b,
const ring  r 
)

Definition at line 175 of file old.gring.cc.

176 {
177 #ifdef PDEBUG
178  p_Test(a, r);
179  p_Test(b, r);
180 #endif
181 
182  const long lCompP1 = p_GetComp(a, r);
183  const long lCompP2 = p_GetComp(b, r);
184 
185  const poly m = p_Lcm(a, b, si_max(lCompP1, lCompP2), r);
186 
187 #ifdef PDEBUG
188 // p_Test(m,r);
189 #endif
190  return(m);
191 }
const poly a
Definition: syzextra.cc:212
poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r)
Definition: old.gring.cc:147
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
polyrec * poly
Definition: hilb.h:10
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
#define p_Test(p, r)
Definition: p_polys.h:160
const poly b
Definition: syzextra.cc:213
poly pOppose ( ring  Rop_src,
poly  p,
const ring  Rop_dst 
)

opposes a vector p from Rop to currRing (dst!)

Definition at line 3414 of file old.gring.cc.

3415 {
3416  /* the simplest case:*/
3417  if ( Rop == dst ) return(p_Copy(p, dst));
3418  /* check Rop == rOpposite(currRing) */
3419 
3420 
3421  if ( !rIsLikeOpposite(dst, Rop) )
3422  {
3423  WarnS("an opposite ring should be used");
3424  return NULL;
3425  }
3426 
3427  nMapFunc nMap = n_SetMap(Rop->cf, dst->cf); // reverse?
3428 
3429  /* nMapFunc nMap = nSetMap(Rop);*/
3430  /* since we know that basefields coinside! */
3431 
3432  // coinside???
3433 
3434  int *perm=(int *)omAlloc0((Rop->N+1)*sizeof(int));
3435  if (!p_IsConstantPoly(p, Rop))
3436  {
3437  /* we know perm exactly */
3438  int i;
3439  for(i=1; i<=Rop->N; i++)
3440  {
3441  perm[i] = Rop->N+1-i;
3442  }
3443  }
3444  poly res = p_PermPoly(p, perm, Rop, dst, nMap);
3445  omFreeSize((ADDRESS)perm,(Rop->N+1)*sizeof(int));
3446 
3447  p_Test(res, dst);
3448 
3449  return res;
3450 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:161
#define WarnS
Definition: emacs.cc:81
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
BOOLEAN rIsLikeOpposite(ring rBase, ring rCandidate)
checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so ...
Definition: old.gring.cc:3387
poly res
Definition: myNF.cc:322
polyrec * poly
Definition: hilb.h:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:71
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:718
#define p_Test(p, r)
Definition: p_polys.h:160
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3892
#define NULL
Definition: omList.c:10
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
Definition: p_polys.h:1795
#define omAlloc0(size)
Definition: omAllocDecl.h:211
BOOLEAN rIsLikeOpposite ( ring  rBase,
ring  rCandidate 
)

checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so

Definition at line 3387 of file old.gring.cc.

3388 {
3389  /* the same basefield */
3390  int diagnose = TRUE;
3391  nMapFunc nMap = n_SetMap(rCandidate->cf, rBase->cf); // reverse?
3392 
3393 ////// if (nMap != nCopy) diagnose = FALSE;
3394  if (nMap == NULL) diagnose = FALSE;
3395 
3396 
3397  /* same number of variables */
3398  if (rBase->N != rCandidate->N) diagnose = FALSE;
3399  /* nc and comm ring */
3400  if ( rIsPluralRing(rBase) != rIsPluralRing(rCandidate) ) diagnose = FALSE;
3401  /* both are qrings */
3402  /* NO CHECK, since it is used in building opposite qring */
3403  /* if ( ((rBase->qideal != NULL) && (rCandidate->qideal == NULL)) */
3404  /* || ((rBase->qideal == NULL) && (rCandidate->qideal != NULL)) ) */
3405  /* diagnose = FALSE; */
3406  /* TODO: varnames are e->E etc */
3407  return diagnose;
3408 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:71
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:718
#define NULL
Definition: omList.c:10
static bool rIsSCA ( const ring  r)
inlinestatic

Definition at line 206 of file nc.h.

207 {
208 #ifdef HAVE_PLURAL
209  return rIsPluralRing(r) && (ncRingType(r) == nc_exterior);
210 #else
211  return false;
212 #endif
213 }
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
const ring r
Definition: syzextra.cc:208
Definition: nc.h:29
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
int setNCExtensions ( int  iMask)

Definition at line 80 of file old.gring.cc.

81 {
82  const int iOld = getNCExtensions();
83  getNCExtensions() = iMask;
84  return (iOld);
85 }
int & getNCExtensions()
Definition: old.gring.cc:75

Variable Documentation

const int GENERICMASK = 0x000

Definition at line 354 of file nc.h.

const int NOCACHEMASK = 0x008

Definition at line 371 of file nc.h.

const int NOFORMULAMASK =0x004

Definition at line 370 of file nc.h.

const int NOPLURALMASK = 0x002

Definition at line 369 of file nc.h.

const int SCAMASK = 0x001

Definition at line 355 of file nc.h.

const int TESTSYZSCAMASK = 0x0100 | SCAMASK

Definition at line 373 of file nc.h.