Data Structures | Macros | Enumerations | Functions | Variables
mpr_base.h File Reference
#include <kernel/numeric/mpr_numeric.h>

Go to the source code of this file.

Data Structures

class  resMatrixBase
 Base class for sparse and dense u-Resultant computation. More...
 
class  uResultant
 Base class for solving 0-dim poly systems using u-resultant. More...
 

Macros

#define SNONE   -1
 
#define SFREE   -2
 

Enumerations

enum  mprState {
  mprOk, mprWrongRType, mprHasOne, mprInfNumOfVars,
  mprNotReduced, mprNotZeroDim, mprNotHomog, mprUnSupField
}
 

Functions

uResultant::resMatType determineMType (int imtype)
 
mprState mprIdealCheck (const ideal theIdeal, const char *name, uResultant::resMatType mtype, BOOLEAN rmatrix=false)
 
ideal loNewtonPolytope (const ideal id)
 

Variables

size_t gmp_output_digits
 

Macro Definition Documentation

#define SFREE   -2

Definition at line 15 of file mpr_base.h.

#define SNONE   -1

Definition at line 14 of file mpr_base.h.

Enumeration Type Documentation

enum mprState
Enumerator
mprOk 
mprWrongRType 
mprHasOne 
mprInfNumOfVars 
mprNotReduced 
mprNotZeroDim 
mprNotHomog 
mprUnSupField 

Definition at line 96 of file mpr_base.h.

Function Documentation

uResultant::resMatType determineMType ( int  imtype)

Definition at line 135 of file mpr_inout.cc.

136 {
137  switch ( imtype )
138  {
139  case MPR_DENSE:
141  case 0:
142  case MPR_SPARSE:
144  default:
145  return uResultant::none;
146  }
147 }
#define MPR_DENSE
Definition: mpr_inout.h:15
#define MPR_SPARSE
Definition: mpr_inout.h:16
ideal loNewtonPolytope ( const ideal  id)

Definition at line 3192 of file mpr_base.cc.

3193 {
3194  simplex * LP;
3195  int i;
3196  int /*n,*/totverts,idelem;
3197  ideal idr;
3198 
3199  // n= (currRing->N);
3200  idelem= IDELEMS(id); // should be n+1
3201 
3202  totverts = 0;
3203  for( i=0; i < idelem; i++) totverts += pLength( (id->m)[i] );
3204 
3205  LP = new simplex( idelem+totverts*2+5, totverts+5 ); // rows, cols
3206 
3207  // evaluate convex hull for supports of id
3208  convexHull chnp( LP );
3209  idr = chnp.newtonPolytopesI( id );
3210 
3211  delete LP;
3212 
3213  return idr;
3214 }
Linear Programming / Linear Optimization using Simplex - Algorithm.
Definition: mpr_numeric.h:194
static int pLength(poly a)
Definition: p_polys.h:189
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
mprState mprIdealCheck ( const ideal  theIdeal,
const char *  name,
uResultant::resMatType  mtype,
BOOLEAN  rmatrix = false 
)

Definition at line 94 of file mpr_inout.cc.

98 {
99  mprState state = mprOk;
100  // int power;
101  int k;
102 
103  int numOfVars= mtype == uResultant::denseResMat?(currRing->N)-1:(currRing->N);
104  if ( rmatrix ) numOfVars++;
105 
106  if ( mtype == uResultant::none )
107  state= mprWrongRType;
108 
109  if ( IDELEMS(theIdeal) != numOfVars )
110  state= mprInfNumOfVars;
111 
112  for ( k= IDELEMS(theIdeal) - 1; (state == mprOk) && (k >= 0); k-- )
113  {
114  poly p = (theIdeal->m)[k];
115  if ( pIsConstant(p) ) state= mprHasOne;
116  else
117  if ( (mtype == uResultant::denseResMat) && !p_IsHomogeneous(p, currRing) )
118  state=mprNotHomog;
119  }
120 
121  if ( !(rField_is_R(currRing)||
125  (rmatrix && rField_is_Q_a(currRing))) )
126  state= mprUnSupField;
127 
128  if ( state != mprOk ) mprPrintError( state, "" /* name */ );
129 
130  return state;
131 }
return P p
Definition: myNF.cc:203
BOOLEAN p_IsHomogeneous(poly p, const ring r)
Definition: p_polys.cc:3187
static BOOLEAN rField_is_R(const ring r)
Definition: ring.h:467
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:488
int k
Definition: cfEzgcd.cc:93
Definition: mpr_base.h:98
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:209
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
#define IDELEMS(i)
Definition: simpleideals.h:24
static BOOLEAN rField_is_long_C(const ring r)
Definition: ring.h:494
static BOOLEAN rField_is_long_R(const ring r)
Definition: ring.h:491
mprState
Definition: mpr_base.h:96
polyrec * poly
Definition: hilb.h:10

Variable Documentation

size_t gmp_output_digits

Definition at line 44 of file mpr_complex.cc.