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)
 
int & getNCExtensions ()
 
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 274 of file old.gring.cc.

275 {
276  assume( rIsPluralRing(rRing) );
277 #ifdef PDEBUG
278  p_Test(pPolyP, rRing);
279  p_Test(pPolyQ, rRing);
280 #endif
281 #ifdef RDEBUG
282  rTest(rRing);
283 #endif
284 
285  int lp, lq;
286 
287  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
288 
289  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
290 
291  CPolynomialSummator sum(rRing, bUsePolynomial);
292 
293  if (lq <= lp) // ?
294  {
295  // always length(q) times "p * q[j]"
296  for( ; pPolyQ!=NULL; pPolyQ = p_LmDeleteAndNext( pPolyQ, rRing ) )
297  sum += pp_Mult_mm( pPolyP, pPolyQ, rRing);
298 
299  p_Delete( &pPolyP, rRing );
300  } else
301  {
302  // always length(p) times "p[i] * q"
303  for( ; pPolyP!=NULL; pPolyP = p_LmDeleteAndNext( pPolyP, rRing ) )
304  sum += nc_mm_Mult_pp( pPolyP, pPolyQ, rRing);
305 
306  p_Delete( &pPolyQ, rRing );
307  }
308 
309  return(sum);
310 }
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:720
#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:963
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#define rTest(r)
Definition: ring.h:778
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:849
#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 313 of file old.gring.cc.

314 {
315  assume( rIsPluralRing(rRing) );
316 #ifdef PDEBUG
317  p_Test(pPolyP, rRing);
318  p_Test(pPolyQ, rRing);
319 #endif
320 #ifdef RDEBUG
321  rTest(rRing);
322 #endif
323 
324  int lp, lq;
325 
326  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
327 
328  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
329 
330  CPolynomialSummator sum(rRing, bUsePolynomial);
331 
332  if (lq <= lp) // ?
333  {
334  // always length(q) times "p * q[j]"
335  for( poly q = pPolyQ; q !=NULL; q = pNext(q) )
336  sum += pp_Mult_mm(pPolyP, q, rRing);
337  } else
338  {
339  // always length(p) times "p[i] * q"
340  for( poly p = pPolyP; p !=NULL; p = pNext(p) )
341  sum += nc_mm_Mult_pp( p, pPolyQ, rRing);
342  }
343 
344  return(sum);
345 }
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:963
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#define rTest(r)
Definition: ring.h:778
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
polyrec * poly
Definition: hilb.h:10
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
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
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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 }
#define D(A)
Definition: gentable.cc:119
int ncols
Definition: matpol.h:22
static nc_struct *& GetNC(ring r)
Definition: nc.h:170
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
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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 88 of file old.gring.cc.

89 {
90  return (iNCExtensions);
91 }
int iNCExtensions
Definition: old.gring.cc:86
ideal idOppose ( ring  Rop_src,
ideal  I,
const ring  Rop_dst 
)

opposes a module I from Rop to currRing(dst)

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

3467 {
3468  /* the simplest case:*/
3469  if ( Rop == dst ) return id_Copy(I, dst);
3470 
3471  /* check Rop == rOpposite(currRing) */
3472  if (!rIsLikeOpposite(dst, Rop))
3473  {
3474  WarnS("an opposite ring should be used");
3475  return NULL;
3476  }
3477  int i;
3478  ideal idOp = idInit(I->ncols, I->rank);
3479  for (i=0; i< (I->ncols)*(I->nrows); i++)
3480  {
3481  idOp->m[i] = pOppose(Rop,I->m[i], dst);
3482  }
3483  id_Test(idOp, dst);
3484  return idOp;
3485 }
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define id_Test(A, lR)
Definition: simpleideals.h:80
poly pOppose(ring Rop, poly p, const ring dst)
opposes a vector p from Rop to currRing (dst!)
Definition: old.gring.cc:3427
#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:3400
int i
Definition: cfEzgcd.cc:123
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#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
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#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 2747 of file old.gring.cc.

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

2634 {
2635 // ring save = currRing;
2636 // int WeChangeRing = 0;
2637 // if (currRing != r)
2638 // rChangeCurrRing(r);
2639 // WeChangeRing = 1;
2640 // }
2641  int rN=r->N;
2642  int *ExpVar=(int*)omAlloc0((rN+1)*sizeof(int));
2643  int *ExpTmp=(int*)omAlloc0((rN+1)*sizeof(int));
2644  p_GetExpV(PolyVar, ExpVar, r);
2645  int i; int j; int k;
2646  poly test=NULL;
2647  int OK=1;
2648  for (i=1; i<rN; i++)
2649  {
2650  if (ExpVar[i]==0) /* i.e. not in PolyVar */
2651  {
2652  for (j=i+1; j<=rN; j++)
2653  {
2654  if (ExpVar[j]==0)
2655  {
2656  test = MATELEM(r->GetNC()->D,i,j);
2657  while (test!=NULL)
2658  {
2659  p_GetExpV(test, ExpTmp, r);
2660  OK=1;
2661  for (k=1;k<=rN;k++)
2662  {
2663  if (ExpTmp[k]!=0)
2664  {
2665  if (ExpVar[k]!=0) OK=0;
2666  }
2667  }
2668  if (!OK)
2669  {
2670 // if ( WeChangeRing )
2671 // rChangeCurrRing(save);
2672  return(TRUE);
2673  }
2674  pIter(test);
2675  }
2676  }
2677  }
2678  }
2679  }
2680  freeT(ExpVar,rN);
2681  freeT(ExpTmp,rN);
2682 // if ( WeChangeRing )
2683 // rChangeCurrRing(save);
2684  return(FALSE);
2685 }
#define FALSE
Definition: auxiliary.h:140
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1449
#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
int i
Definition: cfEzgcd.cc:123
CanonicalForm test
Definition: cfModGcd.cc:4037
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
#define freeT(A, v)
Definition: old.gring.cc:107
#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 1939 of file old.gring.cc.

1940 {
1941 #ifdef PDEBUG
1942  p_Test(p1, r);
1943  p_Test(p2, r);
1944 #endif
1945 
1946  const long lCompP1 = p_GetComp(p1,r);
1947  const long lCompP2 = p_GetComp(p2,r);
1948 
1949  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
1950  {
1951 #ifdef PDEBUG
1952  Werror("nc_CreateShortSpoly: wrong module components!"); // !!!!
1953 #endif
1954  return(NULL);
1955  }
1956 
1957  poly m;
1958 
1959 #ifdef HAVE_RATGRING
1960  if ( rIsRatGRing(r))
1961  {
1962  /* rational version */
1963  m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
1964  } else
1965 #endif
1966  {
1967  m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
1968  }
1969 
1970 // n_Delete(&p_GetCoeff(m, r), r);
1971 // pSetCoeff0(m, NULL);
1972 
1973 #ifdef PDEBUG
1974 // p_Test(m,r);
1975 #endif
1976 
1977  return(m);
1978 }
poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r)
Definition: old.gring.cc:160
#define p_GetComp(p, r)
Definition: monomials.h:72
static BOOLEAN rIsRatGRing(const ring r)
Definition: ring.h:372
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
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
polyrec * poly
Definition: hilb.h:10
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 }
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#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
const ring r
Definition: syzextra.cc:208
ring bucket_ring
Definition: kbuckets.h:191
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#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
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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 2308 of file old.gring.cc.

2309 {
2310  assume(p != NULL && q!= NULL);
2311 
2312  if (!rIsPluralRing(r)) return(NULL);
2313  if (p_ComparePolys(p,q, r)) return(NULL);
2314  /* Components !? */
2315  poly Q=NULL;
2316  number coef=NULL;
2317  poly pres=NULL;
2318  int UseBuckets=1;
2319  if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2))
2321  UseBuckets=0;
2322 
2323 
2324  CPolynomialSummator sum(r, UseBuckets == 0);
2325 
2326  while (p!=NULL)
2327  {
2328  Q=q;
2329  while(Q!=NULL)
2330  {
2331  pres=nc_mm_Bracket_nn(p,Q, r); /* since no coeffs are taken into account there */
2332  if (pres!=NULL)
2333  {
2334  coef = n_Mult(p_GetCoeff(p, r),p_GetCoeff(Q, r), r);
2335  pres = p_Mult_nn(pres,coef,r);
2336 
2337  sum += pres;
2338  n_Delete(&coef, r);
2339  }
2340  pIter(Q);
2341  }
2342  p=p_LmDeleteAndNext(p, r);
2343  }
2344  return(sum);
2345 }
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:2349
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:720
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:4382
return P p
Definition: myNF.cc:203
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:22
#define Q
Definition: sirandom.c:25
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 &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:637
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:901
#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 &#39;p&#39;
Definition: coeffs.h:456
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(...
Definition: summator.h:29
polyrec * poly
Definition: hilb.h:10
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 209 of file old.gring.cc.

211 {
212  poly mc = p_Neg( p_Copy(m, r), r );
213  poly mmc = nc_mm_Mult_pp( mc, q, r );
214  p_Delete(&mc, r);
215 
216  int org_p=pLength(p);
217  int org_q=pLength(q);
218 
219  p = p_Add_q(p, mmc, r);
220 
221  shorter = pLength(p)-org_p-org_q; // ring independent!
222 
223  return(p);
224 }
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:810
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:849
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1019
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:883
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 227 of file old.gring.cc.

229 {
230  p = p_Add_q(p, nc_mm_Mult_pp( m, q, r ), r);
231 
232  lp = pLength(p);
233 
234  return(p);
235 }
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:883
void nc_p_ProcsSet ( ring  rGR,
p_Procs_s p_Procs 
)

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

3265 {
3266  assume(rIsPluralRing(rGR));
3267  assume(p_Procs!=NULL);
3268 
3269  gnc_p_ProcsSet(rGR, p_Procs);
3270 
3271  if(rIsSCA(rGR) && ncExtensions(SCAMASK) )
3272  {
3273  sca_p_ProcsSet(rGR, p_Procs);
3274  }
3275 
3276  if( ncExtensions(NOPLURALMASK) )
3278 
3279  if(!rIsSCA(rGR) && !ncExtensions(NOFORMULAMASK))
3281 
3282 }
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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:3200
const int NOFORMULAMASK
Definition: nc.h:370
bool ncExtensions(int iMask)
Definition: old.gring.cc:100
void nc_PolyPolyRed ( poly b,
poly  p,
number *  c,
const ring  r 
)

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

2296 {
2297 #if 0
2298  nc_PolyPolyRedOld(b, p, c, r);
2299 #else
2300  nc_PolyPolyRedNew(b, p, c, r);
2301 #endif
2302 }
return P p
Definition: myNF.cc:203
void nc_PolyPolyRedNew(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2195
const ring r
Definition: syzextra.cc:208
void nc_PolyPolyRedOld(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2161
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 2459 of file old.gring.cc.

2460 {
2461 
2462  if ( (a==b) || !rIsPluralRing(r) ) return(NULL);
2463  int i;
2464  int j;
2465  if (a>b) {j=b; i=a;}
2466  else {j=a; i=b;}
2467  /* i<j */
2468  int rN=r->N;
2469  int size=r->GetNC()->MTsize[UPMATELEM(i,j,rN)];
2470  matrix M = r->GetNC()->MT[UPMATELEM(i,j,rN)];
2471  /* return(M); */
2472 /*
2473  int sizeofres;
2474  if (metric==0)
2475  {
2476  sizeofres=sizeof(int);
2477  }
2478  if (metric==1)
2479  {
2480  sizeofres=sizeof(number);
2481  }
2482 */
2483  matrix res=mpNew(size,size);
2484  int s;
2485  int t;
2486  int length;
2487  long totdeg;
2488  poly p;
2489  for(s=1;s<=size;s++)
2490  {
2491  for(t=1;t<=size;t++)
2492  {
2493  p=MATELEM(M,s,t);
2494  if (p==NULL)
2495  {
2496  MATELEM(res,s,t)=0;
2497  }
2498  else
2499  {
2500  length = pLength(p);
2501  if (metric==0) /* length */
2502  {
2503  MATELEM(res,s,t)= p_ISet(length,r);
2504  }
2505  else if (metric==1) /* sum of deg divided by the length */
2506  {
2507  totdeg=0;
2508  while (p!=NULL)
2509  {
2510  totdeg=totdeg+p_Deg(p,r);
2511  pIter(p);
2512  }
2513  number ntd = n_Init(totdeg, r);
2514  number nln = n_Init(length, r);
2515  number nres= n_Div(ntd,nln, r);
2516  n_Delete(&ntd, r);
2517  n_Delete(&nln, r);
2518  MATELEM(res,s,t)=p_NSet(nres,r);
2519  }
2520  }
2521  }
2522  }
2523  return(res);
2524 }
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:539
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
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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 &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:616
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
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 3288 of file old.gring.cc.

3289 {
3290  int rN = r->N;
3291  int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
3292  int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
3293  int i,pow;
3294  number C;
3295  poly suf,pre;
3296  poly res = NULL;
3297  poly out = NULL;
3298  while ( p!= NULL )
3299  {
3300  C = p_GetCoeff(p, r);
3301  p_GetExpV(p, PRE, r); /* faster splitting? */
3302  pow = PRE[n]; PRE[n]=0;
3303  res = NULL;
3304  if (pow!=0)
3305  {
3306  for (i=n+1; i<=rN; i++)
3307  {
3308  SUF[i] = PRE[i];
3309  PRE[i] = 0;
3310  }
3311  res = p_Power(p_Copy(e, r),pow, r);
3312  /* multiply with prefix */
3313  pre = p_One(r);
3314  p_SetExpV(pre,PRE, r);
3315  p_Setm(pre, r);
3316  res = nc_mm_Mult_p(pre,res, r);
3317  /* multiply with suffix */
3318  suf = p_One(r);
3319  p_SetExpV(suf,SUF, r);
3320  p_Setm(suf, r);
3321  res = p_Mult_mm(res,suf, r);
3322  res = p_Mult_nn(res,C, r);
3323  p_SetComp(res,PRE[0], r);
3324  }
3325  else /* pow==0 */
3326  {
3327  res = p_Head(p, r);
3328  }
3329  p = p_LmDeleteAndNext(p, r);
3330  out = p_Add_q(out,res, r);
3331  }
3332  freeT(PRE,rN);
3333  freeT(SUF,rN);
3334  return(out);
3335 }
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:720
return P p
Definition: myNF.cc:203
static poly p_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:974
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:242
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1449
static void p_SetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1457
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:810
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:818
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:901
#define NULL
Definition: omList.c:10
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10
#define freeT(A, v)
Definition: old.gring.cc:107
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:883
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:2108
#define omAlloc0(size)
Definition: omAllocDecl.h:211
BOOLEAN nc_rComplete ( const ring  src,
ring  dest,
bool  bSetupQuotient = true 
)

Definition at line 5531 of file ring.cc.

5536 {
5537 // NOTE: Originally used only by idElimination to transfer NC structure to dest
5538 // ring created by dirty hack (without nc_CallPlural)
5539  rTest(src);
5540 
5541  assume(!rIsPluralRing(dest)); // destination must be a newly constructed commutative ring
5542 
5543  if (!rIsPluralRing(src))
5544  {
5545  return FALSE;
5546  }
5547 
5548  const int N = dest->N;
5549 
5550  assume(src->N == N);
5551 
5552 // ring save = currRing;
5553 
5554 // if (dest != save)
5555 // rChangeCurrRing(dest);
5556 
5557  const ring srcBase = src;
5558 
5559  assume( n_SetMap(srcBase->cf,dest->cf) == n_SetMap(dest->cf,dest->cf) ); // currRing is important here!
5560 
5561  matrix C = mpNew(N,N); // ring independent
5562  matrix D = mpNew(N,N);
5563 
5564  matrix C0 = src->GetNC()->C;
5565  matrix D0 = src->GetNC()->D;
5566 
5567  // map C and D into dest
5568  for (int i = 1; i < N; i++)
5569  {
5570  for (int j = i + 1; j <= N; j++)
5571  {
5572  const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase->cf); // src, mapping for coeffs into currRing = dest!
5573  const poly p = p_NSet(n, dest);
5574  MATELEM(C,i,j) = p;
5575  if (MATELEM(D0,i,j) != NULL)
5576  MATELEM(D,i,j) = prCopyR(MATELEM(D0,i,j), srcBase, dest); // ?
5577  }
5578  }
5579  /* One must test C and D _only_ in r->GetNC()->basering!!! not in r!!! */
5580 
5581  id_Test((ideal)C, dest);
5582  id_Test((ideal)D, dest);
5583 
5584  if (nc_CallPlural(C, D, NULL, NULL, dest, bSetupQuotient, false, true, dest)) // also takes care about quotient ideal
5585  {
5586  //WarnS("Error transferring non-commutative structure");
5587  // error message should be in the interpreter interface
5588 
5589  mp_Delete(&C, dest);
5590  mp_Delete(&D, dest);
5591 
5592 // if (currRing != save)
5593 // rChangeCurrRing(save);
5594 
5595  return TRUE;
5596  }
5597 
5598 // mp_Delete(&C, dest); // used by nc_CallPlural!
5599 // mp_Delete(&D, dest);
5600 
5601 // if (dest != save)
5602 // rChangeCurrRing(save);
5603 
5604  assume(rIsPluralRing(dest));
5605  return FALSE;
5606 }
#define D(A)
Definition: gentable.cc:119
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:80
#define TRUE
Definition: auxiliary.h:144
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#define rTest(r)
Definition: ring.h:778
int i
Definition: cfEzgcd.cc:123
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:785
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:722
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:2747
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10
#define MATELEM(mat, i, j)
Definition: matpol.h:29
bool nc_rCopy ( ring  res,
const ring  r,
bool  bSetupQuotient 
)

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

3089 {
3090  if (nc_CallPlural(r->GetNC()->C, r->GetNC()->D, NULL, NULL, res, bSetupQuotient, true, true, r))
3091  {
3092  WarnS("Error occurred while coping/setuping the NC structure!"); // No reaction!???
3093  return true; // error
3094  }
3095 
3096  return false;
3097 }
#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:2747
#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 }
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#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 2540 of file old.gring.cc.

2542 {
2543  if( r->GetNC()->GetGlobalMultiplier() != NULL )
2544  {
2545  delete r->GetNC()->GetGlobalMultiplier();
2546  r->GetNC()->GetGlobalMultiplier() = NULL;
2547  }
2548 
2549  if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
2550  {
2551  delete r->GetNC()->GetFormulaPowerMultiplier();
2552  r->GetNC()->GetFormulaPowerMultiplier() = NULL;
2553  }
2554 
2555 
2556  int i,j;
2557  int rN=r->N;
2558  if ( rN > 1 )
2559  {
2560  for(i=1;i<rN;i++)
2561  {
2562  for(j=i+1;j<=rN;j++)
2563  {
2564  id_Delete((ideal *)&(r->GetNC()->MT[UPMATELEM(i,j,rN)]),r);
2565  }
2566  }
2567  omFreeSize((ADDRESS)r->GetNC()->MT,rN*(rN-1)/2*sizeof(matrix));
2568  omFreeSize((ADDRESS)r->GetNC()->MTsize,rN*(rN-1)/2*sizeof(int));
2569  id_Delete((ideal *)&(r->GetNC()->COM),r);
2570  }
2571  id_Delete((ideal *)&(r->GetNC()->C),r);
2572  id_Delete((ideal *)&(r->GetNC()->D),r);
2573 
2574  if( rIsSCA(r) && (r->GetNC()->SCAQuotient() != NULL) )
2575  {
2576  id_Delete(&r->GetNC()->SCAQuotient(), r); // Custom SCA destructor!!!
2577  }
2578 
2579 
2580  nc_CleanUp(r);
2581 }
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:161
void nc_CleanUp(nc_struct *p)
Definition: old.gring.cc:2526
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 3488 of file old.gring.cc.

3489 {
3490  if( rGR->qideal == NULL )
3491  return false; // no quotient = no work! done!? What about factors of SCA?
3492 
3493  bool ret = true;
3494  // currently only super-commutative extension deals with factors.
3495 
3496  if( ncExtensions(SCAMASK) )
3497  {
3498  bool sca_ret = sca_SetupQuotient(rGR, rG, bCopy);
3499 
3500  if(sca_ret) // yes it was dealt with!
3501  ret = false;
3502  }
3503 
3504  if( bCopy )
3505  {
3506  assume(rIsPluralRing(rGR) == rIsPluralRing(rG));
3507  assume((rGR->qideal==NULL) == (rG->qideal==NULL));
3508  assume(rIsSCA(rGR) == rIsSCA(rG));
3509  assume(ncRingType(rGR) == ncRingType(rG));
3510  }
3511 
3512  return ret;
3513 }
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
#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:100
bool ncExtensions ( int  iMask)

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

101 {
102  return ((getNCExtensions() & iMask) == iMask);
103 }
int & getNCExtensions()
Definition: old.gring.cc:88
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 }
Definition: nc.h:22
const ring r
Definition: syzextra.cc:208
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
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 160 of file old.gring.cc.

161 {
162  poly m = // p_One( r);
163  p_Init(r);
164 
165  const int pVariables = r->N;
166 
167  for (int i = pVariables; i!=0; i--)
168  {
169  const int lExpA = p_GetExp (a, i, r);
170  const int lExpB = p_GetExp (b, i, r);
171 
172  p_SetExp (m, i, si_max(lExpA, lExpB), r);
173  }
174 
175  p_SetComp (m, lCompM, r);
176 
177  p_Setm(m,r);
178 
179 #ifdef PDEBUG
180 // p_Test(m,r);
181 #endif
182 
183  n_New(&(p_GetCoeff(m, r)), r);
184 
185  return(m);
186 }
#define n_New(n, r)
Definition: coeffs.h:441
const poly a
Definition: syzextra.cc:212
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:242
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:464
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:483
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1249
const poly b
Definition: syzextra.cc:213
poly p_Lcm ( const poly  a,
const poly  b,
const ring  r 
)

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

189 {
190 #ifdef PDEBUG
191  p_Test(a, r);
192  p_Test(b, r);
193 #endif
194 
195  const long lCompP1 = p_GetComp(a, r);
196  const long lCompP2 = p_GetComp(b, r);
197 
198  const poly m = p_Lcm(a, b, si_max(lCompP1, lCompP2), r);
199 
200 #ifdef PDEBUG
201 // p_Test(m,r);
202 #endif
203  return(m);
204 }
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:160
#define p_GetComp(p, r)
Definition: monomials.h:72
const ring r
Definition: syzextra.cc:208
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
polyrec * poly
Definition: hilb.h:10
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 3427 of file old.gring.cc.

3428 {
3429  /* the simplest case:*/
3430  if ( Rop == dst ) return(p_Copy(p, dst));
3431  /* check Rop == rOpposite(currRing) */
3432 
3433 
3434  if ( !rIsLikeOpposite(dst, Rop) )
3435  {
3436  WarnS("an opposite ring should be used");
3437  return NULL;
3438  }
3439 
3440  nMapFunc nMap = n_SetMap(Rop->cf, dst->cf); // reverse?
3441 
3442  /* nMapFunc nMap = nSetMap(Rop);*/
3443  /* since we know that basefields coinside! */
3444 
3445  // coinside???
3446 
3447  int *perm=(int *)omAlloc0((Rop->N+1)*sizeof(int));
3448  if (!p_IsConstantPoly(p, Rop))
3449  {
3450  /* we know perm exactly */
3451  int i;
3452  for(i=1; i<=Rop->N; i++)
3453  {
3454  perm[i] = Rop->N+1-i;
3455  }
3456  }
3457  poly res = p_PermPoly(p, perm, Rop, dst, nMap);
3458  omFreeSize((ADDRESS)perm,(Rop->N+1)*sizeof(int));
3459 
3460  p_Test(res, dst);
3461 
3462  return res;
3463 }
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:810
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:3400
poly res
Definition: myNF.cc:322
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition: p_polys.cc:3937
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
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:722
#define p_Test(p, r)
Definition: p_polys.h:160
#define NULL
Definition: omList.c:10
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
Definition: p_polys.h:1799
polyrec * poly
Definition: hilb.h:10
int perm[100]
#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 3400 of file old.gring.cc.

3401 {
3402  /* the same basefield */
3403  int diagnose = TRUE;
3404  nMapFunc nMap = n_SetMap(rCandidate->cf, rBase->cf); // reverse?
3405 
3406 ////// if (nMap != nCopy) diagnose = FALSE;
3407  if (nMap == NULL) diagnose = FALSE;
3408 
3409 
3410  /* same number of variables */
3411  if (rBase->N != rCandidate->N) diagnose = FALSE;
3412  /* nc and comm ring */
3413  if ( rIsPluralRing(rBase) != rIsPluralRing(rCandidate) ) diagnose = FALSE;
3414  /* both are qrings */
3415  /* NO CHECK, since it is used in building opposite qring */
3416  /* if ( ((rBase->qideal != NULL) && (rCandidate->qideal == NULL)) */
3417  /* || ((rBase->qideal == NULL) && (rCandidate->qideal != NULL)) ) */
3418  /* diagnose = FALSE; */
3419  /* TODO: varnames are e->E etc */
3420  return diagnose;
3421 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
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:722
#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 }
const ring r
Definition: syzextra.cc:208
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
Definition: nc.h:29
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175
int setNCExtensions ( int  iMask)

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

94 {
95  const int iOld = getNCExtensions();
96  getNCExtensions() = iMask;
97  return (iOld);
98 }
int & getNCExtensions()
Definition: old.gring.cc:88

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.