My Project  UNKNOWN_GIT_VERSION
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 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_NF (kBucket_pt b, poly p, number *c)
 
static void nc_kBucketPolyRed_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 50 of file nc.h.

Data Fields
bucket_Proc_Ptr BucketPolyRed_NF
bucket_Proc_Ptr BucketPolyRed_Z
void * GB From "gb_hack.h".
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 36 of file nc.h.

Typedef Documentation

◆ bucket_Proc_Ptr

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

Definition at line 48 of file nc.h.

◆ SPoly_Proc_Ptr

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

Definition at line 45 of file nc.h.

◆ SPolyReduce_Proc_Ptr

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

Definition at line 46 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 12 of file nc.h.

13 {
14  nc_error = -1, // Something's gone wrong!
15  nc_general = 0, /* yx=q xy+... */
16  nc_skew, /*1*/ /* yx=q xy */
17  nc_comm, /*2*/ /* yx= xy */
18  nc_lie, /*3*/ /* yx=xy+... */
19  nc_undef, /*4*/ /* for internal reasons */
20 
21  nc_exterior /*5*/ // Exterior Algebra(SCA): yx= -xy & (!:) x^2 = 0
22 };

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

216 {
217  assume( rIsNCRing(rRing) );
218 #ifdef PDEBUG
219  p_Test(pPolyP, rRing);
220  p_Test(pPolyQ, rRing);
221 #endif
222 #ifdef RDEBUG
223  rTest(rRing);
224 #endif
225 
226  int lp, lq;
227 
228  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
229 
230  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
231 
232  CPolynomialSummator sum(rRing, bUsePolynomial);
233 
234  if (lq <= lp) // ?
235  {
236  // always length(q) times "p * q[j]"
237  for( ; pPolyQ!=NULL; pPolyQ = p_LmDeleteAndNext( pPolyQ, rRing ) )
238  sum += pp_Mult_mm( pPolyP, pPolyQ, rRing);
239 
240  p_Delete( &pPolyP, rRing );
241  } else
242  {
243  // always length(p) times "p[i] * q"
244  for( ; pPolyP!=NULL; pPolyP = p_LmDeleteAndNext( pPolyP, rRing ) )
245  sum += nc_mm_Mult_pp( pPolyP, pPolyQ, rRing);
246 
247  p_Delete( &pPolyQ, rRing );
248  }
249 
250  return(sum);
251 }

◆ _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 254 of file old.gring.cc.

255 {
256  assume( rIsPluralRing(rRing) );
257 #ifdef PDEBUG
258  p_Test(pPolyP, rRing);
259  p_Test(pPolyQ, rRing);
260 #endif
261 #ifdef RDEBUG
262  rTest(rRing);
263 #endif
264 
265  int lp, lq;
266 
267  pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
268 
269  bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
270 
271  CPolynomialSummator sum(rRing, bUsePolynomial);
272 
273  if (lq <= lp) // ?
274  {
275  // always length(q) times "p * q[j]"
276  for( poly q = pPolyQ; q !=NULL; q = pNext(q) )
277  sum += pp_Mult_mm(pPolyP, q, rRing);
278  } else
279  {
280  // always length(p) times "p[i] * q"
281  for( poly p = pPolyP; p !=NULL; p = pNext(p) )
282  sum += nc_mm_Mult_pp( p, pPolyQ, rRing);
283  }
284 
285  return(sum);
286 }

◆ GetC()

static poly GetC ( const ring  r,
int  i,
int  j 
)
inlinestatic

Definition at line 366 of file nc.h.

367 {
368  assume(r!= NULL && rIsPluralRing(r));
369  const matrix C = GetNC(r)->C;
370  assume(C != NULL);
371  const int ncols = C->ncols;
372  assume( (i > 0) && (i < j) && (j <= ncols) );
373  return ( C->m[ncols * ((i)-1) + (j)-1] );
374 }

◆ GetD()

static poly GetD ( const ring  r,
int  i,
int  j 
)
inlinestatic

Definition at line 377 of file nc.h.

378 {
379  assume(r!= NULL && rIsPluralRing(r));
380  const matrix D = GetNC(r)->D;
381  assume(D != NULL);
382  const int ncols = D->ncols;
383  assume( (i > 0) && (i < j) && (j <= ncols) );
384  return ( D->m[ncols * ((i)-1) + (j)-1] );
385 }

◆ GetNC()

static nc_struct*& GetNC ( ring  r)
inlinestatic

Definition at line 154 of file nc.h.

155 {
156  return r->GetNC();
157 }

◆ getNCExtensions()

int& getNCExtensions ( )

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

83 {
84  return (iNCExtensions);
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 3407 of file old.gring.cc.

3408 {
3409  /* the simplest case:*/
3410  if ( Rop == dst ) return id_Copy(I, dst);
3411 
3412  /* check Rop == rOpposite(currRing) */
3413  if (!rIsLikeOpposite(dst, Rop))
3414  {
3415  WarnS("an opposite ring should be used");
3416  return NULL;
3417  }
3418  int i;
3419  ideal idOp = idInit(I->ncols, I->rank);
3420  for (i=0; i< (I->ncols)*(I->nrows); i++)
3421  {
3422  idOp->m[i] = pOppose(Rop,I->m[i], dst);
3423  }
3424  id_Test(idOp, dst);
3425  return idOp;
3426 }

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

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

◆ nc_CheckSubalgebra()

BOOLEAN nc_CheckSubalgebra ( poly  PolyVar,
ring  r 
)

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

2569 {
2570 // ring save = currRing;
2571 // int WeChangeRing = 0;
2572 // if (currRing != r)
2573 // rChangeCurrRing(r);
2574 // WeChangeRing = 1;
2575 // }
2576  int rN=r->N;
2577  int *ExpVar=(int*)omAlloc0((rN+1)*sizeof(int));
2578  int *ExpTmp=(int*)omAlloc0((rN+1)*sizeof(int));
2579  p_GetExpV(PolyVar, ExpVar, r);
2580  int i; int j; int k;
2581  poly test=NULL;
2582  int OK=1;
2583  for (i=1; i<rN; i++)
2584  {
2585  if (ExpVar[i]==0) /* i.e. not in PolyVar */
2586  {
2587  for (j=i+1; j<=rN; j++)
2588  {
2589  if (ExpVar[j]==0)
2590  {
2591  test = MATELEM(r->GetNC()->D,i,j);
2592  while (test!=NULL)
2593  {
2594  p_GetExpV(test, ExpTmp, r);
2595  OK=1;
2596  for (k=1;k<=rN;k++)
2597  {
2598  if (ExpTmp[k]!=0)
2599  {
2600  if (ExpVar[k]!=0) OK=0;
2601  }
2602  }
2603  if (!OK)
2604  {
2605 // if ( WeChangeRing )
2606 // rChangeCurrRing(save);
2607  return(TRUE);
2608  }
2609  pIter(test);
2610  }
2611  }
2612  }
2613  }
2614  }
2615  freeT(ExpVar,rN);
2616  freeT(ExpTmp,rN);
2617 // if ( WeChangeRing )
2618 // rChangeCurrRing(save);
2619  return(FALSE);
2620 }

◆ nc_CreateShortSpoly()

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

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

1880 {
1881 #ifdef PDEBUG
1882  p_Test(p1, r);
1883  p_Test(p2, r);
1884 #endif
1885 
1886  const long lCompP1 = p_GetComp(p1,r);
1887  const long lCompP2 = p_GetComp(p2,r);
1888 
1889  if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
1890  {
1891 #ifdef PDEBUG
1892  WerrorS("nc_CreateShortSpoly: wrong module components!"); // !!!!
1893 #endif
1894  return(NULL);
1895  }
1896 
1897  poly m;
1898 
1899 #ifdef HAVE_RATGRING
1900  if ( rIsRatGRing(r))
1901  {
1902  /* rational version */
1903  m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
1904  } else
1905 #endif
1906  {
1907  m = p_Lcm(p1, p2, r);
1908  }
1909 
1910  pSetCoeff0(m,NULL);
1911 
1912  return(m);
1913 }

◆ nc_CreateSpoly()

static poly nc_CreateSpoly ( const poly  p1,
const poly  p2,
const ring  r 
)
inlinestatic

Definition at line 241 of file nc.h.

242 {
243  assume(rIsPluralRing(r));
244  assume(r->GetNC()->p_Procs.SPoly!=NULL);
245  return r->GetNC()->p_Procs.SPoly(p1, p2, r);
246 }

◆ nc_kBucketPolyRed_NF()

static void nc_kBucketPolyRed_NF ( kBucket_pt  b,
poly  p,
number *  c 
)
inlinestatic

Definition at line 275 of file nc.h.

276 {
277  const ring r = b->bucket_ring;
278  assume(rIsPluralRing(r));
279 
280 // return gnc_kBucketPolyRedNew(b, p, c);
281 
282  assume(r->GetNC()->p_Procs.BucketPolyRed_NF!=NULL);
283  return r->GetNC()->p_Procs.BucketPolyRed_NF(b, p, c);
284 }

◆ nc_kBucketPolyRed_Z()

static void nc_kBucketPolyRed_Z ( kBucket_pt  b,
poly  p,
number *  c 
)
inlinestatic

Definition at line 286 of file nc.h.

287 {
288  const ring r = b->bucket_ring;
289  assume(rIsPluralRing(r));
290 
291 // return gnc_kBucketPolyRed_ZNew(b, p, c);
292 
293  assume(r->GetNC()->p_Procs.BucketPolyRed_Z!=NULL);
294  return r->GetNC()->p_Procs.BucketPolyRed_Z(b, p, c);
295 
296 }

◆ nc_mm_Mult_p()

static poly nc_mm_Mult_p ( const poly  m,
poly  p,
const ring  r 
)
inlinestatic

Definition at line 233 of file nc.h.

234 {
235  assume(rIsPluralRing(r));
236  assume(r->p_Procs->p_mm_Mult!=NULL);
237  return r->p_Procs->p_mm_Mult(p, m, r);
238 // return p_Mult_mm( p, m, r);
239 }

◆ nc_mm_Mult_pp()

static poly nc_mm_Mult_pp ( const poly  m,
const poly  p,
const ring  r 
)
inlinestatic

Definition at line 224 of file nc.h.

225 {
226  assume(rIsNCRing(r));
227  assume(r->p_Procs->pp_mm_Mult!=NULL);
228  return r->p_Procs->pp_mm_Mult(p, m, r);
229 }

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

2244 {
2245  assume(p != NULL && q!= NULL);
2246 
2247  if (!rIsPluralRing(r)) return(NULL);
2248  if (p_ComparePolys(p,q, r)) return(NULL);
2249  /* Components !? */
2250  poly Q=NULL;
2251  number coef=NULL;
2252  poly pres=NULL;
2253  int UseBuckets=1;
2254  if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2))
2256  UseBuckets=0;
2257 
2258 
2259  CPolynomialSummator sum(r, UseBuckets == 0);
2260 
2261  while (p!=NULL)
2262  {
2263  Q=q;
2264  while(Q!=NULL)
2265  {
2266  pres=nc_mm_Bracket_nn(p,Q, r); /* since no coeffs are taken into account there */
2267  if (pres!=NULL)
2268  {
2269  coef = n_Mult(pGetCoeff(p),pGetCoeff(Q), r->cf);
2270  pres = __p_Mult_nn(pres,coef,r);
2271 
2272  sum += pres;
2273  n_Delete(&coef, r->cf);
2274  }
2275  pIter(Q);
2276  }
2277  p=p_LmDeleteAndNext(p, r);
2278  }
2279  return(sum);
2280 }

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

152 {
153  poly mc = p_Neg( p_Copy(m, r), r );
154  poly mmc = nc_mm_Mult_pp( mc, q, r );
155  p_Delete(&mc, r);
156 
157  int org_p=pLength(p);
158  int org_q=pLength(q);
159 
160  p = p_Add_q(p, mmc, r);
161 
162  shorter = pLength(p)-org_p-org_q; // ring independent!
163 
164  return(p);
165 }

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

170 {
171  p = p_Add_q(p, nc_mm_Mult_pp( m, q, r ), r);
172 
173  lp = pLength(p);
174 
175  return(p);
176 }

◆ nc_p_ProcsSet()

void nc_p_ProcsSet ( ring  rGR,
p_Procs_s p_Procs 
)

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

3206 {
3207  assume(rIsPluralRing(rGR));
3208  assume(p_Procs!=NULL);
3209 
3210  gnc_p_ProcsSet(rGR, p_Procs);
3211 
3212  if(rIsSCA(rGR) && ncExtensions(SCAMASK) )
3213  {
3214  sca_p_ProcsSet(rGR, p_Procs);
3215  }
3216 
3217  if( ncExtensions(NOPLURALMASK) )
3219 
3220  if(!rIsSCA(rGR) && !ncExtensions(NOFORMULAMASK))
3222 
3223 }

◆ nc_PolyPolyRed()

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

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

2231 {
2232 #if 0
2233  nc_PolyPolyRedOld(b, p, c, r);
2234 #else
2235  nc_PolyPolyRedNew(b, p, c, r);
2236 #endif
2237 }

◆ nc_PrintMat()

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

returns matrix with the info on noncomm multiplication

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

2395 {
2396 
2397  if ( (a==b) || !rIsPluralRing(r) ) return(NULL);
2398  int i;
2399  int j;
2400  if (a>b) {j=b; i=a;}
2401  else {j=a; i=b;}
2402  /* i<j */
2403  int rN=r->N;
2404  int size=r->GetNC()->MTsize[UPMATELEM(i,j,rN)];
2405  matrix M = r->GetNC()->MT[UPMATELEM(i,j,rN)];
2406  /* return(M); */
2407 /*
2408  int sizeofres;
2409  if (metric==0)
2410  {
2411  sizeofres=sizeof(int);
2412  }
2413  if (metric==1)
2414  {
2415  sizeofres=sizeof(number);
2416  }
2417 */
2419  int s;
2420  int t;
2421  int length;
2422  long totdeg;
2423  poly p;
2424  for(s=1;s<=size;s++)
2425  {
2426  for(t=1;t<=size;t++)
2427  {
2428  p=MATELEM(M,s,t);
2429  if (p==NULL)
2430  {
2431  MATELEM(res,s,t)=0;
2432  }
2433  else
2434  {
2435  length = pLength(p);
2436  if (metric==0) /* length */
2437  {
2438  MATELEM(res,s,t)= p_ISet(length,r);
2439  }
2440  else if (metric==1) /* sum of deg divided by the length */
2441  {
2442  totdeg=0;
2443  while (p!=NULL)
2444  {
2445  totdeg=totdeg+p_Deg(p,r);
2446  pIter(p);
2447  }
2448  number ntd = n_Init(totdeg, r->cf);
2449  number nln = n_Init(length, r->cf);
2450  number nres= n_Div(ntd,nln, r->cf);
2451  n_Delete(&ntd, r->cf);
2452  n_Delete(&nln, r->cf);
2453  MATELEM(res,s,t)=p_NSet(nres,r);
2454  }
2455  }
2456  }
2457  }
2458  return(res);
2459 }

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

3230 {
3231  int rN = r->N;
3232  int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
3233  int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
3234  int i,pow;
3235  number C;
3236  poly suf,pre;
3237  poly res = NULL;
3238  poly out = NULL;
3239  while ( p!= NULL )
3240  {
3241  C = p_GetCoeff(p, r);
3242  p_GetExpV(p, PRE, r); /* faster splitting? */
3243  pow = PRE[n]; PRE[n]=0;
3244  res = NULL;
3245  if (pow!=0)
3246  {
3247  for (i=n+1; i<=rN; i++)
3248  {
3249  SUF[i] = PRE[i];
3250  PRE[i] = 0;
3251  }
3252  res = p_Power(p_Copy(e, r),pow, r);
3253  /* multiply with prefix */
3254  pre = p_One(r);
3255  p_SetExpV(pre,PRE, r);
3256  p_Setm(pre, r);
3257  res = nc_mm_Mult_p(pre,res, r);
3258  /* multiply with suffix */
3259  suf = p_One(r);
3260  p_SetExpV(suf,SUF, r);
3261  p_Setm(suf, r);
3262  res = p_Mult_mm(res,suf, r);
3263  res = __p_Mult_nn(res,C, r);
3264  p_SetComp(res,PRE[0], r);
3265  }
3266  else /* pow==0 */
3267  {
3268  res = p_Head(p, r);
3269  }
3270  p = p_LmDeleteAndNext(p, r);
3271  out = p_Add_q(out,res, r);
3272  }
3273  freeT(PRE,rN);
3274  freeT(SUF,rN);
3275  return(out);
3276 }

◆ nc_rComplete()

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

Definition at line 5537 of file ring.cc.

5543 {
5544 // NOTE: Originally used only by idElimination to transfer NC structure to dest
5545 // ring created by dirty hack (without nc_CallPlural)
5546  rTest(src);
5547 
5548  assume(!rIsPluralRing(dest)); // destination must be a newly constructed commutative ring
5549 
5550  if (!rIsPluralRing(src))
5551  {
5552  return FALSE;
5553  }
5554 
5555  const int N = dest->N;
5556 
5557  assume(src->N == N);
5558 
5559 // ring save = currRing;
5560 
5561 // if (dest != save)
5562 // rChangeCurrRing(dest);
5563 
5564  const ring srcBase = src;
5565 
5566  assume( n_SetMap(srcBase->cf,dest->cf) == n_SetMap(dest->cf,dest->cf) ); // currRing is important here!
5567 
5568  matrix C = mpNew(N,N); // ring independent
5569  matrix D = mpNew(N,N);
5570 
5571  matrix C0 = src->GetNC()->C;
5572  matrix D0 = src->GetNC()->D;
5573 
5574  // map C and D into dest
5575  for (int i = 1; i < N; i++)
5576  {
5577  for (int j = i + 1; j <= N; j++)
5578  {
5579  const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase->cf); // src, mapping for coeffs into currRing = dest!
5580  const poly p = p_NSet(n, dest);
5581  MATELEM(C,i,j) = p;
5582  if (MATELEM(D0,i,j) != NULL)
5583  MATELEM(D,i,j) = prCopyR(MATELEM(D0,i,j), srcBase, dest); // ?
5584  }
5585  }
5586  /* One must test C and D _only_ in r->GetNC()->basering!!! not in r!!! */
5587 
5588  id_Test((ideal)C, dest);
5589  id_Test((ideal)D, dest);
5590 
5591  if (nc_CallPlural(C, D, NULL, NULL, dest, bSetupQuotient, false, true, dest)) // also takes care about quotient ideal
5592  {
5593  //WarnS("Error transferring non-commutative structure");
5594  // error message should be in the interpreter interface
5595 
5596  mp_Delete(&C, dest);
5597  mp_Delete(&D, dest);
5598 
5599 // if (currRing != save)
5600 // rChangeCurrRing(save);
5601 
5602  return TRUE;
5603  }
5604 
5605 // mp_Delete(&C, dest); // used by nc_CallPlural!
5606 // mp_Delete(&D, dest);
5607 
5608 // if (dest != save)
5609 // rChangeCurrRing(save);
5610 
5611  assume(rIsPluralRing(dest));
5612  return FALSE;

◆ nc_rCopy()

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

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

3030 {
3031  if (nc_CallPlural(r->GetNC()->C, r->GetNC()->D, NULL, NULL, res, bSetupQuotient, true, true, r))
3032  {
3033  WarnS("Error occurred while coping/setuping the NC structure!"); // No reaction!???
3034  return true; // error
3035  }
3036 
3037  return false;
3038 }

◆ nc_ReduceSpoly()

static poly nc_ReduceSpoly ( const poly  p1,
poly  p2,
const ring  r 
)
inlinestatic

Definition at line 254 of file nc.h.

255 {
256  assume(rIsPluralRing(r));
257  assume(r->GetNC()->p_Procs.ReduceSPoly!=NULL);
258 #ifdef PDEBUG
259 // assume(p_LmDivisibleBy(p1, p2, r));
260 #endif
261  return r->GetNC()->p_Procs.ReduceSPoly(p1, p2, r);
262 }

◆ nc_rKill()

void nc_rKill ( ring  r)

complete destructor

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

2477 {
2478  if( r->GetNC()->GetGlobalMultiplier() != NULL )
2479  {
2480  delete r->GetNC()->GetGlobalMultiplier();
2481  r->GetNC()->GetGlobalMultiplier() = NULL;
2482  }
2483 
2484  if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
2485  {
2486  delete r->GetNC()->GetFormulaPowerMultiplier();
2487  r->GetNC()->GetFormulaPowerMultiplier() = NULL;
2488  }
2489 
2490 
2491  int i,j;
2492  int rN=r->N;
2493  if ( rN > 1 )
2494  {
2495  for(i=1;i<rN;i++)
2496  {
2497  for(j=i+1;j<=rN;j++)
2498  {
2499  id_Delete((ideal *)&(r->GetNC()->MT[UPMATELEM(i,j,rN)]),r);
2500  }
2501  }
2502  omFreeSize((ADDRESS)r->GetNC()->MT,rN*(rN-1)/2*sizeof(matrix));
2503  omFreeSize((ADDRESS)r->GetNC()->MTsize,rN*(rN-1)/2*sizeof(int));
2504  id_Delete((ideal *)&(r->GetNC()->COM),r);
2505  }
2506  id_Delete((ideal *)&(r->GetNC()->C),r);
2507  id_Delete((ideal *)&(r->GetNC()->D),r);
2508 
2509  if( rIsSCA(r) && (r->GetNC()->SCAQuotient() != NULL) )
2510  {
2511  id_Delete(&r->GetNC()->SCAQuotient(), r); // Custom SCA destructor!!!
2512  }
2513 
2514 
2515  nc_CleanUp(r);
2516 }

◆ nc_SetupQuotient()

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

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

3430 {
3431  if( rGR->qideal == NULL )
3432  return false; // no quotient = no work! done!? What about factors of SCA?
3433 
3434  bool ret = true;
3435  // currently only super-commutative extension deals with factors.
3436 
3437  if( ncExtensions(SCAMASK) )
3438  {
3439  bool sca_ret = sca_SetupQuotient(rGR, rG, bCopy);
3440 
3441  if(sca_ret) // yes it was dealt with!
3442  ret = false;
3443  }
3444 
3445  if( bCopy )
3446  {
3447  assume(rIsPluralRing(rGR) == rIsPluralRing(rG));
3448  assume((rGR->qideal==NULL) == (rG->qideal==NULL));
3449  assume(rIsSCA(rGR) == rIsSCA(rG));
3450  assume(ncRingType(rGR) == ncRingType(rG));
3451  }
3452 
3453  return ret;
3454 }

◆ ncExtensions()

bool ncExtensions ( int  iMask)

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

95 {
96  return ((getNCExtensions() & iMask) == iMask);
97 }

◆ ncRingType() [1/4]

static nc_type& ncRingType ( nc_struct p)
inlinestatic

Definition at line 159 of file nc.h.

160 {
161  assume(p!=NULL);
162  return (p->ncRingType());
163 }

◆ ncRingType() [2/4]

static void ncRingType ( nc_struct p,
nc_type  t 
)
inlinestatic

Definition at line 179 of file nc.h.

180 {
181  assume(p!=NULL);
182  ncRingType(p) = t;
183 }

◆ ncRingType() [3/4]

static nc_type ncRingType ( ring  r)
inlinestatic

Definition at line 165 of file nc.h.

166 {
167  if(rIsPluralRing(r))
168  return (ncRingType(r->GetNC()));
169  else
170  return (nc_error);
171 }

◆ ncRingType() [4/4]

static void ncRingType ( ring  r,
nc_type  t 
)
inlinestatic

Definition at line 173 of file nc.h.

174 {
175  assume((r != NULL) && (r->GetNC() != NULL));
176  ncRingType(r->GetNC()) = t;
177 }

◆ pOppose()

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

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

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

3369 {
3370  /* the simplest case:*/
3371  if ( Rop == dst ) return(p_Copy(p, dst));
3372  /* check Rop == rOpposite(currRing) */
3373 
3374 
3375  if ( !rIsLikeOpposite(dst, Rop) )
3376  {
3377  WarnS("an opposite ring should be used");
3378  return NULL;
3379  }
3380 
3381  nMapFunc nMap = n_SetMap(Rop->cf, dst->cf); // reverse?
3382 
3383  /* nMapFunc nMap = nSetMap(Rop);*/
3384  /* since we know that basefields coinside! */
3385 
3386  // coinside???
3387 
3388  int *perm=(int *)omAlloc0((Rop->N+1)*sizeof(int));
3389  if (!p_IsConstantPoly(p, Rop))
3390  {
3391  /* we know perm exactly */
3392  int i;
3393  for(i=1; i<=Rop->N; i++)
3394  {
3395  perm[i] = Rop->N+1-i;
3396  }
3397  }
3398  poly res = p_PermPoly(p, perm, Rop, dst, nMap);
3399  omFreeSize((ADDRESS)perm,(Rop->N+1)*sizeof(int));
3400 
3401  p_Test(res, dst);
3402 
3403  return res;
3404 }

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

3342 {
3343  /* the same basefield */
3344  int diagnose = TRUE;
3345  nMapFunc nMap = n_SetMap(rCandidate->cf, rBase->cf); // reverse?
3346 
3347 ////// if (nMap != nCopy) diagnose = FALSE;
3348  if (nMap == NULL) diagnose = FALSE;
3349 
3350 
3351  /* same number of variables */
3352  if (rBase->N != rCandidate->N) diagnose = FALSE;
3353  /* nc and comm ring */
3354  if ( rIsPluralRing(rBase) != rIsPluralRing(rCandidate) ) diagnose = FALSE;
3355  /* both are qrings */
3356  /* NO CHECK, since it is used in building opposite qring */
3357  /* if ( ((rBase->qideal != NULL) && (rCandidate->qideal == NULL)) */
3358  /* || ((rBase->qideal == NULL) && (rCandidate->qideal != NULL)) ) */
3359  /* diagnose = FALSE; */
3360  /* TODO: varnames are e->E etc */
3361  return diagnose;
3362 }

◆ rIsSCA()

static bool rIsSCA ( const ring  r)
inlinestatic

Definition at line 190 of file nc.h.

191 {
192 #ifdef HAVE_PLURAL
193  return rIsPluralRing(r) && (ncRingType(r) == nc_exterior);
194 #else
195  return false;
196 #endif
197 }

◆ setNCExtensions()

int setNCExtensions ( int  iMask)

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

88 {
89  const int iOld = getNCExtensions();
90  getNCExtensions() = iMask;
91  return (iOld);
92 }

Variable Documentation

◆ GENERICMASK

const int GENERICMASK = 0x000

Definition at line 323 of file nc.h.

◆ NOCACHEMASK

const int NOCACHEMASK = 0x008

Definition at line 340 of file nc.h.

◆ NOFORMULAMASK

const int NOFORMULAMASK =0x004

Definition at line 339 of file nc.h.

◆ NOPLURALMASK

const int NOPLURALMASK = 0x002

Definition at line 338 of file nc.h.

◆ SCAMASK

const int SCAMASK = 0x001

Definition at line 324 of file nc.h.

◆ TESTSYZSCAMASK

const int TESTSYZSCAMASK = 0x0100 | SCAMASK

Definition at line 342 of file nc.h.

test
CanonicalForm test
Definition: cfModGcd.cc:4037
nc_struct
Definition: nc.h:67
nc_mm_Bracket_nn
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:2284
FALSE
#define FALSE
Definition: auxiliary.h:94
nc_struct::C
matrix C
Definition: nc.h:75
ncInitSpecialPairMultiplication
BOOLEAN ncInitSpecialPairMultiplication(ring r)
Definition: ncSAMult.cc:264
p_LmDeleteAndNext
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:713
pOppose
poly pOppose(ring Rop, poly p, const ring dst)
opposes a vector p from Rop to currRing (dst!)
Definition: old.gring.cc:3368
p_LcmRat
poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
Definition: p_polys.cc:1621
p_GetCoeff
#define p_GetCoeff(p, r)
Definition: monomials.h:48
ncols
int int ncols
Definition: cf_linsys.cc:32
p_GetComp
#define p_GetComp(p, r)
Definition: monomials.h:62
ip_smatrix
Definition: matpol.h:13
j
int j
Definition: facHensel.cc:105
nc_struct::IsSkewConstant
int IsSkewConstant
Definition: nc.h:85
k
int k
Definition: cfEzgcd.cc:92
MATELEM
#define MATELEM(mat, i, j)
Definition: matpol.h:28
ncExtensions
bool ncExtensions(int iMask)
Definition: old.gring.cc:94
lq
Definition: lq.h:38
nc_comm
Definition: nc.h:17
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
p_Head
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:811
p_Mult_mm
static poly p_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:983
MIN_LENGTH_BUCKET
#define MIN_LENGTH_BUCKET
Definition: p_Mult_q.h:19
p_ComparePolys
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:4470
ncRingType
static nc_type & ncRingType(nc_struct *p)
Definition: nc.h:159
nc_exterior
Definition: nc.h:21
p_Neg
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1029
length
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
pqLength
BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min)
Definition: p_Mult_q.cc:27
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:454
p_Test
#define p_Test(p, r)
Definition: p_polys.h:156
pp_Mult_mm
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:973
N
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
rTest
#define rTest(r)
Definition: ring.h:775
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:463
nc_error
Definition: nc.h:14
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:467
freeT
#define freeT(A, v)
Definition: old.gring.cc:101
b
CanonicalForm b
Definition: cfModGcd.cc:4044
__p_Mult_nn
#define __p_Mult_nn(p, n, r)
Definition: p_polys.h:913
p_Lcm
void p_Lcm(const poly a, const poly b, poly m, const ring r)
Definition: p_polys.cc:1599
iiWriteMatrix
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
Definition: matpol.cc:836
nc_rKill
void nc_rKill(ring r)
complete destructor
Definition: old.gring.cc:2475
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
pLength
static unsigned pLength(poly a)
Definition: p_polys.h:184
p_SetExpV
static void p_SetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1454
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:798
gnc_InitMultiplication
BOOLEAN gnc_InitMultiplication(ring r, bool bSetupQuotient=false)
Definition: old.gring.cc:3041
p_Power
poly p_Power(poly p, int i, const ring r)
Definition: p_polys.cc:2141
nc_PolyPolyRedOld
void nc_PolyPolyRedOld(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2096
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:113
p_PermPoly
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:4025
res
CanonicalForm res
Definition: facAbsFact.cc:64
nc_type
nc_type
Definition: nc.h:12
nc_lie
Definition: nc.h:18
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
M
#define M
Definition: sirandom.c:24
TEST_OPT_NOT_BUCKETS
#define TEST_OPT_NOT_BUCKETS
Definition: options.h:103
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
SCAMASK
const int SCAMASK
Definition: nc.h:324
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:258
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
NOPLURALMASK
const int NOPLURALMASK
Definition: nc.h:338
sca_p_ProcsSet
void sca_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: sca.cc:1223
D
#define D(A)
Definition: gentable.cc:130
rIsRatGRing
static BOOLEAN rIsRatGRing(const ring r)
Definition: ring.h:418
ip_smatrix::m
poly * m
Definition: matpol.h:18
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
pIter
#define pIter(p)
Definition: monomials.h:35
n_Mult
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition: coeffs.h:635
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:537
p_GetExpV
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1439
mp_Delete
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:882
nc_mm_Mult_p
static poly nc_mm_Mult_p(const poly m, poly p, const ring r)
Definition: nc.h:233
nc_general
Definition: nc.h:15
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:36
UPMATELEM
#define UPMATELEM(i, j, nVar)
Definition: nc.h:36
p_Deg
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:578
rIsNCRing
static BOOLEAN rIsNCRing(const ring r)
Definition: ring.h:408
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:878
p_One
poly p_One(const ring r)
Definition: p_polys.cc:1302
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,...
Definition: old.gring.cc:2682
ncInitSpecialPowersMultiplication
bool ncInitSpecialPowersMultiplication(ring r)
Definition: ncSAFormula.cc:48
si_max
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
nc_undef
Definition: nc.h:19
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: old.gring.cc:3341
Print
#define Print
Definition: emacs.cc:79
gnc_p_ProcsSet
static void gnc_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition: old.gring.cc:3141
gnc_CheckOrdCondition
BOOLEAN gnc_CheckOrdCondition(matrix D, ring r)
Definition: old.gring.cc:2627
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1432
Werror
void Werror(const char *fmt,...)
Definition: reporter.cc:188
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:36
pSetCoeff0
#define pSetCoeff0(p, n)
Definition: monomials.h:57
getNCExtensions
int & getNCExtensions()
Definition: old.gring.cc:82
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:450
pow
Rational pow(const Rational &a, int e)
Definition: GMPrat.cc:414
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
m
int m
Definition: cfEzgcd.cc:121
MATCOLS
#define MATCOLS(i)
Definition: matpol.h:27
WarnS
#define WarnS
Definition: emacs.cc:77
assume
#define assume(x)
Definition: mod2.h:384
nc_struct::D
matrix D
Definition: nc.h:76
NULL
#define NULL
Definition: omList.c:9
nc_mm_Mult_pp
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:224
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:239
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:225
nc_skew
Definition: nc.h:16
nc_PolyPolyRedNew
void nc_PolyPolyRedNew(poly &b, poly p, number *c, const ring r)
Definition: old.gring.cc:2130
rSamePolyRep
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:1682
ip_smatrix::ncols
int ncols
Definition: matpol.h:21
n_Equal
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
Definition: coeffs.h:459
p
int p
Definition: cfModGcd.cc:4019
p_IsConstantPoly
static BOOLEAN p_IsConstantPoly(const poly p, const ring r)
Definition: p_polys.h:1921
p_IsConstant
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1907
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
NOFORMULAMASK
const int NOFORMULAMASK
Definition: nc.h:339
n_Div
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition: coeffs.h:614
n_SetMap
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:720
nc_CallPlural
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:2682
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1286
Q
#define Q
Definition: sirandom.c:25
GetNC
static nc_struct *& GetNC(ring r)
Definition: nc.h:154
id_Copy
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Definition: simpleideals.cc:403
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:42
iNCExtensions
int iNCExtensions
Definition: old.gring.cc:80
prCopyR_NoSort
poly prCopyR_NoSort(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:77
mp_Copy
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:63
rIsSCA
static bool rIsSCA(const ring r)
Definition: nc.h:190
id_Test
#define id_Test(A, lR)
Definition: simpleideals.h:79
MATROWS
#define MATROWS(i)
Definition: matpol.h:26
sca_SetupQuotient
bool sca_SetupQuotient(ring rGR, ring rG, bool bCopy)
Definition: sca.cc:909
CPolynomialSummator
CPolynomialSummator: unifies bucket and polynomial summation as the later is brocken in buckets :(.
Definition: summator.h:19
pNext
#define pNext(p)
Definition: monomials.h:34
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
prCopyR
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:35
nc_CleanUp
void nc_CleanUp(nc_struct *p)
Definition: old.gring.cc:2461