Loading...
Searching...
No Matches
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)

## 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, BOOLEAN reduce)

## 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
BOOLEAN | rIsLikeOpposite (ring rBase, ring rCandidate)
| checks whether rings rBase and rCandidate could be opposite to each other returns TRUE if it is so
void | nc_rKill (ring r)
| complete destructor
BOOLEAN | nc_CheckSubalgebra (poly PolyVar, ring r)
static nc_struct *& | GetNC (ring r)
static nc_type & | ncRingType (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
poly | _nc_pp_Mult_qq (const poly p, const poly q, const ring r)
| general NC-multiplication without destruction
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
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
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, BOOLEAN reduce)
static void | nc_kBucketPolyRed_Z (kBucket_pt b, poly p, number *c, BOOLEAN reduce)
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
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!
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!)
ideal | idOppose (ring Rop_src, ideal I, const ring Rop_dst)
| opposes a module I from Rop to currRing(dst)
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 )

Value:
( (nVar * ((i)-1) - ((i) * ((i)-1))/2 + (j)-1)-(i) )
i
int i
Definition cfEzgcd.cc:132
j
int j
Definition facHensel.cc:110

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, BOOLEAN reduce)

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.

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

## 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.

{
assume( rIsNCRing(rRing) );
#ifdef PDEBUG
p_Test(pPolyP, rRing);
p_Test(pPolyQ, rRing);
#endif
#ifdef RDEBUG
rTest(rRing);
#endif
int lp, lq;
pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
CPolynomialSummator sum(rRing, bUsePolynomial);
if (lq <= lp) // ?
{
// always length(q) times "p * q[j]"
for( ; pPolyQ!=NULL; pPolyQ = p_LmDeleteAndNext( pPolyQ, rRing ) )
sum += pp_Mult_mm( pPolyP, pPolyQ, rRing);
p_Delete( &pPolyP, rRing );
} else
{
// always length(p) times "p[i] * q"
for( ; pPolyP!=NULL; pPolyP = p_LmDeleteAndNext( pPolyP, rRing ) )
sum += nc_mm_Mult_pp( pPolyP, pPolyQ, rRing);
p_Delete( &pPolyQ, rRing );
}
return(sum);
}
si_max
static int si_max(const int a, const int b)
Definition auxiliary.h:125
CPolynomialSummator
CPolynomialSummator: unifies bucket and polynomial summation as the later is broken in buckets :(.
Definition summator.h:21
nc_mm_Mult_pp
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition nc.h:224
assume
#define assume(x)
Definition mod2.h:389
lq
Definition lq.h:40
NULL
#define NULL
Definition omList.c:12
TEST_OPT_NOT_BUCKETS
#define TEST_OPT_NOT_BUCKETS
Definition options.h:107
pqLength
BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min)
return TRUE and lp == pLength(p), lq == pLength(q), if min(pLength(p), pLength(q)) >= min FALSE if mi...
Definition p_Mult_q.cc:31
MIN_LENGTH_BUCKET
#define MIN_LENGTH_BUCKET
Definition p_Mult_q.h:21
pp_Mult_mm
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition p_polys.h:1033
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
p_LmDeleteAndNext
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition p_polys.h:757
p_Test
#define p_Test(p, r)
Definition p_polys.h:161
rIsNCRing
static BOOLEAN rIsNCRing(const ring r)
Definition ring.h:427
rTest
#define rTest(r)
Definition ring.h:794

## _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.

{
assume( rIsNCRing(rRing) );
#ifdef PDEBUG
p_Test(pPolyP, rRing);
p_Test(pPolyQ, rRing);
#endif
#ifdef RDEBUG
rTest(rRing);
#endif
int lp, lq;
pqLength(pPolyP, pPolyQ, lp, lq, MIN_LENGTH_BUCKET);
bool bUsePolynomial = TEST_OPT_NOT_BUCKETS || (si_max(lp, lq) < MIN_LENGTH_BUCKET); // ???
CPolynomialSummator sum(rRing, bUsePolynomial);
if (lq <= lp) // ?
{
// always length(q) times "p * q[j]"
for( poly q = pPolyQ; q !=NULL; q = pNext(q) )
sum += pp_Mult_mm(pPolyP, q, rRing);
} else
{
// always length(p) times "p[i] * q"
for( poly p = pPolyP; p !=NULL; p = pNext(p) )
sum += nc_mm_Mult_pp( p, pPolyQ, rRing);
}
return(sum);
}
p
int p
Definition cfModGcd.cc:4086
pNext
#define pNext(p)
Definition monomials.h:36

## GetC()

poly GetC | ( | const ring | r,
|  | int | i,
|  | int | j )

inline static

Definition at line 362 of file nc.h.

{
assume(r!= NULL && rIsPluralRing(r));
const matrix C = GetNC(r)->C;
assume(C != NULL);
const int ncols = C->ncols;
assume( (i > 0) && (i < j) && (j <= ncols) );
return ( C->m[ncols * ((i)-1) + (j)-1] );
}
ncols
int int ncols
Definition cf_linsys.cc:32
ip_smatrix::ncols
int ncols
Definition matpol.h:21
ip_smatrix::m
poly * m
Definition matpol.h:18
GetNC
static nc_struct *& GetNC(ring r)
Definition nc.h:154
matrix
ip_smatrix * matrix
Definition matpol.h:43
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
nc_struct::C
matrix C
Definition nc.h:75

## GetD()

poly GetD | ( | const ring | r,
|  | int | i,
|  | int | j )

inline static

Definition at line 373 of file nc.h.

{
assume(r!= NULL && rIsPluralRing(r));
const matrix D = GetNC(r)->D;
assume(D != NULL);
const int ncols = D->ncols;
assume( (i > 0) && (i < j) && (j <= ncols) );
return ( D->m[ncols * ((i)-1) + (j)-1] );
}
D
#define D(A)
Definition gentable.cc:128
nc_struct::D
matrix D
Definition nc.h:76

## GetNC()

nc_struct *& GetNC | ( | ring | r | ) |

inline static

Definition at line 154 of file nc.h.

{
return r->GetNC();
}

## getNCExtensions()

int & getNCExtensions | ( |  | ) |

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

{
return (iNCExtensions);
}
iNCExtensions
VAR int iNCExtensions
Definition old.gring.cc:80

## idOppose()

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

opposes a module I from Rop to currRing(dst)

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

{
/* the simplest case:*/
if ( Rop == dst ) return id_Copy(I, dst);
/* check Rop == rOpposite(currRing) */
if (!rIsLikeOpposite(dst, Rop))
{
WarnS("an opposite ring should be used");
return NULL;
}
int i;
ideal idOp = idInit(I->ncols, I->rank);
for (i=0; i< (I->ncols)*(I->nrows); i++)
{
idOp->m[i] = pOppose(Rop,I->m[i], dst);
}
id_Test(idOp, dst);
return idOp;
}
WarnS
#define WarnS
Definition emacs.cc:78
id_Copy
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Definition simpleideals.cc:542
pOppose
poly pOppose(ring Rop, poly p, const ring dst)
opposes a vector p from Rop to currRing (dst!)
Definition old.gring.cc:3324
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:3297
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_Test
#define id_Test(A, lR)
Definition simpleideals.h:89

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

{
assume( r != NULL );
assume( curr != NULL );
if( !bSetupQuotient)
assume( (r->qideal == NULL) ); // The basering must NOT be a qring!??
assume( rSamePolyRep(r, curr) || bCopyInput ); // wrong assumption?
// there must be:
assume( (CCC != NULL) != (CCN != NULL) ); // exactly one data about coeffs (C).
assume( !((DDD != NULL) && (DDN != NULL)) ); // at most one data about tails (D).
#if OUTPUT
if( CCC != NULL )
{
PrintS("nc_CallPlural(), Input data, CCC: \n");
iiWriteMatrix(CCC, "C", 2, curr, 4);
}
if( DDD != NULL )
{
PrintS("nc_CallPlural(), Input data, DDD: \n");
iiWriteMatrix(DDD, "D", 2, curr, 4);
}
#endif
#ifndef SING_NDEBUG
if (CCC!=NULL) id_Test((ideal)CCC, curr);
if (DDD!=NULL) id_Test((ideal)DDD, curr);
p_Test(CCN, curr);
p_Test(DDN, curr);
#endif
if( (!bBeQuiet) && (r->GetNC() != NULL) )
WarnS("going to redefine the algebra structure");
matrix CC = NULL;
poly CN = NULL;
matrix C; bool bCnew = false;
matrix DD = NULL;
poly DN = NULL;
matrix D; bool bDnew = false;
number nN, pN, qN;
bool IsSkewConstant = false, tmpIsSkewConstant;
int i, j;
nc_type nctype = nc_undef;
//////////////////////////////////////////////////////////////////
// check the correctness of arguments, without any real changes!!!
// check C
{
if ((CCC != NULL) && ( (MATCOLS(CCC)!=r->N) || (MATROWS(CCC)!=r->N) ))
{
Werror("Square %d x %d matrix expected", r->N, r->N);
return TRUE;
}
}
if (( CCC != NULL) && (CC == NULL)) CC = CCC; // mp_Copy(CCC, ?); // bug!?
if (( CCN != NULL) && (CN == NULL)) CN = CCN;
// check D
if ((DDD != NULL) && ( (MATCOLS(DDD)==1) || MATROWS(DDD)==1 ) )
{
DN = MATELEM(DDD,1,1);
}
else
{
if ((DDD != NULL) && ( (MATCOLS(DDD)!=r->N) || (MATROWS(DDD)!=r->N) ))
{
Werror("Square %d x %d matrix expected",r->N,r->N);
return TRUE;
}
}
if (( DDD != NULL) && (DD == NULL)) DD = DDD; // mp_Copy(DDD, ?); // ???
if (( DDN != NULL) && (DN == NULL)) DN = DDN;
// further checks and some analysis:
// all data in 'curr'!
if (CN != NULL) /* create matrix C = CN * Id */
{
if (!p_IsConstant(CN,curr))
{
WerrorS("Incorrect input : non-constants are not allowed as coefficients (first argument)");
return TRUE;
}
assume(p_IsConstant(CN,curr));
nN = pGetCoeff(CN);
if (n_IsZero(nN, curr->cf))
{
WerrorS("Incorrect input : zero coefficients are not allowed");
return TRUE;
}
if (n_IsOne(nN, curr->cf))
nctype = nc_lie;
else
nctype = nc_general;
IsSkewConstant = true;
C = mpNew(r->N,r->N); // ring independent!
bCnew = true;
for(i=1; i<r->N; i++)
for(j=i+1; j<=r->N; j++)
MATELEM(C,i,j) = prCopyR_NoSort(CN, curr, r); // nc_p_CopyPut(CN, r); // copy CN from curr into r
#ifndef SING_NDEBUG
id_Test((ideal)C, r);
#endif
}
else if ( (CN == NULL) && (CC != NULL) ) /* copy matrix C */
{
/* analyze C */
BOOLEAN pN_set=FALSE;
pN = n_Init(0,curr->cf);
if( r->N > 1 )
if ( MATELEM(CC,1,2) != NULL )
{
if (!pN_set) n_Delete(&pN,curr->cf); // free initial nInit(0)
pN = p_GetCoeff(MATELEM(CC,1,2), curr);
pN_set=TRUE;
}
tmpIsSkewConstant = true;
for(i=1; i<r->N; i++)
for(j=i+1; j<=r->N; j++)
{
if (MATELEM(CC,i,j) == NULL)
qN = NULL;
else
{
if (!p_IsConstant(MATELEM(CC,i,j),curr))
{
Werror("Incorrect input : non-constants are not allowed as coefficients (first argument at [%d, %d])", i, j);
return TRUE;
}
assume(p_IsConstant(MATELEM(CC,i,j),curr));
qN = p_GetCoeff(MATELEM(CC,i,j),curr);
}
if ( qN == NULL ) /* check the consistency: Cij!=0 */
// find also illegal pN
{
WerrorS("Incorrect input : matrix of coefficients contains zeros in the upper triangle");
return TRUE;
}
if (!n_Equal(pN, qN, curr->cf)) tmpIsSkewConstant = false;
}
if( bCopyInput )
{
C = mp_Copy(CC, curr, r); // Copy C into r!!!???
#ifndef SING_NDEBUG
id_Test((ideal)C, r);
#endif
bCnew = true;
}
else
C = CC;
IsSkewConstant = tmpIsSkewConstant;
if ( tmpIsSkewConstant && n_IsOne(pN, curr->cf) )
nctype = nc_lie;
else
nctype = nc_general;
if (!pN_set) n_Delete(&pN,curr->cf); // free initial nInit(0)
}
/* initialition of the matrix D */
if ( DD == NULL ) /* we treat DN only (it could also be NULL) */
{
D = mpNew(r->N,r->N); bDnew = true;
if (DN == NULL)
{
if ( (nctype == nc_lie) || (nctype == nc_undef) )
nctype = nc_comm; /* it was nc_skew earlier */
else /* nc_general, nc_skew */
nctype = nc_skew;
}
else /* DN != NULL */
for(i=1; i<r->N; i++)
for(j=i+1; j<=r->N; j++)
MATELEM(D,i,j) = prCopyR_NoSort(DN, curr, r); // project DN into r->GetNC()->basering!
#ifndef SING_NDEBUG
id_Test((ideal)D, r);
#endif
}
else /* DD != NULL */
{
bool b = true; // DD == null ?
for(int i = 1; (i < r->N) && b; i++)
for(int j = i+1; (j <= r->N) && b; j++)
if (MATELEM(DD, i, j) != NULL)
{
b = false;
break;
}
if (b) // D == NULL!!!
{
if ( (nctype == nc_lie) || (nctype == nc_undef) )
nctype = nc_comm; /* it was nc_skew earlier */
else /* nc_general, nc_skew */
nctype = nc_skew;
}
if( bCopyInput )
{
D = mp_Copy(DD, curr, r); // Copy DD into r!!!
#ifndef SING_NDEBUG
id_Test((ideal)D, r);
#endif
bDnew = true;
}
else
D = DD;
}
assume( C != NULL );
assume( D != NULL );
#if OUTPUT
PrintS("nc_CallPlural(), Computed data, C: \n");
iiWriteMatrix(C, "C", 2, r, 4);
PrintS("nc_CallPlural(), Computed data, D: \n");
iiWriteMatrix(D, "D", 2, r, 4);
Print("\nTemporary: type = %d, IsSkewConstant = %d\n", nctype, IsSkewConstant);
#endif
// check the ordering condition for D (both matrix and poly cases):
if ( gnc_CheckOrdCondition(D, r) )
{
if( bCnew ) mp_Delete( &C, r );
if( bDnew ) mp_Delete( &D, r );
WerrorS("Matrix of polynomials violates the ordering condition");
return TRUE;
}
// okay now we are ready for this!!!
// create new non-commutative structure
nc_struct *nc_new = (nc_struct *)omAlloc0(sizeof(nc_struct));
ncRingType(nc_new, nctype);
nc_new->C = C; // if C and D were given by matrices at the beginning they are in r
nc_new->D = D; // otherwise they should be in r->GetNC()->basering(polynomial * Id_{N})
nc_new->IsSkewConstant = (IsSkewConstant?1:0);
// Setup new NC structure!!!
if (r->GetNC() != NULL)
{
#ifndef SING_NDEBUG
WarnS("Changing the NC-structure of an existing NC-ring!!!");
#endif
nc_rKill(r);
}
r->GetNC() = nc_new;
r->ext_ref=NULL;
return gnc_InitMultiplication(r, bSetupQuotient);
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
b
CanonicalForm b
Definition cfModGcd.cc:4111
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:470
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
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:541
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:466
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition coeffs.h:474
Print
#define Print
Definition emacs.cc:80
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
nc_type
nc_type
Definition nc.h:13
ncRingType
static nc_type & ncRingType(nc_struct *p)
Definition nc.h:159
mp_Delete
void mp_Delete(matrix *a, const ring r)
Definition matpol.cc:874
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
mp_Copy
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition matpol.cc:57
iiWriteMatrix
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
Definition matpol.cc:828
MATELEM
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
MATROWS
#define MATROWS(i)
Definition matpol.h:26
MATCOLS
#define MATCOLS(i)
Definition matpol.h:27
p_GetCoeff
#define p_GetCoeff(p, r)
Definition monomials.h:50
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:44
gnc_InitMultiplication
BOOLEAN gnc_InitMultiplication(ring r, bool bSetupQuotient=false)
Definition old.gring.cc:3001
gnc_CheckOrdCondition
BOOLEAN gnc_CheckOrdCondition(matrix D, ring r)
Definition old.gring.cc:2637
nc_rKill
void nc_rKill(ring r)
complete destructor
Definition old.gring.cc:2483
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
p_IsConstant
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition p_polys.h:1985
prCopyR_NoSort
poly prCopyR_NoSort(poly p, ring src_r, ring dest_r)
Definition prCopy.cc:77
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
Werror
void Werror(const char *fmt,...)
Definition reporter.cc:189
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:1805
nc_struct
Definition nc.h:68
nc_struct::IsSkewConstant
int IsSkewConstant
Definition nc.h:85

## nc_CheckSubalgebra()

BOOLEAN nc_CheckSubalgebra | ( | poly | PolyVar,
|  | ring | r )

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

{
// ring save = currRing;
// int WeChangeRing = 0;
// if (currRing != r)
// rChangeCurrRing(r);
// WeChangeRing = 1;
// }
int rN=r->N;
int *ExpVar=(int*)omAlloc0((rN+1)*sizeof(int));
int *ExpTmp=(int*)omAlloc0((rN+1)*sizeof(int));
p_GetExpV(PolyVar, ExpVar, r);
int i; int j; int k;
poly test=NULL;
int OK=1;
for (i=1; i<rN; i++)
{
if (ExpVar[i]==0) /* i.e. not in PolyVar */
{
for (j=i+1; j<=rN; j++)
{
if (ExpVar[j]==0)
{
test = MATELEM(r->GetNC()->D,i,j);
while (test!=NULL)
{
p_GetExpV(test, ExpTmp, r);
OK=1;
for (k=1;k<=rN;k++)
{
if (ExpTmp[k]!=0)
{
if (ExpVar[k]!=0) OK=0;
}
}
if (!OK)
{
// if ( WeChangeRing )
// rChangeCurrRing(save);
return(TRUE);
}
pIter(test);
}
}
}
}
}
freeT(ExpVar,rN);
freeT(ExpTmp,rN);
// if ( WeChangeRing )
// rChangeCurrRing(save);
return(FALSE);
}
k
int k
Definition cfEzgcd.cc:99
test
CanonicalForm test
Definition cfModGcd.cc:4104
pIter
#define pIter(p)
Definition monomials.h:37
freeT
#define freeT(A, v)
Definition old.gring.cc:101
p_GetExpV
static void p_GetExpV(poly p, int *ev, const ring r)
Definition p_polys.h:1541

## nc_CreateShortSpoly()

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

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

{
#ifdef PDEBUG
p_Test(p1, r);
p_Test(p2, r);
#endif
const long lCompP1 = p_GetComp(p1,r);
const long lCompP2 = p_GetComp(p2,r);
if ((lCompP1!=lCompP2) && (lCompP1!=0) && (lCompP2!=0))
{
#ifdef PDEBUG
WerrorS("nc_CreateShortSpoly: wrong module components!"); // !!!!
#endif
return(NULL);
}
poly m;
#ifdef HAVE_RATGRING
if ( rIsRatGRing(r))
{
/* rational version */
m = p_LcmRat(p1, p2, si_max(lCompP1, lCompP2), r);
} else
#endif
{
m = p_Lcm(p1, p2, r);
}
pSetCoeff0(m,NULL);
return(m);
}
m
int m
Definition cfEzgcd.cc:128
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
p_LcmRat
poly p_LcmRat(const poly a, const poly b, const long lCompM, const ring r)
Definition p_polys.cc:1681
p_Lcm
void p_Lcm(const poly a, const poly b, poly m, const ring r)
Definition p_polys.cc:1659
rIsRatGRing
static BOOLEAN rIsRatGRing(const ring r)
Definition ring.h:433

## nc_CreateSpoly()

poly nc_CreateSpoly | ( | const poly | p1,
|  | const poly | p2,
|  | const ring | r )

inline static

Definition at line 241 of file nc.h.

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

## nc_kBucketPolyRed_NF()

void nc_kBucketPolyRed_NF | ( | kBucket_pt | b,
|  | poly | p,
|  | number * | c,
|  | BOOLEAN | reduce )

inline static

Definition at line 275 of file nc.h.

{
const ring r = b->bucket_ring;
assume(rIsPluralRing(r));
assume(r->GetNC()->p_Procs.BucketPolyRed_NF!=NULL);
return r->GetNC()->p_Procs.BucketPolyRed_NF(b, p, c, reduce);
}
reduce
CanonicalForm reduce(const CanonicalForm &f, const CanonicalForm &M)
polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of...
Definition cf_ops.cc:660

## nc_kBucketPolyRed_Z()

void nc_kBucketPolyRed_Z | ( | kBucket_pt | b,
|  | poly | p,
|  | number * | c,
|  | BOOLEAN | reduce )

inline static

Definition at line 284 of file nc.h.

{
const ring r = b->bucket_ring;
assume(rIsPluralRing(r));
assume(r->GetNC()->p_Procs.BucketPolyRed_Z!=NULL);
return r->GetNC()->p_Procs.BucketPolyRed_Z(b, p, c, reduce);
}

## nc_mm_Mult_p()

poly nc_mm_Mult_p | ( | const poly | m,
|  | poly | p,
|  | const ring | r )

inline static

Definition at line 233 of file nc.h.

{
assume(rIsPluralRing(r));
assume(r->p_Procs->p_mm_Mult!=NULL);
return r->p_Procs->p_mm_Mult(p, m, r);
// return p_Mult_mm( p, m, r);
}

## nc_mm_Mult_pp()

poly nc_mm_Mult_pp | ( | const poly | m,
|  | const poly | p,
|  | const ring | r )

inline static

Definition at line 224 of file nc.h.

{
assume(rIsNCRing(r));
assume(r->p_Procs->pp_mm_Mult!=NULL);
return r->p_Procs->pp_mm_Mult(p, m, r);
}

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

{
assume(p != NULL && q!= NULL);
if (!rIsPluralRing(r)) return(NULL);
if (p_ComparePolys(p,q, r)) return(NULL);
/* Components !? */
poly Q=NULL;
number coef=NULL;
poly pres=NULL;
int UseBuckets=1;
if (((pLength(p)< MIN_LENGTH_BUCKET/2) && (pLength(q)< MIN_LENGTH_BUCKET/2))
|| TEST_OPT_NOT_BUCKETS)
UseBuckets=0;
CPolynomialSummator sum(r, UseBuckets == 0);
while (p!=NULL)
{
Q=q;
while(Q!=NULL)
{
pres=nc_mm_Bracket_nn(p,Q, r); /* since no coeffs are taken into account there */
if (pres!=NULL)
{
coef = n_Mult(pGetCoeff(p),pGetCoeff(Q), r->cf);
pres = __p_Mult_nn(pres,coef,r);
sum += pres;
n_Delete(&coef, r->cf);
}
pIter(Q);
}
p=p_LmDeleteAndNext(p, r);
}
return(sum);
}
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:639
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:2292
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:4730
pLength
static int pLength(poly a)
Definition p_polys.h:190
__p_Mult_nn
#define __p_Mult_nn(p, n, r)
Definition p_polys.h:973
Q
#define Q
Definition sirandom.c:26

## 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.

{
poly mc = p_Neg( p_Copy(m, r), r );
poly mmc = nc_mm_Mult_pp( mc, q, r );
p_Delete(&mc, r);
int org_p=pLength(p);
int org_q=pLength(q);
p = p_Add_q(p, mmc, r);
shorter = pLength(p)-org_p-org_q; // ring independent!
return(p);
}
p_Neg
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1114
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848

## 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.

{
p = p_Add_q(p, nc_mm_Mult_pp( m, q, r ), r);
lp = pLength(p);
return(p);
}

## nc_p_ProcsSet()

void nc_p_ProcsSet | ( | ring | rGR,
|  | p_Procs_s * | p_Procs )

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

{
assume(rIsPluralRing(rGR));
assume(p_Procs!=NULL);
gnc_p_ProcsSet(rGR, p_Procs);
if(rIsSCA(rGR) && ncExtensions(SCAMASK) )
{
sca_p_ProcsSet(rGR, p_Procs);
}
if( ncExtensions(NOPLURALMASK) )
ncInitSpecialPairMultiplication(rGR);
if(!rIsSCA(rGR) && !ncExtensions(NOFORMULAMASK))
ncInitSpecialPowersMultiplication(rGR);
}
rIsSCA
static bool rIsSCA(const ring r)
Definition nc.h:190
NOPLURALMASK
const int NOPLURALMASK
Definition nc.h:334
NOFORMULAMASK
const int NOFORMULAMASK
Definition nc.h:335
SCAMASK
const int SCAMASK
Definition nc.h:320
sca_p_ProcsSet
void sca_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition sca.cc:1223
ncInitSpecialPowersMultiplication
bool ncInitSpecialPowersMultiplication(ring r)
Definition ncSAFormula.cc:50
ncInitSpecialPairMultiplication
BOOLEAN ncInitSpecialPairMultiplication(ring r)
Definition ncSAMult.cc:266
ncExtensions
bool ncExtensions(int iMask)
Definition old.gring.cc:94
gnc_p_ProcsSet
static void gnc_p_ProcsSet(ring rGR, p_Procs_s *p_Procs)
Definition old.gring.cc:3097

## nc_PolyPolyRed()

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

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

{
#if 0
nc_PolyPolyRedOld(b, p, c, r);
#else
nc_PolyPolyRedNew(b, p, c, r);
#endif
}
nc_PolyPolyRedNew
void nc_PolyPolyRedNew(poly &b, poly p, number *c, const ring r)
Definition old.gring.cc:2138
nc_PolyPolyRedOld
void nc_PolyPolyRedOld(poly &b, poly p, number *c, const ring r)
Definition old.gring.cc:2104

## nc_PrintMat()

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

returns matrix with the info on noncomm multiplication

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

{
if ( (a==b) || !rIsPluralRing(r) ) return(NULL);
int i;
int j;
if (a>b) {j=b; i=a;}
else {j=a; i=b;}
/* i<j */
int rN=r->N;
int size=r->GetNC()->MTsize[UPMATELEM(i,j,rN)];
matrix M = r->GetNC()->MT[UPMATELEM(i,j,rN)];
/* return(M); */
/*
int sizeofres;
if (metric==0)
{
sizeofres=sizeof(int);
}
if (metric==1)
{
sizeofres=sizeof(number);
}
*/
matrix res=mpNew(size,size);
int s;
int t;
int length;
long totdeg;
poly p;
for(s=1;s<=size;s++)
{
for(t=1;t<=size;t++)
{
p=MATELEM(M,s,t);
if (p==NULL)
{
MATELEM(res,s,t)=0;
}
else
{
length = pLength(p);
if (metric==0) /* length */
{
MATELEM(res,s,t)= p_ISet(length,r);
}
else if (metric==1) /* sum of deg divided by the length */
{
totdeg=0;
while (p!=NULL)
{
totdeg=totdeg+p_Deg(p,r);
pIter(p);
}
number ntd = n_Init(totdeg, r->cf);
number nln = n_Init(length, r->cf);
number nres= n_Div(ntd,nln, r->cf);
n_Delete(&ntd, r->cf);
n_Delete(&nln, r->cf);
MATELEM(res,s,t)=p_NSet(nres,r);
}
}
}
}
return(res);
}
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
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:618
s
const CanonicalForm int s
Definition facAbsFact.cc:51
res
CanonicalForm res
Definition facAbsFact.cc:60
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
UPMATELEM
#define UPMATELEM(i, j, nVar)
Definition nc.h:36
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition p_polys.cc:1298
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition p_polys.cc:1474
p_Deg
long p_Deg(poly a, const ring r)
Definition p_polys.cc:586
M
#define M
Definition sirandom.c:25

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

{
int rN = r->N;
int *PRE = (int *)omAlloc0((rN+1)*sizeof(int));
int *SUF = (int *)omAlloc0((rN+1)*sizeof(int));
int i,pow;
number C;
poly suf,pre;
poly res = NULL;
poly out = NULL;
while ( p!= NULL )
{
C = p_GetCoeff(p, r);
p_GetExpV(p, PRE, r); /* faster splitting? */
pow = PRE[n]; PRE[n]=0;
res = NULL;
if (pow!=0)
{
for (i=n+1; i<=rN; i++)
{
SUF[i] = PRE[i];
PRE[i] = 0;
}
res = p_Power(p_Copy(e, r),pow, r);
/* multiply with prefix */
pre = p_One(r);
p_SetExpV(pre,PRE, r);
p_Setm(pre, r);
res = nc_mm_Mult_p(pre,res, r);
/* multiply with suffix */
suf = p_One(r);
p_SetExpV(suf,SUF, r);
p_Setm(suf, r);
res = p_Mult_mm(res,suf, r);
res = __p_Mult_nn(res,C, r);
p_SetComp(res,PRE[0], r);
}
else /* pow==0 */
{
res = p_Head(p, r);
}
p = p_LmDeleteAndNext(p, r);
out = p_Add_q(out,res, r);
}
freeT(PRE,rN);
freeT(SUF,rN);
return(out);
}
pow
Rational pow(const Rational &a, int e)
Definition GMPrat.cc:411
nc_mm_Mult_p
static poly nc_mm_Mult_p(const poly m, poly p, const ring r)
Definition nc.h:233
p_Power
poly p_Power(poly p, int i, const ring r)
Definition p_polys.cc:2245
p_One
poly p_One(const ring r)
Definition p_polys.cc:1314
p_SetExpV
static void p_SetExpV(poly p, int *ev, const ring r)
Definition p_polys.h:1565
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition p_polys.h:249
p_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
p_Head
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
Definition p_polys.h:862
p_Mult_mm
static poly p_Mult_mm(poly p, poly m, const ring r)
Definition p_polys.h:1053

## nc_rComplete()

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

Definition at line 5833 of file ring.cc.

{
// NOTE: Originally used only by idElimination to transfer NC structure to dest
// ring created by dirty hack (without nc_CallPlural)
rTest(src);
assume(!rIsPluralRing(dest)); // destination must be a newly constructed commutative ring
if (!rIsPluralRing(src))
{
return FALSE;
}
const int N = dest->N;
assume(src->N == N);
// ring save = currRing;
// if (dest != save)
// rChangeCurrRing(dest);
const ring srcBase = src;
assume( n_SetMap(srcBase->cf,dest->cf) == n_SetMap(dest->cf,dest->cf) ); // currRing is important here!
matrix C = mpNew(N,N); // ring independent
matrix D = mpNew(N,N);
matrix C0 = src->GetNC()->C;
matrix D0 = src->GetNC()->D;
// map C and D into dest
for (int i = 1; i < N; i++)
{
for (int j = i + 1; j <= N; j++)
{
const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase->cf); // src, mapping for coeffs into currRing = dest!
const poly p = p_NSet(n, dest);
MATELEM(C,i,j) = p;
if (MATELEM(D0,i,j) != NULL)
MATELEM(D,i,j) = prCopyR(MATELEM(D0,i,j), srcBase, dest); // ?
}
}
/* One must test C and D _only_ in r->GetNC()->basering!!! not in r!!! */
id_Test((ideal)C, dest);
id_Test((ideal)D, dest);
if (nc_CallPlural(C, D, NULL, NULL, dest, bSetupQuotient, false, true, dest)) // also takes care about quotient ideal
{
//WarnS("Error transferring non-commutative structure");
// error message should be in the interpreter interface
mp_Delete(&C, dest);
mp_Delete(&D, dest);
// if (currRing != save)
// rChangeCurrRing(save);
return TRUE;
}
// mp_Delete(&C, dest); // used by nc_CallPlural!
// mp_Delete(&D, dest);
// if (dest != save)
// rChangeCurrRing(save);
assume(rIsPluralRing(dest));
return FALSE;
}
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
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:703
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:2692
prCopyR
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition prCopy.cc:34

## nc_rCopy()

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

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

{
if (nc_CallPlural(r->GetNC()->C, r->GetNC()->D, NULL, NULL, res, bSetupQuotient, true, true, r))
{
WarnS("Error occurred while coping/setuping the NC structure!"); // No reaction!???
return true; // error
}
return false;
}
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:2692

## nc_ReduceSpoly()

poly nc_ReduceSpoly | ( | const poly | p1,
|  | poly | p2,
|  | const ring | r )

inline static

Definition at line 254 of file nc.h.

{
assume(rIsPluralRing(r));
assume(r->GetNC()->p_Procs.ReduceSPoly!=NULL);
#ifdef PDEBUG
// assume(p_LmDivisibleBy(p1, p2, r));
#endif
return r->GetNC()->p_Procs.ReduceSPoly(p1, p2, r);
}

## nc_rKill()

void nc_rKill | ( | ring | r | ) |

complete destructor

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

{
if( r->GetNC()->GetGlobalMultiplier() != NULL )
{
delete r->GetNC()->GetGlobalMultiplier();
r->GetNC()->GetGlobalMultiplier() = NULL;
}
if( r->GetNC()->GetFormulaPowerMultiplier() != NULL )
{
delete r->GetNC()->GetFormulaPowerMultiplier();
r->GetNC()->GetFormulaPowerMultiplier() = NULL;
}
int i,j;
int rN=r->N;
if ( rN > 1 )
{
for(i=1;i<rN;i++)
{
for(j=i+1;j<=rN;j++)
{
id_Delete((ideal *)&(r->GetNC()->MT[UPMATELEM(i,j,rN)]),r);
}
}
int mat_size=rN*(rN-1)/2;
mat_size=si_max(1,mat_size);
omFreeSize((ADDRESS)r->GetNC()->MT,mat_size*sizeof(matrix));
omFreeSize((ADDRESS)r->GetNC()->MTsize,mat_size*sizeof(int));
id_Delete((ideal *)&(r->GetNC()->COM),r);
}
id_Delete((ideal *)&(r->GetNC()->C),r);
id_Delete((ideal *)&(r->GetNC()->D),r);
if( rIsSCA(r) && (r->GetNC()->SCAQuotient() != NULL) )
{
id_Delete(&r->GetNC()->SCAQuotient(), r); // Custom SCA destructor!!!
}
nc_CleanUp(r);
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
nc_CleanUp
void nc_CleanUp(nc_struct *p)
Definition old.gring.cc:2469
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123

## nc_SetupQuotient()

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

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

{
if( rGR->qideal == NULL )
return false; // no quotient = no work! done!? What about factors of SCA?
bool ret = true;
// currently only super-commutative extension deals with factors.
if( ncExtensions(SCAMASK) )
{
bool sca_ret = sca_SetupQuotient(rGR, rG, bCopy);
if(sca_ret) // yes it was dealt with!
ret = false;
}
if( bCopy )
{
assume(rIsPluralRing(rGR) == rIsPluralRing(rG));
assume((rGR->qideal==NULL) == (rG->qideal==NULL));
assume(rIsSCA(rGR) == rIsSCA(rG));
assume(ncRingType(rGR) == ncRingType(rG));
}
return ret;
}
sca_SetupQuotient
bool sca_SetupQuotient(ring rGR, ring rG, bool bCopy)
Definition sca.cc:911

## ncExtensions()

bool ncExtensions | ( | int | iMask | ) |

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

{
return ((getNCExtensions() & iMask) == iMask);
}
getNCExtensions
int & getNCExtensions()
Definition old.gring.cc:82

## ncRingType() [1/4]

nc_type & ncRingType | ( | nc_struct * | p | ) |

inline static

Definition at line 159 of file nc.h.

{
assume(p!=NULL);
return (p->ncRingType());
}

## ncRingType() [2/4]

void ncRingType | ( | nc_struct * | p,
|  | nc_type | t )

inline static

Definition at line 179 of file nc.h.

{
assume(p!=NULL);
ncRingType(p) = t;
}

## ncRingType() [3/4]

nc_type ncRingType | ( | ring | r | ) |

inline static

Definition at line 165 of file nc.h.

{
if(rIsPluralRing(r))
return (ncRingType(r->GetNC()));
else
return (nc_error);
}

## ncRingType() [4/4]

void ncRingType | ( | ring | r,
|  | nc_type | t )

inline static

Definition at line 173 of file nc.h.

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

## pOppose()

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

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

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

{
/* the simplest case:*/
if ( Rop == dst ) return(p_Copy(p, dst));
/* check Rop == rOpposite(currRing) */
if ( !rIsLikeOpposite(dst, Rop) )
{
WarnS("an opposite ring should be used");
return NULL;
}
nMapFunc nMap = n_SetMap(Rop->cf, dst->cf); // reverse?
/* nMapFunc nMap = nSetMap(Rop);*/
/* since we know that basefields coincide! */
// coincide???
int *perm=(int *)omAlloc0((Rop->N+1)*sizeof(int));
if (!p_IsConstant(p, Rop))
{
/* we know perm exactly */
int i;
for(i=1; i<=Rop->N; i++)
{
perm[i] = Rop->N+1-i;
}
}
poly res = p_PermPoly(p, perm, Rop, dst, nMap);
omFreeSize((ADDRESS)perm,(Rop->N+1)*sizeof(int));
p_Test(res, dst);
return res;
}
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
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:4256

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

{
/* the same basefield */
int diagnose = TRUE;
nMapFunc nMap = n_SetMap(rCandidate->cf, rBase->cf); // reverse?
////// if (nMap != nCopy) diagnose = FALSE;
if (nMap == NULL) diagnose = FALSE;
/* same number of variables */
if (rBase->N != rCandidate->N) diagnose = FALSE;
/* nc and comm ring */
if ( rIsPluralRing(rBase) != rIsPluralRing(rCandidate) ) diagnose = FALSE;
/* both are qrings */
/* NO CHECK, since it is used in building opposite qring */
/* if ( ((rBase->qideal != NULL) && (rCandidate->qideal == NULL)) */
/* || ((rBase->qideal == NULL) && (rCandidate->qideal != NULL)) ) */
/* diagnose = FALSE; */
/* TODO: varnames are e->E etc */
return diagnose;
}

## rIsSCA()

bool rIsSCA | ( | const ring | r | ) |

inline static

Definition at line 190 of file nc.h.

{
#ifdef HAVE_PLURAL
return rIsPluralRing(r) && (ncRingType(r) == nc_exterior);
#else
return false;
#endif
}

## setNCExtensions()

int setNCExtensions | ( | int | iMask | ) |

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

{
const int iOld = getNCExtensions();
getNCExtensions() = iMask;
return (iOld);
}

## Variable Documentation

## GENERICMASK

const int GENERICMASK = 0x000

Definition at line 319 of file nc.h.

## NOCACHEMASK

const int NOCACHEMASK = 0x008

Definition at line 336 of file nc.h.

## NOFORMULAMASK

const int NOFORMULAMASK =0x004

Definition at line 335 of file nc.h.

## NOPLURALMASK

const int NOPLURALMASK = 0x002

Definition at line 334 of file nc.h.

## SCAMASK

const int SCAMASK = 0x001

Definition at line 320 of file nc.h.

## TESTSYZSCAMASK

const int TESTSYZSCAMASK = 0x0100 | SCAMASK

Definition at line 338 of file nc.h.