Loading...
Searching...
No Matches
resMatrixDense Class Reference

## Public Member Functions

| resMatrixDense (const ideal _gls, const int special=SNONE)
| _gls: system of multivariate polynoms special: -1 -> resMatrixDense is a symbolic matrix 0,1, ... -> resMatrixDense ist eine u-Resultante, wobei special das lineare u-Polynom angibt
| ~resMatrixDense ()
resVector * | getMVector (const int i)
| column vector of matrix, index von 0 ... numVectors-1
ideal | getMatrix ()
| Returns the matrix M in an usable presentation.
ideal | getSubMatrix ()
| Returns the submatrix M' of M in an usable presentation.
number | getDetAt (const number *evpoint)
| Evaluate the determinant of the matrix M at the point evpoint where the ui's are replaced by the components of evpoint.
number | getSubDet ()
| Evaluates the determinant of the submatrix M'.
Public Member Functions inherited from resMatrixBase
| resMatrixBase ()
virtual | ~resMatrixBase ()
virtual poly | getUDet (const number *)
virtual long | getDetDeg ()
virtual IStateType | initState () const

## Private Member Functions

| resMatrixDense (const resMatrixDense &)
| deactivated copy constructor
void | generateBaseData ()
| Generate the "matrix" M.
void | generateMonomData (int deg, intvec *polyDegs, intvec *iVO)
| Generates needed set of monoms, split them into sets S0, ... Sn and check if reduced/nonreduced and calculate size of submatrix.
void | generateMonoms (poly m, int var, int deg)
| Recursively generate all homogeneous monoms of (currRing->N) variables of degree deg.
void | createMatrix ()
| Creates quadratic matrix M of size numVectors for later use.

## Private Attributes

resVector * | resVectorList
int | veclistmax
int | veclistblock
int | numVectors
int | subSize
matrix | m

## Additional Inherited Members

Public Types inherited from resMatrixBase
enum | IStateType { none , ready , notInit , fatalError , sparseError }
Protected Attributes inherited from resMatrixBase
IStateType | istate
ideal | gls
int | linPolyS
ring | sourceRing
int | totDeg

## Detailed Description

Definition at line 1929 of file mpr_base.cc.

## Constructor & Destructor Documentation

## resMatrixDense() [1/2]

resMatrixDense::resMatrixDense | ( | const ideal | _gls,
|  | const int | special = SNONE )

_gls: system of multivariate polynoms special: -1 -> resMatrixDense is a symbolic matrix 0,1, ... -> resMatrixDense ist eine u-Resultante, wobei special das lineare u-Polynom angibt

Definition at line 2064 of file mpr_base.cc.

: resMatrixBase()
{
int i;
sourceRing=currRing;
gls= idCopy( _gls );
linPolyS= special;
m=NULL;
// init all
generateBaseData();
totDeg= 1;
for ( i= 0; i < IDELEMS(gls); i++ )
{
totDeg*=pTotaldegree( (gls->m)[i] );
}
mprSTICKYPROT2(" resultant deg: %d\n",totDeg);
istate= resMatrixBase::ready;
}
i
int i
Definition cfEzgcd.cc:132
resMatrixBase::resMatrixBase
resMatrixBase()
Definition mpr_base.h:28
resMatrixBase::gls
ideal gls
Definition mpr_base.h:46
resMatrixBase::sourceRing
ring sourceRing
Definition mpr_base.h:48
resMatrixBase::totDeg
int totDeg
Definition mpr_base.h:50
resMatrixBase::linPolyS
int linPolyS
Definition mpr_base.h:47
resMatrixBase::ready
@ ready
Definition mpr_base.h:26
resMatrixBase::istate
IStateType istate
Definition mpr_base.h:44
resMatrixDense::generateBaseData
void generateBaseData()
Generate the "matrix" M.
Definition mpr_base.cc:2343
resMatrixDense::m
matrix m
Definition mpr_base.cc:1995
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
mprSTICKYPROT2
#define mprSTICKYPROT2(msg, arg)
Definition mpr_global.h:55
NULL
#define NULL
Definition omList.c:12
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pTotaldegree
static long pTotaldegree(poly p)
Definition polys.h:283
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23

## ~resMatrixDense()

resMatrixDense::~resMatrixDense | ( |  | ) |

Definition at line 2088 of file mpr_base.cc.

{
int i,j;
for (i=0; i < numVectors; i++)
{
pDelete( &resVectorList[i].mon );
pDelete( &resVectorList[i].dividedBy );
for ( j=0; j < resVectorList[i].numColVectorSize; j++ )
{
nDelete( resVectorList[i].numColVector+j );
}
// OB: ????? (solve_s.tst)
if (resVectorList[i].numColVector!=NULL)
omfreeSize( (void *)resVectorList[i].numColVector,
numVectors * sizeof( number ) );
if (resVectorList[i].numColParNr!=NULL)
omfreeSize( (void *)resVectorList[i].numColParNr,
((currRing->N)+1) * sizeof(int) );
}
omFreeSize( (void *)resVectorList, veclistmax*sizeof( resVector ) );
// free matrix m
if ( m != NULL )
{
idDelete((ideal *)&m);
}
}
resMatrixDense::numVectors
int numVectors
Definition mpr_base.cc:1992
resMatrixDense::veclistmax
int veclistmax
Definition mpr_base.cc:1990
resMatrixDense::resVectorList
resVector * resVectorList
Definition mpr_base.cc:1988
j
int j
Definition facHensel.cc:110
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
nDelete
#define nDelete(n)
Definition numbers.h:16
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omfreeSize
#define omfreeSize(addr, size)
Definition omAllocDecl.h:236
pDelete
#define pDelete(p_ptr)
Definition polys.h:187

## resMatrixDense() [2/2]

resMatrixDense::resMatrixDense | ( | const resMatrixDense & |  | ) |

private

deactivated copy constructor

## Member Function Documentation

## createMatrix()

void resMatrixDense::createMatrix | ( |  | ) |

private

Creates quadratic matrix M of size numVectors for later use.

u0, u1, ...,un are replaced by 0. Entries equal to 0 are not initialized ( == NULL)

Definition at line 2120 of file mpr_base.cc.

{
int k,i,j;
resVector *vecp;
m= mpNew( numVectors, numVectors );
for ( i= 1; i <= MATROWS( m ); i++ )
for ( j= 1; j <= MATCOLS( m ); j++ )
{
MATELEM(m,i,j)= pInit();
pSetCoeff0( MATELEM(m,i,j), nInit(0) );
}
for ( k= 0; k <= numVectors - 1; k++ )
{
if ( linPolyS == getMVector(k)->elementOfS )
{
mprSTICKYPROT(ST_DENSE_FR);
for ( i= 0; i < (currRing->N); i++ )
{
MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i])= pInit();
}
}
else
{
mprSTICKYPROT(ST_DENSE_NR);
vecp= getMVector(k);
for ( i= 0; i < numVectors; i++)
{
if ( !nIsZero( vecp->getElemNum(i) ) )
{
MATELEM(m,numVectors - k,i + 1)= pInit();
pSetCoeff0( MATELEM(m,numVectors - k,i + 1), nCopy(vecp->getElemNum(i)) );
}
}
}
} // for
mprSTICKYPROT("\n");
#ifdef mprDEBUG_ALL
for ( k= numVectors - 1; k >= 0; k-- )
{
if ( linPolyS == getMVector(k)->elementOfS )
{
for ( i=0; i < (currRing->N); i++ )
{
Print(" %d ",(getMVector(k)->numColParNr)[i]);
}
PrintLn();
}
}
for (i=1; i <= numVectors; i++)
{
for (j=1; j <= numVectors; j++ )
{
pWrite0(MATELEM(m,i,j));PrintS(" ");
}
PrintLn();
}
#endif
}
k
int k
Definition cfEzgcd.cc:99
resMatrixDense::getMVector
resVector * getMVector(const int i)
column vector of matrix, index von 0 ... numVectors-1
Definition mpr_base.cc:2463
Print
#define Print
Definition emacs.cc:80
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
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
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
mprSTICKYPROT
#define mprSTICKYPROT(msg)
Definition mpr_global.h:54
ST_DENSE_NR
#define ST_DENSE_NR
Definition mpr_global.h:65
ST_DENSE_FR
#define ST_DENSE_FR
Definition mpr_global.h:64
nIsZero
#define nIsZero(n)
Definition numbers.h:19
nCopy
#define nCopy(n)
Definition numbers.h:15
nInit
#define nInit(i)
Definition numbers.h:24
pWrite0
void pWrite0(poly p)
Definition polys.h:310
pInit
#define pInit()
allocates a new monomial and initializes everything to 0
Definition polys.h:62
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
PrintLn
void PrintLn()
Definition reporter.cc:314
resVector::getElemNum
number getElemNum(const int i)
index von 0 ... numVectors-1
Definition mpr_base.cc:2056

## generateBaseData()

void resMatrixDense::generateBaseData | ( |  | ) |

private

Generate the "matrix" M.

Each column is presented by a resVector holding all entries for this column.

Definition at line 2343 of file mpr_base.cc.

{
int k,j,i;
number matEntry;
poly pmatchPos;
poly pi,factor,pmp;
// holds the degrees of F0, F1, ..., Fn
intvec polyDegs( IDELEMS(gls) );
for ( k= 0; k < IDELEMS(gls); k++ )
polyDegs[k]= pTotaldegree( (gls->m)[k] );
// the internal Variable Ordering
// make sure that the homogenization variable goes last!
intvec iVO( (currRing->N) );
if ( linPolyS != SNONE )
{
iVO[(currRing->N) - 1]= linPolyS;
int p=0;
for ( k= (currRing->N) - 1; k >= 0; k-- )
{
if ( k != linPolyS )
{
iVO[p]= k;
p++;
}
}
}
else
{
linPolyS= 0;
for ( k= 0; k < (currRing->N); k++ )
iVO[k]= (currRing->N) - k - 1;
}
// the critical degree d= sum( deg(Fi) ) - n
int sumDeg= 0;
for ( k= 0; k < polyDegs.rows(); k++ )
sumDeg+= polyDegs[k];
sumDeg-= polyDegs.rows() - 1;
// generate the base data
generateMonomData( sumDeg, &polyDegs, &iVO );
// generate "matrix"
for ( k= numVectors - 1; k >= 0; k-- )
{
if ( resVectorList[k].elementOfS != linPolyS )
{
// column k is a normal column with numerical or symbolic entries
// init stuff
resVectorList[k].numColParNr= NULL;
resVectorList[k].numColVectorSize= numVectors;
resVectorList[k].numColVector= (number *)omAlloc( numVectors*sizeof( number ) );
for ( i= 0; i < numVectors; i++ ) resVectorList[k].numColVector[i]= nInit(0);
// compute row poly
poly pi= ppMult_qq( (gls->m)[ resVectorList[k].elementOfS ] , resVectorList[k].mon );
pi= pp_DivideM( pi, resVectorList[k].dividedBy, currRing );
// fill in "matrix"
while ( pi != NULL )
{
matEntry= nCopy(pGetCoeff(pi));
pmatchPos= pLmInit( pi );
pSetCoeff0( pmatchPos, nInit(1) );
for ( i= 0; i < numVectors; i++)
if ( pLmEqual( pmatchPos, resVectorList[i].mon ) )
break;
resVectorList[k].numColVector[numVectors - i - 1] = nCopy(matEntry);
pDelete( &pmatchPos );
nDelete( &matEntry );
pIter( pi );
}
pDelete( &pi );
}
else
{
// column is a special column, i.e. is generated by S0 and F0
// safe only the positions of the ui's in the column
//mprPROTInl(" setup of numColParNr ",k);
resVectorList[k].numColVectorSize= 0;
resVectorList[k].numColVector= NULL;
resVectorList[k].numColParNr= (int *)omAlloc0( ((currRing->N)+1) * sizeof(int) );
pi= (gls->m)[ resVectorList[k].elementOfS ];
factor= pp_DivideM( resVectorList[k].mon, resVectorList[k].dividedBy, currRing );
j=0;
while ( pi != NULL )
{ // fill in "matrix"
pmp= pMult( pCopy( factor ), pHead( pi ) );
pTest( pmp );
for ( i= 0; i < numVectors; i++)
if ( pLmEqual( pmp, resVectorList[i].mon ) )
break;
resVectorList[k].numColParNr[j]= i;
pDelete( &pmp );
pIter( pi );
j++;
}
pDelete( &pi );
pDelete( &factor );
}
} // for ( k= numVectors - 1; k >= 0; k-- )
mprSTICKYPROT2(" size of matrix: %d\n",numVectors);
mprSTICKYPROT2(" size of submatrix: %d\n",subSize);
// create the matrix M
createMatrix();
}
p
int p
Definition cfModGcd.cc:4086
resMatrixDense::createMatrix
void createMatrix()
Creates quadratic matrix M of size numVectors for later use.
Definition mpr_base.cc:2120
resMatrixDense::subSize
int subSize
Definition mpr_base.cc:1993
resMatrixDense::generateMonomData
void generateMonomData(int deg, intvec *polyDegs, intvec *iVO)
Generates needed set of monoms, split them into sets S0, ... Sn and check if reduced/nonreduced and c...
Definition mpr_base.cc:2227
factor
CanonicalForm factor
Definition facAbsFact.cc:97
pi
#define pi
Definition libparse.cc:1145
pIter
#define pIter(p)
Definition monomials.h:37
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
SNONE
#define SNONE
Definition mpr_base.h:14
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
pp_DivideM
poly pp_DivideM(poly a, poly b, const ring r)
Definition p_polys.cc:1637
pTest
#define pTest(p)
Definition polys.h:415
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition polys.h:68
pLmEqual
#define pLmEqual(p1, p2)
Definition polys.h:112
ppMult_qq
#define ppMult_qq(p, q)
Definition polys.h:209
pLmInit
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
Definition polys.h:65
pMult
#define pMult(p, q)
Definition polys.h:208
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186

## generateMonomData()

void resMatrixDense::generateMonomData | ( | int | deg,
|  | intvec * | polyDegs,
|  | intvec * | iVO )

private

Generates needed set of monoms, split them into sets S0, ... Sn and check if reduced/nonreduced and calculate size of submatrix.

Definition at line 2227 of file mpr_base.cc.

{
int i,j,k;
// init monomData
veclistblock= 512;
veclistmax= veclistblock;
resVectorList= (resVector *)omAlloc( veclistmax*sizeof( resVector ) );
// Init resVector()s
for ( j= veclistmax - 1; j >= 0; j-- ) resVectorList[j].init();
numVectors= 0;
// Generate all monoms of degree deg
poly start= pOne();
generateMonoms( start, 1, deg );
pDelete( & start );
mprSTICKYPROT("\n");
// Check for reduced monoms
// First generate polyDegs.rows() monoms
// x(k)^(polyDegs[k]), 0 <= k < polyDegs.rows()
ideal pDegDiv= idInit( polyDegs->rows(), 1 );
for ( k= 0; k < polyDegs->rows(); k++ )
{
poly p= pOne();
pSetExp( p, k + 1, (*polyDegs)[k] );
pSetm( p );
(pDegDiv->m)[k]= p;
}
// Now check each monom if it is reduced.
// A monom monom is called reduced if there exists
// exactly one x(k)^(polyDegs[k]) that divides the monom.
int divCount;
for ( j= numVectors - 1; j >= 0; j-- )
{
divCount= 0;
for ( k= 0; k < IDELEMS(pDegDiv); k++ )
if ( pLmDivisibleByNoComp( (pDegDiv->m)[k], resVectorList[j].mon ) )
divCount++;
resVectorList[j].isReduced= (divCount == 1);
}
// create the sets S(k)s
// a monom x(i)^deg, deg given, is element of the set S(i)
// if all x(0)^(polyDegs[0]) ... x(i-1)^(polyDegs[i-1]) DONT divide
// x(i)^deg and only x(i)^(polyDegs[i]) divides x(i)^deg
bool doInsert;
for ( k= 0; k < iVO->rows(); k++)
{
//mprPROTInl(" ------------ var:",(*iVO)[k]);
for ( j= numVectors - 1; j >= 0; j-- )
{
//mprPROTPnl("testing monom",resVectorList[j].mon);
if ( resVectorList[j].elementOfS == SFREE )
{
//mprPROTnl("\tfree");
if ( pLmDivisibleByNoComp( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) )
{
//mprPROTPnl("\tdivisible by ",(pDegDiv->m)[ (*iVO)[k] ]);
doInsert=TRUE;
for ( i= 0; i < k; i++ )
{
//mprPROTPnl("\tchecking db ",(pDegDiv->m)[ (*iVO)[i] ]);
if ( pLmDivisibleByNoComp( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) )
{
//mprPROTPnl("\t and divisible by",(pDegDiv->m)[ (*iVO)[i] ]);
doInsert=FALSE;
break;
}
}
if ( doInsert )
{
//mprPROTInl("\t------------------> S ",(*iVO)[k]);
resVectorList[j].elementOfS= (*iVO)[k];
resVectorList[j].dividedBy= pCopy( (pDegDiv->m)[ (*iVO)[i] ] );
}
}
}
}
}
// size of submatrix M', equal to number of nonreduced monoms
// (size of matrix M is equal to number of monoms=numVectors)
subSize= 0;
int sub;
for ( i= 0; i < polyDegs->rows(); i++ )
{
sub= 1;
for ( k= 0; k < polyDegs->rows(); k++ )
if ( i != k ) sub*= (*polyDegs)[k];
subSize+= sub;
}
subSize= numVectors - subSize;
// pDegDiv wieder freigeben!
idDelete( &pDegDiv );
#ifdef mprDEBUG_ALL
// Print a list of monoms and their properties
PrintS("// \n");
for ( j= numVectors - 1; j >= 0; j-- )
{
Print("// %s, S(%d), db ",
resVectorList[j].isReduced?"reduced":"nonreduced",
resVectorList[j].elementOfS);
pWrite0(resVectorList[j].dividedBy);
PrintS(" monom ");
pWrite(resVectorList[j].mon);
}
Print("// size: %d, subSize: %d\n",numVectors,subSize);
#endif
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
intvec::rows
int rows() const
Definition intvec.h:97
resMatrixDense::veclistblock
int veclistblock
Definition mpr_base.cc:1991
resMatrixDense::generateMonoms
void generateMonoms(poly m, int var, int deg)
Recursively generate all homogeneous monoms of (currRing->N) variables of degree deg.
Definition mpr_base.cc:2187
isReduced
long isReduced(const mat_zz_p &M)
Definition facFqBivar.cc:1471
SFREE
#define SFREE
Definition mpr_base.h:15
LinTree::init
void init()
Definition lintree.cc:864
pSetm
#define pSetm(p)
Definition polys.h:272
pWrite
void pWrite(poly p)
Definition polys.h:309
pSetExp
#define pSetExp(p, i, v)
Definition polys.h:43
pOne
#define pOne()
Definition polys.h:316
pLmDivisibleByNoComp
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition polys.h:143
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35

## generateMonoms()

void resMatrixDense::generateMonoms | ( | poly | m,
|  | int | var,
|  | int | deg )

private

Recursively generate all homogeneous monoms of (currRing->N) variables of degree deg.

Definition at line 2187 of file mpr_base.cc.

{
if ( deg == 0 )
{
poly mon = pCopy( mm );
if ( numVectors == veclistmax )
{
resVectorList= (resVector * )omReallocSize( resVectorList,
(veclistmax) * sizeof( resVector ),
(veclistmax + veclistblock) * sizeof( resVector ) );
int k;
for ( k= veclistmax; k < (veclistmax + veclistblock); k++ )
resVectorList[k].init();
veclistmax+= veclistblock;
mprSTICKYPROT(ST_DENSE_MEM);
}
resVectorList[numVectors].init( mon );
numVectors++;
mprSTICKYPROT(ST_DENSE_NMON);
return;
}
else
{
if ( var == (currRing->N)+1 ) return;
poly newm = pCopy( mm );
while ( deg >= 0 )
{
generateMonoms( newm, var+1, deg );
pIncrExp( newm, var );
pSetm( newm );
deg--;
}
pDelete( & newm );
}
return;
}
ST_DENSE_MEM
#define ST_DENSE_MEM
Definition mpr_global.h:66
ST_DENSE_NMON
#define ST_DENSE_NMON
Definition mpr_global.h:67
omReallocSize
#define omReallocSize(addr, o_size, size)
Definition omAllocDecl.h:220
pIncrExp
#define pIncrExp(p, i)
Definition polys.h:44

## getDetAt()

number resMatrixDense::getDetAt | ( | const number * | evpoint | ) |

virtual

Evaluate the determinant of the matrix M at the point evpoint where the ui's are replaced by the components of evpoint.

Uses singclap_det from factory.

Reimplemented from resMatrixBase.

Definition at line 2550 of file mpr_base.cc.

{
int k,i;
// copy evaluation point into matrix
// p0, p1, ..., pn replace u0, u1, ..., un
for ( k= numVectors - 1; k >= 0; k-- )
{
if ( linPolyS == getMVector(k)->elementOfS )
{
for ( i= 0; i < (currRing->N); i++ )
{
number np=pGetCoeff(MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]));
if (np!=NULL) nDelete(&np);
pSetCoeff0( MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]),
nCopy(evpoint[i]) );
}
}
}
mprSTICKYPROT(ST__DET);
// evaluate determinant of matrix m using factory singclap_det
poly res= singclap_det( m, currRing );
// avoid errors for det==0
number numres;
if ( (res!=NULL) && (!nIsZero(pGetCoeff( res ))) )
{
numres= nCopy( pGetCoeff( res ) );
}
else
{
numres= nInit(0);
mprPROT("0");
}
pDelete( &res );
mprSTICKYPROT(ST__DET);
return( numres );
}
singclap_det
poly singclap_det(const matrix m, const ring s)
Definition clapsing.cc:1811
res
CanonicalForm res
Definition facAbsFact.cc:60
ST__DET
#define ST__DET
Definition mpr_global.h:78
mprPROT
#define mprPROT(msg)
Definition mpr_global.h:41

## getMatrix()

ideal resMatrixDense::getMatrix | ( |  | ) |

virtual

Returns the matrix M in an usable presentation.

Reimplemented from resMatrixBase.

Definition at line 2469 of file mpr_base.cc.

{
int i,j;
// copy matrix
matrix resmat= mpNew(numVectors,numVectors);
poly p;
for (i=1; i <= numVectors; i++)
{
for (j=1; j <= numVectors; j++ )
{
p=MATELEM(m,i,j);
if (( p!=NULL)
&& (!nIsZero(pGetCoeff(p)))
&& (pGetCoeff(p)!=NULL)
)
{
MATELEM(resmat,i,j)= pCopy( p );
}
}
}
for (i=0; i < numVectors; i++)
{
if ( resVectorList[i].elementOfS == linPolyS )
{
for (j=1; j <= (currRing->N); j++ )
{
if ( MATELEM(resmat,numVectors-i,
numVectors-resVectorList[i].numColParNr[j-1])!=NULL )
pDelete( &MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]) );
MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1])= pOne();
// FIX ME
if ( FALSE )
{
pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), n_Param(j,currRing) );
}
else
{
pSetExp( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), j, 1 );
pSetm(MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]));
}
}
}
}
// obachman: idMatrix2Module frees resmat !!
ideal resmod= id_Matrix2Module(resmat,currRing);
return resmod;
}
n_Param
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1....
Definition coeffs.h:778
matrix
ip_smatrix * matrix
Definition matpol.h:43
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition polys.h:32
id_Matrix2Module
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
Definition simpleideals.cc:1560

## getMVector()

resVector * resMatrixDense::getMVector | ( | const int | i | ) |

column vector of matrix, index von 0 ... numVectors-1

Definition at line 2463 of file mpr_base.cc.

{
assume( i >= 0 && i < numVectors );
return &resVectorList[i];
}
assume
#define assume(x)
Definition mod2.h:389

## getSubDet()

number resMatrixDense::getSubDet | ( |  | ) |

virtual

Evaluates the determinant of the submatrix M'.

Since the matrix is numerically, no evaluation point is needed. Uses singclap_det from factory.

Reimplemented from resMatrixBase.

Definition at line 2593 of file mpr_base.cc.

{
int k,i,j,l;
resVector *vecp;
// generate quadratic matrix mat of size subSize
matrix mat= mpNew( subSize, subSize );
for ( i= 1; i <= MATROWS( mat ); i++ )
{
for ( j= 1; j <= MATCOLS( mat ); j++ )
{
MATELEM(mat,i,j)= pInit();
pSetCoeff0( MATELEM(mat,i,j), nInit(0) );
}
}
j=1;
for ( k= numVectors - 1; k >= 0; k-- )
{
vecp= getMVector(k);
if ( vecp->isReduced ) continue;
l=1;
for ( i= numVectors - 1; i >= 0; i-- )
{
if ( getMVector(i)->isReduced ) continue;
if ( vecp->getElemNum(numVectors - i - 1) && !nIsZero(vecp->getElemNum(numVectors - i - 1)) )
{
pSetCoeff(MATELEM(mat, j , l ), nCopy(vecp->getElemNum(numVectors - i - 1)));
}
/* else
{
MATELEM(mat, j , l )= pOne();
pSetCoeff(MATELEM(mat, j , l ), nInit(0) );
}
*/
l++;
}
j++;
}
poly res= singclap_det( mat, currRing );
number numres;
if ((res != NULL) && (!nIsZero(pGetCoeff( res ))) )
{
numres= nCopy(pGetCoeff( res ));
}
else
{
numres= nInit(0);
}
pDelete( &res );
return numres;
}
l
int l
Definition cfEzgcd.cc:100
resVector::isReduced
bool isReduced
Definition mpr_base.cc:2026

## getSubMatrix()

ideal resMatrixDense::getSubMatrix | ( |  | ) |

virtual

Returns the submatrix M' of M in an usable presentation.

Reimplemented from resMatrixBase.

Definition at line 2519 of file mpr_base.cc.

{
int k,i,j,l;
resVector *vecp;
// generate quadratic matrix resmat of size subSize
matrix resmat= mpNew( subSize, subSize );
j=1;
for ( k= numVectors - 1; k >= 0; k-- )
{
vecp= getMVector(k);
if ( vecp->isReduced ) continue;
l=1;
for ( i= numVectors - 1; i >= 0; i-- )
{
if ( getMVector(i)->isReduced ) continue;
if ( !nIsZero(vecp->getElemNum(numVectors - i - 1)) )
{
MATELEM(resmat,j,l)= pCopy( vecp->getElem(numVectors-i-1) );
}
l++;
}
j++;
}
// obachman: idMatrix2Module frees resmat !!
ideal resmod= id_Matrix2Module(resmat,currRing);
return resmod;
}
resVector::getElem
poly getElem(const int i)
index von 0 ... numVectors-1
Definition mpr_base.cc:2047

## Field Documentation

## m

matrix resMatrixDense::m

private

Definition at line 1995 of file mpr_base.cc.

## numVectors

int resMatrixDense::numVectors

private

Definition at line 1992 of file mpr_base.cc.

## resVectorList

resVector* resMatrixDense::resVectorList

private

Definition at line 1988 of file mpr_base.cc.

## subSize

int resMatrixDense::subSize

private

Definition at line 1993 of file mpr_base.cc.

## veclistblock

int resMatrixDense::veclistblock

private

Definition at line 1991 of file mpr_base.cc.

## veclistmax

int resMatrixDense::veclistmax

private

Definition at line 1990 of file mpr_base.cc.

The documentation for this class was generated from the following file:

- kernel/numeric/mpr_base.cc