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

§ nc_pProcs

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

§ UPMATELEM

#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

§ bucket_Proc_Ptr

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

Definition at line 61 of file nc.h.

§ matrix

typedef ip_smatrix* matrix

Definition at line 13 of file nc.h.

§ mm_Mult_p_Proc_Ptr

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

Definition at line 53 of file nc.h.

§ mm_Mult_pp_Proc_Ptr

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

Definition at line 54 of file nc.h.

§ SPoly_Proc_Ptr

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

Definition at line 58 of file nc.h.

§ SPolyReduce_Proc_Ptr

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

Definition at line 59 of file nc.h.

Enumeration Type Documentation

§ nc_type

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

§ _nc_p_Mult_q()

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

general NC-multiplication with destruction

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

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

§ _nc_pp_Mult_qq()

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

general NC-multiplication without destruction

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

313 {
314  assume( rIsPluralRing(rRing) );
315 #ifdef PDEBUG
316  p_Test(pPolyP, rRing);
317  p_Test(pPolyQ, rRing);
318 #endif
319 #ifdef RDEBUG
320  rTest(rRing);
321 #endif
322 
323  int lp, lq;
324 
325  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
326 
327  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
328 
329  CPolynomialSummator sum(rRing, bUsePolynomial);
330 
331  if (lq <= lp) // ?
332  {
333  // always length(q) times "p * q[j]"
334  for( poly q = pPolyQ; q !=NULL; q = pNext(q) )
335  sum += pp_Mult_mm(pPolyP, q, rRing);
336  } else
337  {
338  // always length(p) times "p[i] * q"
339  for( poly p = pPolyP; p !=NULL; p = pNext(p) )
340  sum += nc_mm_Mult_pp( p, pPolyQ, rRing);
341  }
342 
343  return(sum);
344 }
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:957
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:100
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define rTest(r)
Definition: ring.h:775
static int si_max(const int a, const int b)
Definition: auxiliary.h:121
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

§ GetC()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
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

§ GetD()

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:121
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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
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

§ GetNC()

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

§ getNCExtensions()

int& getNCExtensions ( )

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

88 {
89  return (iNCExtensions);
90 }
int iNCExtensions
Definition: old.gring.cc:85

§ idOppose()

ideal idOppose ( ring  Rop_src,
ideal  I,
const ring  Rop_dst 
)

opposes a module I from Rop to currRing(dst)

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

3466 {
3467  /* the simplest case:*/
3468  if ( Rop == dst ) return id_Copy(I, dst);
3469 
3470  /* check Rop == rOpposite(currRing) */
3471  if (!rIsLikeOpposite(dst, Rop))
3472  {
3473  WarnS("an opposite ring should be used");
3474  return NULL;
3475  }
3476  int i;
3477  ideal idOp = idInit(I->ncols, I->rank);
3478  for (i=0; i< (I->ncols)*(I->nrows); i++)
3479  {
3480  idOp->m[i] = pOppose(Rop,I->m[i], dst);
3481  }
3482  id_Test(idOp, dst);
3483  return idOp;
3484 }
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:3426
#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:3399
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

§ nc_BucketPolyRed_Z()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define NULL
Definition: omList.c:10

§ nc_CallPlural()

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 2746 of file old.gring.cc.

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

§ nc_CheckSubalgebra()

BOOLEAN nc_CheckSubalgebra ( poly  PolyVar,
ring  r 
)

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

2633 {
2634 // ring save = currRing;
2635 // int WeChangeRing = 0;
2636 // if (currRing != r)
2637 // rChangeCurrRing(r);
2638 // WeChangeRing = 1;
2639 // }
2640  int rN=r->N;
2641  int *ExpVar=(int*)omAlloc0((rN+1)*sizeof(int));
2642  int *ExpTmp=(int*)omAlloc0((rN+1)*sizeof(int));
2643  p_GetExpV(PolyVar, ExpVar, r);
2644  int i; int j; int k;
2645  poly test=NULL;
2646  int OK=1;
2647  for (i=1; i<rN; i++)
2648  {
2649  if (ExpVar[i]==0) /* i.e. not in PolyVar */
2650  {
2651  for (j=i+1; j<=rN; j++)
2652  {
2653  if (ExpVar[j]==0)
2654  {
2655  test = MATELEM(r->GetNC()->D,i,j);
2656  while (test!=NULL)
2657  {
2658  p_GetExpV(test, ExpTmp, r);
2659  OK=1;
2660  for (k=1;k<=rN;k++)
2661  {
2662  if (ExpTmp[k]!=0)
2663  {
2664  if (ExpVar[k]!=0) OK=0;
2665  }
2666  }
2667  if (!OK)
2668  {
2669 // if ( WeChangeRing )
2670 // rChangeCurrRing(save);
2671  return(TRUE);
2672  }
2673  pIter(test);
2674  }
2675  }
2676  }
2677  }
2678  }
2679  freeT(ExpVar,rN);
2680  freeT(ExpTmp,rN);
2681 // if ( WeChangeRing )
2682 // rChangeCurrRing(save);
2683  return(FALSE);
2684 }
#define FALSE
Definition: auxiliary.h:95
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1443
#define TRUE
Definition: auxiliary.h:99
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:106
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define MATELEM(mat, i, j)
Definition: matpol.h:29

§ nc_CreateShortSpoly()

poly nc_CreateShortSpoly ( poly  p1,
poly  p2,
const ring  r 
)

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

1939 {
1940 #ifdef PDEBUG
1941  p_Test(p1, r);
1942  p_Test(p2, r);
1943 #endif
1944 
1945  const long lCompP1 = p_GetComp(p1,r);
1946  const long lCompP2 = p_GetComp(p2,r);
1947 
1948  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
1949  {
1950 #ifdef PDEBUG
1951  WerrorS("nc_CreateShortSpoly: wrong module components!"); // !!!!
1952 #endif
1953  return(NULL);
1954  }
1955 
1956  poly m;
1957 
1958 #ifdef HAVE_RATGRING
1959  if ( rIsRatGRing(r))
1960  {
1961  /* rational version */
1962  m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
1963  } else
1964 #endif
1965  {
1966  m = p_Lcm(p1, p2, si_max(lCompP1, lCompP2), r);
1967  }
1968 
1969 // n_Delete(&p_GetCoeff(m, r), r->cf);
1970 // pSetCoeff0(m, NULL);
1971 
1972 #ifdef PDEBUG
1973 // p_Test(m,r);
1974 #endif
1975 
1976  return(m);
1977 }
poly p_Lcm(const poly a, const poly b, const long lCompM, const ring r)
Definition: old.gring.cc:159
#define p_GetComp(p, r)
Definition: monomials.h:72
static BOOLEAN rIsRatGRing(const ring r)
Definition: ring.h:415
void WerrorS(const char *s)
Definition: feFopen.cc:24
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:1598
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:121
#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

§ nc_CreateSpoly()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202

§ nc_kBucketPolyRed()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define NULL
Definition: omList.c:10

§ nc_mm_Mult_p()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10

§ nc_mm_Mult_pp()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10

§ nc_p_Bracket_qq()

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

returns [p,q], destroys p

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

2308 {
2309  assume(p != NULL && q!= NULL);
2310 
2311  if (!rIsPluralRing(r)) return(NULL);
2312  if (p_ComparePolys(p,q, r)) return(NULL);
2313  /* Components !? */
2314  poly Q=NULL;
2315  number coef=NULL;
2316  poly pres=NULL;
2317  int UseBuckets=1;
2318  if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2))
2320  UseBuckets=0;
2321 
2322 
2323  CPolynomialSummator sum(r, UseBuckets == 0);
2324 
2325  while (p!=NULL)
2326  {
2327  Q=q;
2328  while(Q!=NULL)
2329  {
2330  pres=nc_mm_Bracket_nn(p,Q, r); /* since no coeffs are taken into account there */
2331  if (pres!=NULL)
2332  {
2333  coef = n_Mult(pGetCoeff(p),pGetCoeff(Q), r->cf);
2334  pres = p_Mult_nn(pres,coef,r);
2335 
2336  sum += pres;
2337  n_Delete(&coef, r->cf);
2338  }
2339  pIter(Q);
2340  }
2341  p=p_LmDeleteAndNext(p, r);
2342  }
2343  return(sum);
2344 }
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:2348
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:4384
return P p
Definition: myNF.cc:203
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:22
#define Q
Definition: sirandom.c:25
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#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:640
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
static unsigned pLength(poly a)
Definition: p_polys.h:189
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(...
Definition: summator.h:29
polyrec * poly
Definition: hilb.h:10

§ nc_p_Minus_mm_Mult_qq()

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 208 of file old.gring.cc.

210 {
211  poly mc = p_Neg( p_Copy(m, r), r );
212  poly mmc = nc_mm_Mult_pp( mc, q, r );
213  p_Delete(&mc, r);
214 
215  int org_p=pLength(p);
216  int org_q=pLength(q);
217 
218  p = p_Add_q(p, mmc, r);
219 
220  shorter = pLength(p)-org_p-org_q; // ring independent!
221 
222  return(p);
223 }
return P p
Definition: myNF.cc:203
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static unsigned pLength(poly a)
Definition: p_polys.h:189
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1013
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:877

§ nc_p_Plus_mm_Mult_qq()

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 226 of file old.gring.cc.

228 {
229  p = p_Add_q(p, nc_mm_Mult_pp( m, q, r ), r);
230 
231  lp = pLength(p);
232 
233  return(p);
234 }
return P p
Definition: myNF.cc:203
const ring r
Definition: syzextra.cc:208
int m
Definition: cfEzgcd.cc:119
static unsigned pLength(poly a)
Definition: p_polys.h:189
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:877

§ nc_p_ProcsSet()

void nc_p_ProcsSet ( ring  rGR,
p_Procs_s p_Procs 
)

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

3264 {
3265  assume(rIsPluralRing(rGR));
3266  assume(p_Procs!=NULL);
3267 
3268  gnc_p_ProcsSet(rGR, p_Procs);
3269 
3270  if(rIsSCA(rGR) && ncExtensions(SCAMASK) )
3271  {
3272  sca_p_ProcsSet(rGR, p_Procs);
3273  }
3274 
3275  if( ncExtensions(NOPLURALMASK) )
3277 
3278  if(!rIsSCA(rGR) && !ncExtensions(NOFORMULAMASK))
3280 
3281 }
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
void sca_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: sca.cc:1238
#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:266
const int NOPLURALMASK
Definition: nc.h:369
bool ncInitSpecialPowersMultiplication(ring r)
Definition: ncSAFormula.cc:50
static void gnc_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: old.gring.cc:3199
const int NOFORMULAMASK
Definition: nc.h:370
bool ncExtensions(int iMask)
Definition: old.gring.cc:99

§ nc_PolyPolyRed()

void nc_PolyPolyRed ( poly b,
poly  p,
number *  c,
const ring  r 
)

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

2295 {
2296 #if 0
2297  nc_PolyPolyRedOld(b, p, c, r);
2298 #else
2299  nc_PolyPolyRedNew(b, p, c, r);
2300 #endif
2301 }
return P p
Definition: myNF.cc:203
void nc_PolyPolyRedNew(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2194
const ring r
Definition: syzextra.cc:208
void nc_PolyPolyRedOld(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2160
const poly b
Definition: syzextra.cc:213

§ nc_PrintMat()

matrix nc_PrintMat ( int  a,
int  b,
ring  r,
int  metric 
)

returns matrix with the info on noncomm multiplication

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

2459 {
2460 
2461  if ( (a==b) || !rIsPluralRing(r) ) return(NULL);
2462  int i;
2463  int j;
2464  if (a>b) {j=b; i=a;}
2465  else {j=a; i=b;}
2466  /* i<j */
2467  int rN=r->N;
2468  int size=r->GetNC()->MTsize[UPMATELEM(i,j,rN)];
2469  matrix M = r->GetNC()->MT[UPMATELEM(i,j,rN)];
2470  /* return(M); */
2471 /*
2472  int sizeofres;
2473  if (metric==0)
2474  {
2475  sizeofres=sizeof(int);
2476  }
2477  if (metric==1)
2478  {
2479  sizeofres=sizeof(number);
2480  }
2481 */
2482  matrix res=mpNew(size,size);
2483  int s;
2484  int t;
2485  int length;
2486  long totdeg;
2487  poly p;
2488  for(s=1;s<=size;s++)
2489  {
2490  for(t=1;t<=size;t++)
2491  {
2492  p=MATELEM(M,s,t);
2493  if (p==NULL)
2494  {
2495  MATELEM(res,s,t)=0;
2496  }
2497  else
2498  {
2499  length = pLength(p);
2500  if (metric==0) /* length */
2501  {
2502  MATELEM(res,s,t)= p_ISet(length,r);
2503  }
2504  else if (metric==1) /* sum of deg divided by the length */
2505  {
2506  totdeg=0;
2507  while (p!=NULL)
2508  {
2509  totdeg=totdeg+p_Deg(p,r);
2510  pIter(p);
2511  }
2512  number ntd = n_Init(totdeg, r->cf);
2513  number nln = n_Init(length, r->cf);
2514  number nres= n_Div(ntd,nln, r->cf);
2515  n_Delete(&ntd, r->cf);
2516  n_Delete(&nln, r->cf);
2517  MATELEM(res,s,t)=p_NSet(nres,r);
2518  }
2519  }
2520  }
2521  }
2522  return(res);
2523 }
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:1442
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:542
#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:404
int i
Definition: cfEzgcd.cc:123
static unsigned pLength(poly a)
Definition: p_polys.h:189
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:47
#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:619
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
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:1296
#define UPMATELEM(i, j, nVar)
Definition: nc.h:44
#define MATELEM(mat, i, j)
Definition: matpol.h:29

§ nc_pSubst()

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 3287 of file old.gring.cc.

3288 {
3289  int rN = r->N;
3290  int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
3291  int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
3292  int i,pow;
3293  number C;
3294  poly suf,pre;
3295  poly res = NULL;
3296  poly out = NULL;
3297  while ( p!= NULL )
3298  {
3299  C = p_GetCoeff(p, r);
3300  p_GetExpV(p, PRE, r); /* faster splitting? */
3301  pow = PRE[n]; PRE[n]=0;
3302  res = NULL;
3303  if (pow!=0)
3304  {
3305  for (i=n+1; i<=rN; i++)
3306  {
3307  SUF[i] = PRE[i];
3308  PRE[i] = 0;
3309  }
3310  res = p_Power(p_Copy(e, r),pow, r);
3311  /* multiply with prefix */
3312  pre = p_One(r);
3313  p_SetExpV(pre,PRE, r);
3314  p_Setm(pre, r);
3315  res = nc_mm_Mult_p(pre,res, r);
3316  /* multiply with suffix */
3317  suf = p_One(r);
3318  p_SetExpV(suf,SUF, r);
3319  p_Setm(suf, r);
3320  res = p_Mult_mm(res,suf, r);
3321  res = p_Mult_nn(res,C, r);
3322  p_SetComp(res,PRE[0], r);
3323  }
3324  else /* pow==0 */
3325  {
3326  res = p_Head(p, r);
3327  }
3328  p = p_LmDeleteAndNext(p, r);
3329  out = p_Add_q(out,res, r);
3330  }
3331  freeT(PRE,rN);
3332  freeT(SUF,rN);
3333  return(out);
3334 }
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:968
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:1443
static void p_SetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1451
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
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:812
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1312
int i
Definition: cfEzgcd.cc:123
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
#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:106
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
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:2118
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ nc_rComplete()

BOOLEAN nc_rComplete ( const ring  src,
ring  dest,
bool  bSetupQuotient = true 
)

Definition at line 5492 of file ring.cc.

5497 {
5498 // NOTE: Originally used only by idElimination to transfer NC structure to dest
5499 // ring created by dirty hack (without nc_CallPlural)
5500  rTest(src);
5501 
5502  assume(!rIsPluralRing(dest)); // destination must be a newly constructed commutative ring
5503 
5504  if (!rIsPluralRing(src))
5505  {
5506  return FALSE;
5507  }
5508 
5509  const int N = dest->N;
5510 
5511  assume(src->N == N);
5512 
5513 // ring save = currRing;
5514 
5515 // if (dest != save)
5516 // rChangeCurrRing(dest);
5517 
5518  const ring srcBase = src;
5519 
5520  assume( n_SetMap(srcBase->cf,dest->cf) == n_SetMap(dest->cf,dest->cf) ); // currRing is important here!
5521 
5522  matrix C = mpNew(N,N); // ring independent
5523  matrix D = mpNew(N,N);
5524 
5525  matrix C0 = src->GetNC()->C;
5526  matrix D0 = src->GetNC()->D;
5527 
5528  // map C and D into dest
5529  for (int i = 1; i < N; i++)
5530  {
5531  for (int j = i + 1; j <= N; j++)
5532  {
5533  const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase->cf); // src, mapping for coeffs into currRing = dest!
5534  const poly p = p_NSet(n, dest);
5535  MATELEM(C,i,j) = p;
5536  if (MATELEM(D0,i,j) != NULL)
5537  MATELEM(D,i,j) = prCopyR(MATELEM(D0,i,j), srcBase, dest); // ?
5538  }
5539  }
5540  /* One must test C and D _only_ in r->GetNC()->basering!!! not in r!!! */
5541 
5542  id_Test((ideal)C, dest);
5543  id_Test((ideal)D, dest);
5544 
5545  if (nc_CallPlural(C, D, NULL, NULL, dest, bSetupQuotient, false, true, dest)) // also takes care about quotient ideal
5546  {
5547  //WarnS("Error transferring non-commutative structure");
5548  // error message should be in the interpreter interface
5549 
5550  mp_Delete(&C, dest);
5551  mp_Delete(&D, dest);
5552 
5553 // if (currRing != save)
5554 // rChangeCurrRing(save);
5555 
5556  return TRUE;
5557  }
5558 
5559 // mp_Delete(&C, dest); // used by nc_CallPlural!
5560 // mp_Delete(&D, dest);
5561 
5562 // if (dest != save)
5563 // rChangeCurrRing(save);
5564 
5565  assume(rIsPluralRing(dest));
5566  return FALSE;
5567 }
#define D(A)
Definition: gentable.cc:121
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define FALSE
Definition: auxiliary.h:95
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:1442
#define id_Test(A, lR)
Definition: simpleideals.h:80
#define TRUE
Definition: auxiliary.h:99
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define rTest(r)
Definition: ring.h:775
int i
Definition: cfEzgcd.cc:123
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:792
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:725
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:47
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:2746
#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:455
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10
#define MATELEM(mat, i, j)
Definition: matpol.h:29

§ nc_rCopy()

bool nc_rCopy ( ring  res,
const ring  r,
bool  bSetupQuotient 
)

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

3088 {
3089  if (nc_CallPlural(r->GetNC()->C, r->GetNC()->D, NULL, NULL, res, bSetupQuotient, true, true, r))
3090  {
3091  WarnS("Error occurred while coping/setuping the NC structure!"); // No reaction!???
3092  return true; // error
3093  }
3094 
3095  return false;
3096 }
#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:2746
#define NULL
Definition: omList.c:10

§ nc_ReduceSpoly()

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:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202

§ nc_rKill()

void nc_rKill ( ring  r)

complete destructor

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

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

§ nc_SetupQuotient()

bool nc_SetupQuotient ( ring  rGR,
const ring  rG = NULL,
bool  bCopy = false 
)

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

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

§ ncExtensions()

bool ncExtensions ( int  iMask)

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

100 {
101  return ((getNCExtensions() & iMask) == iMask);
102 }
int & getNCExtensions()
Definition: old.gring.cc:87

§ ncRingType() [1/4]

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:403
nc_type & ncRingType()
Definition: nc.h:124
#define NULL
Definition: omList.c:10

§ ncRingType() [2/4]

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:404
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175

§ ncRingType() [3/4]

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:403
#define NULL
Definition: omList.c:10
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175

§ ncRingType() [4/4]

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:403
#define NULL
Definition: omList.c:10
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175

§ p_Lcm() [1/2]

poly p_Lcm ( const poly  a,
const poly  b,
const long  lCompM,
const ring  r 
)

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

160 {
161  poly m = // p_One( r);
162  p_Init(r);
163 
164  const int pVariables = r->N;
165 
166  for (int i = pVariables; i!=0; i--)
167  {
168  const int lExpA = p_GetExp (a, i, r);
169  const int lExpB = p_GetExp (b, i, r);
170 
171  p_SetExp (m, i, si_max(lExpA, lExpB), r);
172  }
173 
174  p_SetComp (m, lCompM, r);
175 
176  p_Setm(m,r);
177 
178 #ifdef PDEBUG
179 // p_Test(m,r);
180 #endif
181 
182  n_New(&(p_GetCoeff(m, r)), r);
183 
184  return(m);
185 }
#define n_New(n, r)
Definition: coeffs.h:444
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:121
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:1243
const poly b
Definition: syzextra.cc:213

§ p_Lcm() [2/2]

poly p_Lcm ( const poly  a,
const poly  b,
const ring  r 
)

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

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

§ pOppose()

poly pOppose ( ring  Rop_src,
poly  p,
const ring  Rop_dst 
)

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

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

3427 {
3428  /* the simplest case:*/
3429  if ( Rop == dst ) return(p_Copy(p, dst));
3430  /* check Rop == rOpposite(currRing) */
3431 
3432 
3433  if ( !rIsLikeOpposite(dst, Rop) )
3434  {
3435  WarnS("an opposite ring should be used");
3436  return NULL;
3437  }
3438 
3439  nMapFunc nMap = n_SetMap(Rop->cf, dst->cf); // reverse?
3440 
3441  /* nMapFunc nMap = nSetMap(Rop);*/
3442  /* since we know that basefields coinside! */
3443 
3444  // coinside???
3445 
3446  int *perm=(int *)omAlloc0((Rop->N+1)*sizeof(int));
3447  if (!p_IsConstantPoly(p, Rop))
3448  {
3449  /* we know perm exactly */
3450  int i;
3451  for(i=1; i<=Rop->N; i++)
3452  {
3453  perm[i] = Rop->N+1-i;
3454  }
3455  }
3456  poly res = p_PermPoly(p, perm, Rop, dst, nMap);
3457  omFreeSize((ADDRESS)perm,(Rop->N+1)*sizeof(int));
3458 
3459  p_Test(res, dst);
3460 
3461  return res;
3462 }
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:116
#define WarnS
Definition: emacs.cc:81
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
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:3399
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:3938
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
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:725
#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:1890
polyrec * poly
Definition: hilb.h:10
int perm[100]
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ rIsLikeOpposite()

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 3399 of file old.gring.cc.

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

§ rIsSCA()

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:404
Definition: nc.h:29
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175

§ setNCExtensions()

int setNCExtensions ( int  iMask)

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

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

Variable Documentation

§ GENERICMASK

const int GENERICMASK = 0x000

Definition at line 354 of file nc.h.

§ NOCACHEMASK

const int NOCACHEMASK = 0x008

Definition at line 371 of file nc.h.

§ NOFORMULAMASK

const int NOFORMULAMASK =0x004

Definition at line 370 of file nc.h.

§ NOPLURALMASK

const int NOPLURALMASK = 0x002

Definition at line 369 of file nc.h.

§ SCAMASK

const int SCAMASK = 0x001

Definition at line 355 of file nc.h.

§ TESTSYZSCAMASK

const int TESTSYZSCAMASK = 0x0100 | SCAMASK

Definition at line 373 of file nc.h.