 |
My Project
debian-1:4.1.2-p1+ds-2
|
Go to the source code of this file.
|
BOOLEAN | nuUResSolve (leftv res, leftv args) |
| solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing->N) == IDELEMS(ideal). More...
|
|
BOOLEAN | nuMPResMat (leftv res, leftv arg1, leftv arg2) |
| returns module representing the multipolynomial resultant matrix Arguments 2: ideal i, int k k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default) More...
|
|
BOOLEAN | nuLagSolve (leftv res, leftv arg1, leftv arg2, leftv arg3) |
| find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial using Laguerres' root-solver. More...
|
|
BOOLEAN | nuVanderSys (leftv res, leftv arg1, leftv arg2, leftv arg3) |
| COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consider p as point in K^n and v as N elements in K, let p1,..,pN be the points in K^n obtained by evaluating all monomials of degree 0,1,...,N at p in lexicographical order, then the procedure computes the polynomial f satisfying f(pi) = v[i] RETURN: polynomial f of degree d. More...
|
|
BOOLEAN | loNewtonP (leftv res, leftv arg1) |
| compute Newton Polytopes of input polynomials More...
|
|
BOOLEAN | loSimplex (leftv res, leftv args) |
| Implementation of the Simplex Algorithm. More...
|
|
◆ DEFAULT_DIGITS
#define DEFAULT_DIGITS 30 |
◆ MPR_DENSE
◆ MPR_SPARSE
◆ loNewtonP()
compute Newton Polytopes of input polynomials
Definition at line 4536 of file ipshell.cc.
◆ loSimplex()
Implementation of the Simplex Algorithm.
For args, see class simplex.
Definition at line 4542 of file ipshell.cc.
4547 WerrorS(
"Ground field not implemented!");
4567 LP->
m= (int)(
long)(
v->Data());
4573 LP->
n= (int)(
long)(
v->Data());
4579 LP->
m1= (int)(
long)(
v->Data());
4585 LP->
m2= (int)(
long)(
v->Data());
4591 LP->
m3= (int)(
long)(
v->Data());
4593 #ifdef mprDEBUG_PROT
4594 Print(
"m (constraints) %d\n",LP->
m);
4595 Print(
"n (columns) %d\n",LP->
n);
4619 lres->
m[4].
data=(
void*)(
long)LP->
m;
4622 lres->
m[5].
data=(
void*)(
long)LP->
n;
4624 res->data= (
void*)lres;
◆ nuLagSolve()
find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial using Laguerres' root-solver.
Good for polynomials with low and middle degree (<40). Arguments 3: poly arg1 , int arg2 , int arg3 arg2>0: defines precision of fractional part if ground field is Q arg3: number of iterations for approximation of roots (default=2) Returns a list of all (complex) roots of the polynomial arg1
Definition at line 4651 of file ipshell.cc.
4656 gls= (poly)(arg1->
Data());
4657 int howclean= (int)(
long)arg3->
Data();
4664 WerrorS(
"Ground field not implemented!");
4671 unsigned long int ii = (
unsigned long int)arg2->
Data();
4677 WerrorS(
"Input polynomial is constant!");
4703 if ( (vpos !=
i) && (
pGetExp( piter,
i ) != 0) )
4705 WerrorS(
"The input polynomial must be univariate!");
4713 number * pcoeffs= (number *)
omAlloc( (deg+1) *
sizeof( number ) );
4715 for (
i= deg;
i >= 0;
i-- )
4729 #ifdef mprDEBUG_PROT
4730 for (
i=deg;
i >= 0;
i--)
4738 roots->
solver( howclean );
4745 rlist->
Init( elem );
4749 for (
j= 0;
j < elem;
j++ )
4758 for (
j= 0;
j < elem;
j++ )
4762 rlist->
m[
j].
data=(
void *)dummy;
4776 res->data= (
void*)rlist;
◆ nuMPResMat()
returns module representing the multipolynomial resultant matrix Arguments 2: ideal i, int k k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default)
Definition at line 4628 of file ipshell.cc.
4631 ideal gls = (ideal)(arg1->
Data());
4632 int imtype= (int)(
long)arg2->
Data();
◆ nuUResSolve()
solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing->N) == IDELEMS(ideal).
Resultant method can be MPR_DENSE, which uses Macaulay Resultant (good for dense homogeneous polynoms) or MPR_SPARSE, which uses Sparse Resultant (Gelfand, Kapranov, Zelevinsky). Arguments 4: ideal i, int k, int l, int m k=0: use sparse resultant matrix of Gelfand, Kapranov and Zelevinsky k=1: use resultant matrix of Macaulay (k=0 is default) l>0: defines precision of fractional part if ground field is Q m=0,1,2: number of iterations for approximation of roots (default=2) Returns a list containing the roots of the system.
Definition at line 4881 of file ipshell.cc.
4893 else gls= (ideal)(
v->Data());
4899 else imtype= (int)(
long)
v->Data();
4904 ideal test_id=
idInit(1,1);
4908 if (gls->m[
j]!=
NULL)
4910 test_id->m[0]=gls->m[
j];
4914 WerrorS(
"Newton polytope not of expected dimension");
4928 unsigned long int ii=(
unsigned long int)
v->Data();
4936 else howclean= (int)(
long)
v->Data();
4965 WerrorS(
"Error occurred during matrix setup!");
4973 #ifdef mprDEBUG_PROT
4978 WerrorS(
"Unsuitable input ideal: Minor of resultant matrix is singular!");
4984 if ( interpolate_det )
4990 if ( interpolate_det )
4995 #ifdef mprDEBUG_PROT
4997 for (
i=0;
i < c;
i++)
pWrite(iproots[
i]->getPoly());
4999 for (
i=0;
i < c;
i++)
pWrite(muiproots[
i]->getPoly());
5003 arranger=
new rootArranger( iproots, muiproots, howclean );
5014 WerrorS(
"Solver was unable to find any roots!");
5020 for (
i=0;
i <
count;
i++)
delete iproots[
i];
5023 for (
i=0;
i <
count;
i++)
delete muiproots[
i];
5030 res->data= (
void *)listofroots;
◆ nuVanderSys()
COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consider p as point in K^n and v as N elements in K, let p1,..,pN be the points in K^n obtained by evaluating all monomials of degree 0,1,...,N at p in lexicographical order, then the procedure computes the polynomial f satisfying f(pi) = v[i] RETURN: polynomial f of degree d.
Definition at line 4780 of file ipshell.cc.
4785 p= (ideal)arg1->
Data();
4786 w= (ideal)arg2->
Data();
4797 int tdg= (int)(
long)arg3->
Data();
4804 WerrorS(
"Last input parameter must be > 0!");
4812 if (
m != (
int)
pow((
double)tdg+1,(
double)n) )
4814 Werror(
"Size of second input ideal must be equal to %d!",
4815 (
int)
pow((
double)tdg+1,(
double)n));
4822 WerrorS(
"Ground field not implemented!");
4827 number *pevpoint= (number *)
omAlloc( n *
sizeof( number ) );
4828 for (
i= 0;
i < n;
i++ )
4837 WerrorS(
"Elements of first input ideal must not be equal to -1, 0, 1!");
4846 WerrorS(
"Elements of first input ideal must be numbers!");
4849 pevpoint[
i]=
nCopy( tmp );
4853 number *wresults= (number *)
omAlloc(
m *
sizeof( number ) );
4854 for (
i= 0;
i <
m;
i++ )
4863 WerrorS(
"Elements of second input ideal must be numbers!");
4871 number *ncpoly= vm.interpolateDense( wresults );
4873 poly rpoly= vm.numvec2poly( ncpoly );
4878 res->data= (
void*)rpoly;
static BOOLEAN rField_is_long_R(const ring r)
#define pIsConstant(p)
like above, except that Comp must be 0
EXTERN_VAR size_t gmp_output_digits
virtual IStateType initState() const
#define pGetExp(p, i)
Exponent.
virtual number getSubDet()
bool solver(const int polishmode=PM_NONE)
rootContainer ** interpolateDenseSP(BOOLEAN matchUp=false, const number subDetVal=NULL)
ideal loNewtonPolytope(const ideal id)
intvec * id_QHomWeight(ideal id, const ring r)
vandermonde system solver for interpolating polynomials from their values
Class used for (list of) interpreter objects.
mprState mprIdealCheck(const ideal theIdeal, const char *name, uResultant::resMatType mtype, BOOLEAN rmatrix=false)
static long pTotaldegree(poly p)
static short rVar(const ring r)
#define rVar(r) (r->N)
void setGMPFloatDigits(size_t digits, size_t rest)
Set size of mantissa digits - the number of output digits (basis 10) the size of mantissa consists of...
void PrintS(const char *s)
#define omFreeSize(addr, size)
gmp_complex * getRoot(const int i)
#define nPrint(a)
only for debug, over any initalized currRing
resMatrixBase * accessResMat()
static BOOLEAN rField_is_R(const ring r)
void fillContainer(number *_coeffs, number *_ievpoint, const int _var, const int _tdg, const rootType _rt, const int _anz)
char * complexToStr(gmp_complex &c, const unsigned int oprec, const coeffs src)
Linear Programming / Linear Optimization using Simplex - Algorithm.
Base class for solving 0-dim poly systems using u-resultant.
uResultant::resMatType determineMType(int imtype)
void Werror(const char *fmt,...)
ideal idInit(int idsize, int rank)
initialise an ideal / module
Rational pow(const Rational &a, int e)
void WerrorS(const char *s)
virtual ideal getMatrix()
lists listOfRoots(rootArranger *self, const unsigned int oprec)
const Variable & v
< [in] a sqrfree bivariate poly
INLINE_THIS void Init(int l=0)
BOOLEAN mapFromMatrix(matrix m)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
int status int void size_t count
complex root finder for univariate polynomials based on laguers algorithm
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
static BOOLEAN rField_is_long_C(const ring r)
matrix mapToMatrix(matrix m)
rootContainer ** specializeInU(BOOLEAN matchUp=false, const number subDetVal=NULL)
static BOOLEAN rField_is_Q(const ring r)
void Clean(ring r=currRing)