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

221 {
222  assume( rIsPluralRing(rRing) );
223 #ifdef PDEBUG
224  p_Test(pPolyP, rRing);
225  p_Test(pPolyQ, rRing);
226 #endif
227 #ifdef RDEBUG
228  rTest(rRing);
229 #endif
230 
231  int lp, lq;
232 
233  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
234 
235  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
236 
237  CPolynomialSummator sum(rRing, bUsePolynomial);
238 
239  if (lq <= lp) // ?
240  {
241  // always length(q) times "p * q[j]"
242  for( ; pPolyQ!=NULL; pPolyQ = p_LmDeleteAndNext( pPolyQ, rRing ) )
243  sum += pp_Mult_mm( pPolyP, pPolyQ, rRing);
244 
245  p_Delete( &pPolyP, rRing );
246  } else
247  {
248  // always length(p) times "p[i] * q"
249  for( ; pPolyP!=NULL; pPolyP = p_LmDeleteAndNext( pPolyP, rRing ) )
250  sum += nc_mm_Mult_pp( pPolyP, pPolyQ, rRing);
251 
252  p_Delete( &pPolyQ, rRing );
253  }
254 
255  return(sum);
256 }
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:394
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define rTest(r)
Definition: ring.h:777
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
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 259 of file old.gring.cc.

260 {
261  assume( rIsPluralRing(rRing) );
262 #ifdef PDEBUG
263  p_Test(pPolyP, rRing);
264  p_Test(pPolyQ, rRing);
265 #endif
266 #ifdef RDEBUG
267  rTest(rRing);
268 #endif
269 
270  int lp, lq;
271 
272  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
273 
274  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
275 
276  CPolynomialSummator sum(rRing, bUsePolynomial);
277 
278  if (lq <= lp) // ?
279  {
280  // always length(q) times "p * q[j]"
281  for( poly q = pPolyQ; q !=NULL; q = pNext(q) )
282  sum += pp_Mult_mm(pPolyP, q, rRing);
283  } else
284  {
285  // always length(p) times "p[i] * q"
286  for( poly p = pPolyP; p !=NULL; p = pNext(p) )
287  sum += nc_mm_Mult_pp( p, pPolyQ, rRing);
288  }
289 
290  return(sum);
291 }
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:394
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define rTest(r)
Definition: ring.h:777
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
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 383 of file nc.h.

384 {
385  assume(r!= NULL && rIsPluralRing(r));
386  const matrix C = GetNC(r)->C;
387  assume(C != NULL);
388  const int ncols = C->ncols;
389  assume( (i > 0) && (i < j) && (j <= ncols) );
390  return ( C->m[ncols * ((i)-1) + (j)-1] );
391 }
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:394
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 394 of file nc.h.

395 {
396  assume(r!= NULL && rIsPluralRing(r));
397  const matrix D = GetNC(r)->D;
398  assume(D != NULL);
399  const int ncols = D->ncols;
400  assume( (i > 0) && (i < j) && (j <= ncols) );
401  return ( D->m[ncols * ((i)-1) + (j)-1] );
402 }
#define D(A)
Definition: gentable.cc:123
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:394
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 3412 of file old.gring.cc.

3413 {
3414  /* the simplest case:*/
3415  if ( Rop == dst ) return id_Copy(I, dst);
3416 
3417  /* check Rop == rOpposite(currRing) */
3418  if (!rIsLikeOpposite(dst, Rop))
3419  {
3420  WarnS("an opposite ring should be used");
3421  return NULL;
3422  }
3423  int i;
3424  ideal idOp = idInit(I->ncols, I->rank);
3425  for (i=0; i< (I->ncols)*(I->nrows); i++)
3426  {
3427  idOp->m[i] = pOppose(Rop,I->m[i], dst);
3428  }
3429  id_Test(idOp, dst);
3430  return idOp;
3431 }
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:3373
#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:3346
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:394
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 2693 of file old.gring.cc.

2698 {
2699  assume( r != NULL );
2700  assume( curr != NULL );
2701 
2702  if( !bSetupQuotient)
2703  assume( (r->qideal == NULL) ); // The basering must NOT be a qring!??
2704 
2705  assume( rSamePolyRep(r, curr) || bCopyInput ); // wrong assumption?
2706 
2707 
2708  if( r->N == 1 ) // clearly commutative!!!
2709  {
2710  assume(
2711  ( (CCC != NULL) && (MATCOLS(CCC) == 1) && (MATROWS(CCC) == 1) && (MATELEM(CCC,1,1) == NULL) ) ||
2712  ( (CCN == NULL) )
2713  );
2714 
2715  assume(
2716  ( (DDD != NULL) && (MATCOLS(DDD) == 1) && (MATROWS(DDD) == 1) && (MATELEM(DDD,1,1) == NULL) ) ||
2717  ( (DDN == NULL) )
2718  );
2719  if(!dummy_ring)
2720  {
2721  WarnS("commutative ring with 1 variable");
2722  return FALSE;
2723  }
2724  }
2725 
2726  // there must be:
2727  assume( (CCC != NULL) != (CCN != NULL) ); // exactly one data about coeffs (C).
2728  assume( !((DDD != NULL) && (DDN != NULL)) ); // at most one data about tails (D).
2729 
2730 // ring save = currRing;
2731 // if( save != curr )
2732 // rChangeCurrRing(curr);
2733 
2734 
2735 #if OUTPUT
2736  if( CCC != NULL )
2737  {
2738  PrintS("nc_CallPlural(), Input data, CCC: \n");
2739  iiWriteMatrix(CCC, "C", 2, curr, 4);
2740  }
2741  if( DDD != NULL )
2742  {
2743  PrintS("nc_CallPlural(), Input data, DDD: \n");
2744  iiWriteMatrix(DDD, "D", 2, curr, 4);
2745  }
2746 #endif
2747 
2748 
2749 #ifndef SING_NDEBUG
2750  if (CCC!=NULL) id_Test((ideal)CCC, curr);
2751  if (DDD!=NULL) id_Test((ideal)DDD, curr);
2752  p_Test(CCN, curr);
2753  p_Test(DDN, curr);
2754 #endif
2755 
2756  if( (!bBeQuiet) && (r->GetNC() != NULL) )
2757  WarnS("going to redefine the algebra structure");
2758 
2759 // if( currRing != r )
2760 // rChangeCurrRing(r);
2761 
2762  matrix CC = NULL;
2763  poly CN = NULL;
2764  matrix C; bool bCnew = false;
2765 
2766  matrix DD = NULL;
2767  poly DN = NULL;
2768  matrix D; bool bDnew = false;
2769 
2770  number nN, pN, qN;
2771 
2772  bool IsSkewConstant = false, tmpIsSkewConstant;
2773  int i, j;
2774 
2775  nc_type nctype = nc_undef;
2776 
2777  //////////////////////////////////////////////////////////////////
2778  // check the correctness of arguments, without any real chagnes!!!
2779 
2780 
2781 
2782  // check C
2783  if ((CCC != NULL) && ( (MATCOLS(CCC)==1) || MATROWS(CCC)==1 ) )
2784  {
2785  CN = MATELEM(CCC,1,1);
2786  }
2787  else
2788  {
2789  if ((CCC != NULL) && ( (MATCOLS(CCC)!=r->N) || (MATROWS(CCC)!=r->N) ))
2790  {
2791  Werror("Square %d x %d matrix expected", r->N, r->N);
2792 
2793 // if( currRing != save )
2794 // rChangeCurrRing(save);
2795  return TRUE;
2796  }
2797  }
2798  if (( CCC != NULL) && (CC == NULL)) CC = CCC; // mp_Copy(CCC, ?); // bug!?
2799  if (( CCN != NULL) && (CN == NULL)) CN = CCN;
2800 
2801  // check D
2802  if ((DDD != NULL) && ( (MATCOLS(DDD)==1) || MATROWS(DDD)==1 ) )
2803  {
2804  DN = MATELEM(DDD,1,1);
2805  }
2806  else
2807  {
2808  if ((DDD != NULL) && ( (MATCOLS(DDD)!=r->N) || (MATROWS(DDD)!=r->N) ))
2809  {
2810  Werror("Square %d x %d matrix expected",r->N,r->N);
2811 
2812 // if( currRing != save )
2813 // rChangeCurrRing(save);
2814  return TRUE;
2815  }
2816  }
2817 
2818  if (( DDD != NULL) && (DD == NULL)) DD = DDD; // mp_Copy(DDD, ?); // ???
2819  if (( DDN != NULL) && (DN == NULL)) DN = DDN;
2820 
2821  // further checks and some analysis:
2822  // all data in 'curr'!
2823  if (CN != NULL) /* create matrix C = CN * Id */
2824  {
2825  if (!p_IsConstant(CN,curr))
2826  {
2827  WerrorS("Incorrect input : non-constants are not allowed as coefficients (first argument)");
2828  return TRUE;
2829  }
2830  assume(p_IsConstant(CN,curr));
2831 
2832  nN = pGetCoeff(CN);
2833  if (n_IsZero(nN, curr->cf))
2834  {
2835  WerrorS("Incorrect input : zero coefficients are not allowed");
2836 
2837 // if( currRing != save )
2838 // rChangeCurrRing(save);
2839  return TRUE;
2840  }
2841 
2842  if (n_IsOne(nN, curr->cf))
2843  nctype = nc_lie;
2844  else
2845  nctype = nc_general;
2846 
2847  IsSkewConstant = true;
2848 
2849  C = mpNew(r->N,r->N); // ring independent!
2850  bCnew = true;
2851 
2852  for(i=1; i<r->N; i++)
2853  for(j=i+1; j<=r->N; j++)
2854  MATELEM(C,i,j) = prCopyR_NoSort(CN, curr, r); // nc_p_CopyPut(CN, r); // copy CN from curr into r
2855 
2856 #ifndef SING_NDEBUG
2857  id_Test((ideal)C, r);
2858 #endif
2859 
2860  } else
2861  if ( (CN == NULL) && (CC != NULL) ) /* copy matrix C */
2862  {
2863  /* analyze C */
2864 
2865  pN = NULL; /* check the consistency later */
2866 
2867  if( r->N > 1 )
2868  if ( MATELEM(CC,1,2) != NULL )
2869  pN = p_GetCoeff(MATELEM(CC,1,2), curr);
2870 
2871  tmpIsSkewConstant = true;
2872 
2873  for(i=1; i<r->N; i++)
2874  for(j=i+1; j<=r->N; j++)
2875  {
2876  if (MATELEM(CC,i,j) == NULL)
2877  qN = NULL;
2878  else
2879  {
2880  if (!p_IsConstant(MATELEM(CC,i,j),curr))
2881  {
2882  Werror("Incorrect input : non-constants are not allowed as coefficients (first argument at [%d, %d])", i, j);
2883  return TRUE;
2884  }
2885  assume(p_IsConstant(MATELEM(CC,i,j),curr));
2886  qN = p_GetCoeff(MATELEM(CC,i,j),curr);
2887  }
2888 
2889 
2890  if ( qN == NULL ) /* check the consistency: Cij!=0 */
2891  // find also illegal pN
2892  {
2893  WerrorS("Incorrect input : matrix of coefficients contains zeros in the upper triangle");
2894 
2895 // if( currRing != save )
2896 // rChangeCurrRing(save);
2897  return TRUE;
2898  }
2899 
2900  if (!n_Equal(pN, qN, curr->cf)) tmpIsSkewConstant = false;
2901  }
2902 
2903  if( bCopyInput )
2904  {
2905  C = mp_Copy(CC, curr, r); // Copy C into r!!!???
2906 #ifndef SING_NDEBUG
2907  id_Test((ideal)C, r);
2908 #endif
2909  bCnew = true;
2910  }
2911  else
2912  C = CC;
2913 
2914  IsSkewConstant = tmpIsSkewConstant;
2915 
2916  if ( tmpIsSkewConstant && n_IsOne(pN, curr->cf) )
2917  nctype = nc_lie;
2918  else
2919  nctype = nc_general;
2920  }
2921 
2922  /* initialition of the matrix D */
2923  if ( DD == NULL ) /* we treat DN only (it could also be NULL) */
2924  {
2925  D = mpNew(r->N,r->N); bDnew = true;
2926 
2927  if (DN == NULL)
2928  {
2929  if ( (nctype == nc_lie) || (nctype == nc_undef) )
2930  nctype = nc_comm; /* it was nc_skew earlier */
2931  else /* nc_general, nc_skew */
2932  nctype = nc_skew;
2933  }
2934  else /* DN != NULL */
2935  for(i=1; i<r->N; i++)
2936  for(j=i+1; j<=r->N; j++)
2937  MATELEM(D,i,j) = prCopyR_NoSort(DN, curr, r); // project DN into r->GetNC()->basering!
2938 #ifndef SING_NDEBUG
2939  id_Test((ideal)D, r);
2940 #endif
2941  }
2942  else /* DD != NULL */
2943  {
2944  bool b = true; // DD == null ?
2945 
2946  for(int i = 1; (i < r->N) && b; i++)
2947  for(int j = i+1; (j <= r->N) && b; j++)
2948  if (MATELEM(DD, i, j) != NULL)
2949  {
2950  b = false;
2951  break;
2952  }
2953 
2954  if (b) // D == NULL!!!
2955  {
2956  if ( (nctype == nc_lie) || (nctype == nc_undef) )
2957  nctype = nc_comm; /* it was nc_skew earlier */
2958  else /* nc_general, nc_skew */
2959  nctype = nc_skew;
2960  }
2961 
2962  if( bCopyInput )
2963  {
2964  D = mp_Copy(DD, curr, r); // Copy DD into r!!!
2965 #ifndef SING_NDEBUG
2966  id_Test((ideal)D, r);
2967 #endif
2968  bDnew = true;
2969  }
2970  else
2971  D = DD;
2972  }
2973 
2974  assume( C != NULL );
2975  assume( D != NULL );
2976 
2977 #if OUTPUT
2978  PrintS("nc_CallPlural(), Computed data, C: \n");
2979  iiWriteMatrix(C, "C", 2, r, 4);
2980 
2981  PrintS("nc_CallPlural(), Computed data, D: \n");
2982  iiWriteMatrix(D, "D", 2, r, 4);
2983 
2984  Print("\nTemporary: type = %d, IsSkewConstant = %d\n", nctype, IsSkewConstant);
2985 #endif
2986 
2987 
2988  // check the ordering condition for D (both matrix and poly cases):
2989  if ( gnc_CheckOrdCondition(D, r) )
2990  {
2991  if( bCnew ) mp_Delete( &C, r );
2992  if( bDnew ) mp_Delete( &D, r );
2993 
2994  WerrorS("Matrix of polynomials violates the ordering condition");
2995 
2996 // if( currRing != save )
2997 // rChangeCurrRing(save);
2998  return TRUE;
2999  }
3000 
3001  // okay now we are ready for this!!!
3002 
3003  // create new non-commutative structure
3004  nc_struct *nc_new = (nc_struct *)omAlloc0(sizeof(nc_struct));
3005 
3006  ncRingType(nc_new, nctype);
3007 
3008  nc_new->C = C; // if C and D were given by matrices at the beginning they are in r
3009  nc_new->D = D; // otherwise they should be in r->GetNC()->basering(polynomial * Id_{N})
3010 
3011  nc_new->IsSkewConstant = (IsSkewConstant?1:0);
3012 
3013  // Setup new NC structure!!!
3014  if (r->GetNC() != NULL)
3015  {
3016 #ifndef SING_NDEBUG
3017  WarnS("Changing the NC-structure of an existing NC-ring!!!");
3018 #endif
3019  nc_rKill(r);
3020  }
3021 
3022  r->GetNC() = nc_new;
3023 
3024  r->ext_ref=NULL;
3025 
3026 // if( currRing != save )
3027 // rChangeCurrRing(save);
3028 
3029  return gnc_InitMultiplication(r, bSetupQuotient);
3030 }
#define D(A)
Definition: gentable.cc:123
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:2486
#define FALSE
Definition: auxiliary.h:94
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:98
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:743
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:394
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:1677
BOOLEAN gnc_InitMultiplication(ring r, bool bSetupQuotient=false)
Definition: old.gring.cc:3046
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:789
#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:44
BOOLEAN gnc_CheckOrdCondition(matrix D, ring r)
Definition: old.gring.cc:2638
#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:71
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 2579 of file old.gring.cc.

2580 {
2581 // ring save = currRing;
2582 // int WeChangeRing = 0;
2583 // if (currRing != r)
2584 // rChangeCurrRing(r);
2585 // WeChangeRing = 1;
2586 // }
2587  int rN=r->N;
2588  int *ExpVar=(int*)omAlloc0((rN+1)*sizeof(int));
2589  int *ExpTmp=(int*)omAlloc0((rN+1)*sizeof(int));
2590  p_GetExpV(PolyVar, ExpVar, r);
2591  int i; int j; int k;
2592  poly test=NULL;
2593  int OK=1;
2594  for (i=1; i<rN; i++)
2595  {
2596  if (ExpVar[i]==0) /* i.e. not in PolyVar */
2597  {
2598  for (j=i+1; j<=rN; j++)
2599  {
2600  if (ExpVar[j]==0)
2601  {
2602  test = MATELEM(r->GetNC()->D,i,j);
2603  while (test!=NULL)
2604  {
2605  p_GetExpV(test, ExpTmp, r);
2606  OK=1;
2607  for (k=1;k<=rN;k++)
2608  {
2609  if (ExpTmp[k]!=0)
2610  {
2611  if (ExpVar[k]!=0) OK=0;
2612  }
2613  }
2614  if (!OK)
2615  {
2616 // if ( WeChangeRing )
2617 // rChangeCurrRing(save);
2618  return(TRUE);
2619  }
2620  pIter(test);
2621  }
2622  }
2623  }
2624  }
2625  }
2626  freeT(ExpVar,rN);
2627  freeT(ExpTmp,rN);
2628 // if ( WeChangeRing )
2629 // rChangeCurrRing(save);
2630  return(FALSE);
2631 }
#define FALSE
Definition: auxiliary.h:94
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1443
#define TRUE
Definition: auxiliary.h:98
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 1885 of file old.gring.cc.

1886 {
1887 #ifdef PDEBUG
1888  p_Test(p1, r);
1889  p_Test(p2, r);
1890 #endif
1891 
1892  const long lCompP1 = p_GetComp(p1,r);
1893  const long lCompP2 = p_GetComp(p2,r);
1894 
1895  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
1896  {
1897 #ifdef PDEBUG
1898  WerrorS("nc_CreateShortSpoly: wrong module components!"); // !!!!
1899 #endif
1900  return(NULL);
1901  }
1902 
1903  poly m;
1904 
1905 #ifdef HAVE_RATGRING
1906  if ( rIsRatGRing(r))
1907  {
1908  /* rational version */
1909  m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
1910  } else
1911 #endif
1912  {
1913  m = p_Lcm(p1, p2, r);
1914  }
1915 
1916 // n_Delete(&p_GetCoeff(m, r), r->cf);
1917 // pSetCoeff0(m, NULL);
1918 
1919 #ifdef PDEBUG
1920 // p_Test(m,r);
1921 #endif
1922 
1923  return(m);
1924 }
#define p_GetComp(p, r)
Definition: monomials.h:72
static BOOLEAN rIsRatGRing(const ring r)
Definition: ring.h:415
void p_Lcm(const poly a, const poly b, poly m, const ring r)
Definition: p_polys.cc:1616
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:1638
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:120
#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:394
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:394
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:394
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:394
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 2254 of file old.gring.cc.

2255 {
2256  assume(p != NULL && q!= NULL);
2257 
2258  if (!rIsPluralRing(r)) return(NULL);
2259  if (p_ComparePolys(p,q, r)) return(NULL);
2260  /* Components !? */
2261  poly Q=NULL;
2262  number coef=NULL;
2263  poly pres=NULL;
2264  int UseBuckets=1;
2265  if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2))
2267  UseBuckets=0;
2268 
2269 
2270  CPolynomialSummator sum(r, UseBuckets == 0);
2271 
2272  while (p!=NULL)
2273  {
2274  Q=q;
2275  while(Q!=NULL)
2276  {
2277  pres=nc_mm_Bracket_nn(p,Q, r); /* since no coeffs are taken into account there */
2278  if (pres!=NULL)
2279  {
2280  coef = n_Mult(pGetCoeff(p),pGetCoeff(Q), r->cf);
2281  pres = p_Mult_nn(pres,coef,r);
2282 
2283  sum += pres;
2284  n_Delete(&coef, r->cf);
2285  }
2286  pIter(Q);
2287  }
2288  p=p_LmDeleteAndNext(p, r);
2289  }
2290  return(sum);
2291 }
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:2295
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:4431
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:394
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 155 of file old.gring.cc.

157 {
158  poly mc = p_Neg( p_Copy(m, r), r );
159  poly mmc = nc_mm_Mult_pp( mc, q, r );
160  p_Delete(&mc, r);
161 
162  int org_p=pLength(p);
163  int org_q=pLength(q);
164 
165  p = p_Add_q(p, mmc, r);
166 
167  shorter = pLength(p)-org_p-org_q; // ring independent!
168 
169  return(p);
170 }
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 173 of file old.gring.cc.

175 {
176  p = p_Add_q(p, nc_mm_Mult_pp( m, q, r ), r);
177 
178  lp = pLength(p);
179 
180  return(p);
181 }
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 3210 of file old.gring.cc.

3211 {
3212  assume(rIsPluralRing(rGR));
3213  assume(p_Procs!=NULL);
3214 
3215  gnc_p_ProcsSet(rGR, p_Procs);
3216 
3217  if(rIsSCA(rGR) && ncExtensions(SCAMASK) )
3218  {
3219  sca_p_ProcsSet(rGR, p_Procs);
3220  }
3221 
3222  if( ncExtensions(NOPLURALMASK) )
3224 
3225  if(!rIsSCA(rGR) && !ncExtensions(NOFORMULAMASK))
3227 
3228 }
#define assume(x)
Definition: mod2.h:394
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:341
static bool rIsSCA(const ring r)
Definition: nc.h:206
BOOLEAN ncInitSpecialPairMultiplication(ring r)
Definition: ncSAMult.cc:266
const int NOPLURALMASK
Definition: nc.h:355
bool ncInitSpecialPowersMultiplication(ring r)
Definition: ncSAFormula.cc:50
static void gnc_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: old.gring.cc:3146
const int NOFORMULAMASK
Definition: nc.h:356
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 2241 of file old.gring.cc.

2242 {
2243 #if 0
2244  nc_PolyPolyRedOld(b, p, c, r);
2245 #else
2246  nc_PolyPolyRedNew(b, p, c, r);
2247 #endif
2248 }
return P p
Definition: myNF.cc:203
void nc_PolyPolyRedNew(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2141
const ring r
Definition: syzextra.cc:208
void nc_PolyPolyRedOld(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2107
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 2405 of file old.gring.cc.

2406 {
2407 
2408  if ( (a==b) || !rIsPluralRing(r) ) return(NULL);
2409  int i;
2410  int j;
2411  if (a>b) {j=b; i=a;}
2412  else {j=a; i=b;}
2413  /* i<j */
2414  int rN=r->N;
2415  int size=r->GetNC()->MTsize[UPMATELEM(i,j,rN)];
2416  matrix M = r->GetNC()->MT[UPMATELEM(i,j,rN)];
2417  /* return(M); */
2418 /*
2419  int sizeofres;
2420  if (metric==0)
2421  {
2422  sizeofres=sizeof(int);
2423  }
2424  if (metric==1)
2425  {
2426  sizeofres=sizeof(number);
2427  }
2428 */
2429  matrix res=mpNew(size,size);
2430  int s;
2431  int t;
2432  int length;
2433  long totdeg;
2434  poly p;
2435  for(s=1;s<=size;s++)
2436  {
2437  for(t=1;t<=size;t++)
2438  {
2439  p=MATELEM(M,s,t);
2440  if (p==NULL)
2441  {
2442  MATELEM(res,s,t)=0;
2443  }
2444  else
2445  {
2446  length = pLength(p);
2447  if (metric==0) /* length */
2448  {
2449  MATELEM(res,s,t)= p_ISet(length,r);
2450  }
2451  else if (metric==1) /* sum of deg divided by the length */
2452  {
2453  totdeg=0;
2454  while (p!=NULL)
2455  {
2456  totdeg=totdeg+p_Deg(p,r);
2457  pIter(p);
2458  }
2459  number ntd = n_Init(totdeg, r->cf);
2460  number nln = n_Init(length, r->cf);
2461  number nres= n_Div(ntd,nln, r->cf);
2462  n_Delete(&ntd, r->cf);
2463  n_Delete(&nln, r->cf);
2464  MATELEM(res,s,t)=p_NSet(nres,r);
2465  }
2466  }
2467  }
2468  }
2469  return(res);
2470 }
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:1444
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:588
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:44
#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:1298
#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 3234 of file old.gring.cc.

3235 {
3236  int rN = r->N;
3237  int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
3238  int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
3239  int i,pow;
3240  number C;
3241  poly suf,pre;
3242  poly res = NULL;
3243  poly out = NULL;
3244  while ( p!= NULL )
3245  {
3246  C = p_GetCoeff(p, r);
3247  p_GetExpV(p, PRE, r); /* faster splitting? */
3248  pow = PRE[n]; PRE[n]=0;
3249  res = NULL;
3250  if (pow!=0)
3251  {
3252  for (i=n+1; i<=rN; i++)
3253  {
3254  SUF[i] = PRE[i];
3255  PRE[i] = 0;
3256  }
3257  res = p_Power(p_Copy(e, r),pow, r);
3258  /* multiply with prefix */
3259  pre = p_One(r);
3260  p_SetExpV(pre,PRE, r);
3261  p_Setm(pre, r);
3262  res = nc_mm_Mult_p(pre,res, r);
3263  /* multiply with suffix */
3264  suf = p_One(r);
3265  p_SetExpV(suf,SUF, r);
3266  p_Setm(suf, r);
3267  res = p_Mult_mm(res,suf, r);
3268  res = p_Mult_nn(res,C, r);
3269  p_SetComp(res,PRE[0], r);
3270  }
3271  else /* pow==0 */
3272  {
3273  res = p_Head(p, r);
3274  }
3275  p = p_LmDeleteAndNext(p, r);
3276  out = p_Add_q(out,res, r);
3277  }
3278  freeT(PRE,rN);
3279  freeT(SUF,rN);
3280  return(out);
3281 }
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:1314
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:2158
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ nc_rComplete()

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

Definition at line 5533 of file ring.cc.

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

3035 {
3036  if (nc_CallPlural(r->GetNC()->C, r->GetNC()->D, NULL, NULL, res, bSetupQuotient, true, true, r))
3037  {
3038  WarnS("Error occurred while coping/setuping the NC structure!"); // No reaction!???
3039  return true; // error
3040  }
3041 
3042  return false;
3043 }
#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:2693
#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:394
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 2486 of file old.gring.cc.

2488 {
2489  if( r->GetNC()->GetGlobalMultiplier() != NULL )
2490  {
2491  delete r->GetNC()->GetGlobalMultiplier();
2492  r->GetNC()->GetGlobalMultiplier() = NULL;
2493  }
2494 
2495  if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
2496  {
2497  delete r->GetNC()->GetFormulaPowerMultiplier();
2498  r->GetNC()->GetFormulaPowerMultiplier() = NULL;
2499  }
2500 
2501 
2502  int i,j;
2503  int rN=r->N;
2504  if ( rN > 1 )
2505  {
2506  for(i=1;i<rN;i++)
2507  {
2508  for(j=i+1;j<=rN;j++)
2509  {
2510  id_Delete((ideal *)&(r->GetNC()->MT[UPMATELEM(i,j,rN)]),r);
2511  }
2512  }
2513  omFreeSize((ADDRESS)r->GetNC()->MT,rN*(rN-1)/2*sizeof(matrix));
2514  omFreeSize((ADDRESS)r->GetNC()->MTsize,rN*(rN-1)/2*sizeof(int));
2515  id_Delete((ideal *)&(r->GetNC()->COM),r);
2516  }
2517  id_Delete((ideal *)&(r->GetNC()->C),r);
2518  id_Delete((ideal *)&(r->GetNC()->D),r);
2519 
2520  if( rIsSCA(r) && (r->GetNC()->SCAQuotient() != NULL) )
2521  {
2522  id_Delete(&r->GetNC()->SCAQuotient(), r); // Custom SCA destructor!!!
2523  }
2524 
2525 
2526  nc_CleanUp(r);
2527 }
#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:115
void nc_CleanUp(nc_struct *p)
Definition: old.gring.cc:2472
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 3434 of file old.gring.cc.

3435 {
3436  if( rGR->qideal == NULL )
3437  return false; // no quotient = no work! done!? What about factors of SCA?
3438 
3439  bool ret = true;
3440  // currently only super-commutative extension deals with factors.
3441 
3442  if( ncExtensions(SCAMASK) )
3443  {
3444  bool sca_ret = sca_SetupQuotient(rGR, rG, bCopy);
3445 
3446  if(sca_ret) // yes it was dealt with!
3447  ret = false;
3448  }
3449 
3450  if( bCopy )
3451  {
3452  assume(rIsPluralRing(rGR) == rIsPluralRing(rG));
3453  assume((rGR->qideal==NULL) == (rG->qideal==NULL));
3454  assume(rIsSCA(rGR) == rIsSCA(rG));
3455  assume(ncRingType(rGR) == ncRingType(rG));
3456  }
3457 
3458  return ret;
3459 }
#define assume(x)
Definition: mod2.h:394
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:341
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:394
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:394
#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:394
#define NULL
Definition: omList.c:10
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:175

◆ pOppose()

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

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

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

3374 {
3375  /* the simplest case:*/
3376  if ( Rop == dst ) return(p_Copy(p, dst));
3377  /* check Rop == rOpposite(currRing) */
3378 
3379 
3380  if ( !rIsLikeOpposite(dst, Rop) )
3381  {
3382  WarnS("an opposite ring should be used");
3383  return NULL;
3384  }
3385 
3386  nMapFunc nMap = n_SetMap(Rop->cf, dst->cf); // reverse?
3387 
3388  /* nMapFunc nMap = nSetMap(Rop);*/
3389  /* since we know that basefields coinside! */
3390 
3391  // coinside???
3392 
3393  int *perm=(int *)omAlloc0((Rop->N+1)*sizeof(int));
3394  if (!p_IsConstantPoly(p, Rop))
3395  {
3396  /* we know perm exactly */
3397  int i;
3398  for(i=1; i<=Rop->N; i++)
3399  {
3400  perm[i] = Rop->N+1-i;
3401  }
3402  }
3403  poly res = p_PermPoly(p, perm, Rop, dst, nMap);
3404  omFreeSize((ADDRESS)perm,(Rop->N+1)*sizeof(int));
3405 
3406  p_Test(res, dst);
3407 
3408  return res;
3409 }
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:115
#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:3346
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:3985
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
#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 3346 of file old.gring.cc.

3347 {
3348  /* the same basefield */
3349  int diagnose = TRUE;
3350  nMapFunc nMap = n_SetMap(rCandidate->cf, rBase->cf); // reverse?
3351 
3352 ////// if (nMap != nCopy) diagnose = FALSE;
3353  if (nMap == NULL) diagnose = FALSE;
3354 
3355 
3356  /* same number of variables */
3357  if (rBase->N != rCandidate->N) diagnose = FALSE;
3358  /* nc and comm ring */
3359  if ( rIsPluralRing(rBase) != rIsPluralRing(rCandidate) ) diagnose = FALSE;
3360  /* both are qrings */
3361  /* NO CHECK, since it is used in building opposite qring */
3362  /* if ( ((rBase->qideal != NULL) && (rCandidate->qideal == NULL)) */
3363  /* || ((rBase->qideal == NULL) && (rCandidate->qideal != NULL)) ) */
3364  /* diagnose = FALSE; */
3365  /* TODO: varnames are e->E etc */
3366  return diagnose;
3367 }
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
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 340 of file nc.h.

◆ NOCACHEMASK

const int NOCACHEMASK = 0x008

Definition at line 357 of file nc.h.

◆ NOFORMULAMASK

const int NOFORMULAMASK =0x004

Definition at line 356 of file nc.h.

◆ NOPLURALMASK

const int NOPLURALMASK = 0x002

Definition at line 355 of file nc.h.

◆ SCAMASK

const int SCAMASK = 0x001

Definition at line 341 of file nc.h.

◆ TESTSYZSCAMASK

const int TESTSYZSCAMASK = 0x0100 | SCAMASK

Definition at line 359 of file nc.h.