Loading...
Searching...
No Matches
idealFunctionals Class Reference

## Public Member Functions

| idealFunctionals (int blockSize, int numFuncs)
| ~idealFunctionals ()
int | dimen () const
void | endofConstruction ()
void | map (ring source)
void | insertCols (int *divisors, int to)
void | insertCols (int *divisors, const fglmVector to)
fglmVector | addCols (const int var, int basisSize, const fglmVector v) const
fglmVector | multiply (const fglmVector v, int var) const

## Private Member Functions

matHeader * | grow (int var)

## Private Attributes

int | _block
int | _max
int | _size
int | _nfunc
int * | currentSize
matHeader ** | func

## Detailed Description

Definition at line 74 of file fglmzero.cc.

## Constructor & Destructor Documentation

## idealFunctionals()

idealFunctionals::idealFunctionals | ( | int | blockSize,
|  | int | numFuncs )

Definition at line 98 of file fglmzero.cc.

{
int k;
_block= blockSize;
_max= _block;
_size= 0;
_nfunc= numFuncs;
currentSize= (int *)omAlloc0( _nfunc*sizeof( int ) );
//for ( k= _nfunc-1; k >= 0; k-- )
// currentSize[k]= 0;
func= (matHeader **)omAlloc( _nfunc*sizeof( matHeader * ) );
for ( k= _nfunc-1; k >= 0; k-- )
func[k]= (matHeader *)omAlloc( _max*sizeof( matHeader ) );
}
k
int k
Definition cfEzgcd.cc:99
idealFunctionals::currentSize
int * currentSize
Definition fglmzero.cc:81
idealFunctionals::_size
int _size
Definition fglmzero.cc:79
idealFunctionals::_block
int _block
Definition fglmzero.cc:77
idealFunctionals::func
matHeader ** func
Definition fglmzero.cc:82
idealFunctionals::_max
int _max
Definition fglmzero.cc:78
idealFunctionals::_nfunc
int _nfunc
Definition fglmzero.cc:80
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211

## ~idealFunctionals()

idealFunctionals::~idealFunctionals | ( |  | ) |

Definition at line 115 of file fglmzero.cc.

{
int k;
int l;
int row;
matHeader * colp;
matElem * elemp;
for ( k= _nfunc-1; k >= 0; k-- ) {
for ( l= _size-1, colp= func[k]; l >= 0; l--, colp++ ) {
if ( ( colp->owner == TRUE ) && ( colp->size > 0 ) ) {
for ( row= colp->size-1, elemp= colp->elems; row >= 0; row--, elemp++ )
nDelete( & elemp->elem );
omFreeSize( (ADDRESS)colp->elems, colp->size*sizeof( matElem ) );
}
}
omFreeSize( (ADDRESS)func[k], _max*sizeof( matHeader ) );
}
omFreeSize( (ADDRESS)func, _nfunc*sizeof( matHeader * ) );
omFreeSize( (ADDRESS)currentSize, _nfunc*sizeof( int ) );
}
TRUE
#define TRUE
Definition auxiliary.h:101
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
l
int l
Definition cfEzgcd.cc:100
matHeader::elems
matElem * elems
Definition fglmzero.cc:71
matHeader::owner
BOOLEAN owner
Definition fglmzero.cc:70
matElem::elem
number elem
Definition fglmzero.cc:64
matHeader::size
int size
Definition fglmzero.cc:69
nDelete
#define nDelete(n)
Definition numbers.h:16
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260

## Member Function Documentation

## addCols()

fglmVector idealFunctionals::addCols | ( | const int | var,
|  | int | basisSize,
|  | const fglmVector | v ) const

Definition at line 241 of file fglmzero.cc.

{
fglmVector result( basisSize );
matHeader * colp;
matElem * elemp;
number factor, temp;
int k, l;
int vsize = v.size();
fglmASSERT( currentSize[var-1]+1 >= vsize, "wrong v.size()" );
for ( k= 1, colp= func[var-1]; k <= vsize; k++, colp++ ) {
factor= v.getconstelem( k );
if ( ! nIsZero( factor ) ) {
for ( l= colp->size-1, elemp= colp->elems; l >= 0; l--, elemp++ ) {
temp= nMult( factor, elemp->elem );
number newelem= nAdd( result.getconstelem( elemp->row ), temp );
nDelete( & temp );
nNormalize( newelem );
result.setelem( elemp->row, newelem );
}
}
}
return result;
}
result
return result
Definition facAbsBiFact.cc:76
factor
CanonicalForm factor
Definition facAbsFact.cc:97
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
matElem::row
int row
Definition fglmzero.cc:63
fglmASSERT
#define fglmASSERT(ignore1, ignore2)
Definition fglmzero.cc:52
nIsZero
#define nIsZero(n)
Definition numbers.h:19
nAdd
#define nAdd(n1, n2)
Definition numbers.h:18
nNormalize
#define nNormalize(n)
Definition numbers.h:30
nMult
#define nMult(n1, n2)
Definition numbers.h:17

## dimen()

int idealFunctionals::dimen | ( |  | ) | const

inline

Definition at line 88 of file fglmzero.cc.

{ fglmASSERT( _size>0, "called too early"); return _size; }

## endofConstruction()

void idealFunctionals::endofConstruction | ( |  | ) |

Definition at line 137 of file fglmzero.cc.

{
_size= currentSize[0];
}

## grow()

matHeader * idealFunctionals::grow | ( | int | var | ) |

private

Definition at line 177 of file fglmzero.cc.

{
if ( currentSize[var-1] == _max ) {
int k;
for ( k= _nfunc; k > 0; k-- )
func[k-1]= (matHeader *)omReallocSize( func[k-1], _max*sizeof( matHeader ), (_max + _block)*sizeof( matHeader ) );
_max+= _block;
}
currentSize[var-1]++;
return func[var-1] + currentSize[var-1] - 1;
}
omReallocSize
#define omReallocSize(addr, o_size, size)
Definition omAllocDecl.h:220

## insertCols() [1/2]

void idealFunctionals::insertCols | ( | int * | divisors,
|  | const fglmVector | to )

Definition at line 210 of file fglmzero.cc.

{
// divisors runs from divisors[0]..divisors[size-1]
fglmASSERT( 0 < divisors[0] && divisors[0] <= _nfunc, "wrong number of divisors" );
int k, l;
int numElems= to.numNonZeroElems();
matElem * elems;
matElem * elemp;
BOOLEAN owner = TRUE;
if ( numElems > 0 ) {
elems= (matElem *)omAlloc( numElems * sizeof( matElem ) );
for ( k= 1, l= 1, elemp= elems; k <= numElems; k++, elemp++ ) {
while ( nIsZero( to.getconstelem(l) ) ) l++;
elemp->row= l;
elemp->elem= nCopy( to.getconstelem( l ) );
l++; // hochzaehlen, damit wir nicht noch einmal die gleiche Stelle testen
}
}
else
elems= NULL;
for ( k= divisors[0]; k > 0; k-- ) {
fglmASSERT( 0 < divisors[k] && divisors[k] <= _nfunc, "wrong divisor" );
matHeader * colp = grow( divisors[k] );
colp->size= numElems;
colp->elems= elems;
colp->owner= owner;
owner= FALSE;
}
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
FALSE
#define FALSE
Definition auxiliary.h:97
fglmVector::numNonZeroElems
int numNonZeroElems() const
Definition fglmvec.cc:212
fglmVector::getconstelem
number getconstelem(int i) const
Definition fglmvec.cc:446
idealFunctionals::grow
matHeader * grow(int var)
Definition fglmzero.cc:177
nCopy
#define nCopy(n)
Definition numbers.h:15
NULL
#define NULL
Definition omList.c:12

## insertCols() [2/2]

void idealFunctionals::insertCols | ( | int * | divisors,
|  | int | to )

Definition at line 190 of file fglmzero.cc.

{
fglmASSERT( 0 < divisors[0] && divisors[0] <= _nfunc, "wrong number of divisors" );
int k;
BOOLEAN owner = TRUE;
matElem * elems = (matElem *)omAlloc( sizeof( matElem ) );
elems->row= to;
elems->elem= nInit( 1 );
for ( k= divisors[0]; k > 0; k-- ) {
fglmASSERT( 0 < divisors[k] && divisors[k] <= _nfunc, "wrong divisor" );
matHeader * colp = grow( divisors[k] );
colp->size= 1;
colp->elems= elems;
colp->owner= owner;
owner= FALSE;
}
}
nInit
#define nInit(i)
Definition numbers.h:24

## map()

void idealFunctionals::map | ( | ring | source | ) |

Definition at line 143 of file fglmzero.cc.

{
// maps from ring source to currentRing.
int var, col, row;
matHeader * colp;
matElem * elemp;
number newelem;
int * perm = (int *)omAlloc0( (_nfunc+1)*sizeof( int ) );
maFindPerm( source->names, source->N, NULL, 0, currRing->names,
currRing->N, NULL, 0, perm, NULL , currRing->cf->type);
nMapFunc nMap=n_SetMap( source->cf, currRing->cf);
matHeader ** temp = (matHeader **)omAlloc( _nfunc*sizeof( matHeader * ));
for ( var= 0; var < _nfunc; var ++ ) {
for ( col= 0, colp= func[var]; col < _size; col++, colp++ ) {
if ( colp->owner == TRUE ) {
for ( row= colp->size-1, elemp= colp->elems; row >= 0;
row--, elemp++ )
{
newelem= nMap( elemp->elem, source->cf, currRing->cf );
nDelete( & elemp->elem );
elemp->elem= newelem;
}
}
}
temp[ perm[var+1]-1 ]= func[var];
}
omFreeSize( (ADDRESS)func, _nfunc*sizeof( matHeader * ) );
omFreeSize( (ADDRESS)perm, (_nfunc+1)*sizeof( int ) );
func= temp;
}
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
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
maFindPerm
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
Definition maps.cc:155
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13

## multiply()

fglmVector idealFunctionals::multiply | ( | const fglmVector | v,
|  | int | var ) const

Definition at line 267 of file fglmzero.cc.

{
fglmASSERT( v.size() == _size, "multiply: v has wrong size");
fglmVector result( _size );
matHeader * colp;
matElem * elemp;
number factor, temp;
int k, l;
for ( k= 1, colp= func[var-1]; k <= _size; k++, colp++ ) {
factor= v.getconstelem( k );
if ( ! nIsZero( factor ) ) {
for ( l= colp->size-1, elemp= colp->elems; l >= 0; l--, elemp++ ) {
temp= nMult( factor, elemp->elem );
number newelem= nAdd( result.getconstelem( elemp->row ), temp );
nDelete( & temp );
nNormalize( newelem );
result.setelem( elemp->row, newelem );
}
}
}
return result;
}

## Field Documentation

## _block

int idealFunctionals::_block

private

Definition at line 77 of file fglmzero.cc.

## _max

int idealFunctionals::_max

private

Definition at line 78 of file fglmzero.cc.

## _nfunc

int idealFunctionals::_nfunc

private

Definition at line 80 of file fglmzero.cc.

## _size

int idealFunctionals::_size

private

Definition at line 79 of file fglmzero.cc.

## currentSize

int* idealFunctionals::currentSize

private

Definition at line 81 of file fglmzero.cc.

## func

matHeader** idealFunctionals::func

private

Definition at line 82 of file fglmzero.cc.

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

- kernel/fglm/fglmzero.cc