 |
My Project
debian-1:4.1.1-p2+ds-4build2
|
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 4501 of file ipshell.cc.
◆ loSimplex()
Implementation of the Simplex Algorithm.
For args, see class simplex.
Definition at line 4507 of file ipshell.cc.
4511 WerrorS(
"Ground field not implemented!");
4531 LP->
m= (int)(
long)(
v->Data());
4537 LP->
n= (int)(
long)(
v->Data());
4543 LP->
m1= (int)(
long)(
v->Data());
4549 LP->
m2= (int)(
long)(
v->Data());
4555 LP->
m3= (int)(
long)(
v->Data());
4557 #ifdef mprDEBUG_PROT
4558 Print(
"m (constraints) %d\n",LP->
m);
4559 Print(
"n (columns) %d\n",LP->
n);
4583 lres->
m[4].
data=(
void*)(
long)LP->
m;
4586 lres->
m[5].
data=(
void*)(
long)LP->
n;
4588 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 4616 of file ipshell.cc.
4620 gls= (poly)(arg1->
Data());
4621 int howclean= (int)(
long)arg3->
Data();
4628 WerrorS(
"Ground field not implemented!");
4635 unsigned long int ii = (
unsigned long int)arg2->
Data();
4641 WerrorS(
"Input polynomial is constant!");
4667 if ( (vpos !=
i) && (
pGetExp( piter,
i ) != 0) )
4669 WerrorS(
"The input polynomial must be univariate!");
4677 number * pcoeffs= (number *)
omAlloc( (deg+1) *
sizeof( number ) );
4679 for (
i= deg;
i >= 0;
i-- )
4693 #ifdef mprDEBUG_PROT
4694 for (
i=deg;
i >= 0;
i--)
4702 roots->
solver( howclean );
4709 rlist->
Init( elem );
4713 for (
j= 0;
j < elem;
j++ )
4722 for (
j= 0;
j < elem;
j++ )
4726 rlist->
m[
j].
data=(
void *)dummy;
4740 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 4593 of file ipshell.cc.
4595 ideal gls = (ideal)(arg1->
Data());
4596 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 4846 of file ipshell.cc.
4857 else gls= (ideal)(
v->Data());
4863 else imtype= (int)(
long)
v->Data();
4868 ideal test_id=
idInit(1,1);
4872 if (gls->m[
j]!=
NULL)
4874 test_id->m[0]=gls->m[
j];
4878 WerrorS(
"Newton polytope not of expected dimension");
4892 unsigned long int ii=(
unsigned long int)
v->Data();
4900 else howclean= (int)(
long)
v->Data();
4929 WerrorS(
"Error occurred during matrix setup!");
4937 #ifdef mprDEBUG_PROT
4942 WerrorS(
"Unsuitable input ideal: Minor of resultant matrix is singular!");
4948 if ( interpolate_det )
4954 if ( interpolate_det )
4959 #ifdef mprDEBUG_PROT
4961 for (
i=0;
i < c;
i++)
pWrite(iproots[
i]->getPoly());
4963 for (
i=0;
i < c;
i++)
pWrite(muiproots[
i]->getPoly());
4967 arranger=
new rootArranger( iproots, muiproots, howclean );
4978 WerrorS(
"Solver was unable to find any roots!");
4984 for (
i=0;
i <
count;
i++)
delete iproots[
i];
4987 for (
i=0;
i <
count;
i++)
delete muiproots[
i];
4994 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 4745 of file ipshell.cc.
4749 p= (ideal)arg1->
Data();
4750 w= (ideal)arg2->
Data();
4761 int tdg= (int)(
long)arg3->
Data();
4768 WerrorS(
"Last input parameter must be > 0!");
4776 if (
m != (
int)
pow((
double)tdg+1,(
double)n) )
4778 Werror(
"Size of second input ideal must be equal to %d!",
4779 (
int)
pow((
double)tdg+1,(
double)n));
4786 WerrorS(
"Ground field not implemented!");
4791 number *pevpoint= (number *)
omAlloc( n *
sizeof( number ) );
4792 for (
i= 0;
i < n;
i++ )
4801 WerrorS(
"Elements of first input ideal must not be equal to -1, 0, 1!");
4810 WerrorS(
"Elements of first input ideal must be numbers!");
4813 pevpoint[
i]=
nCopy( tmp );
4817 number *wresults= (number *)
omAlloc(
m *
sizeof( number ) );
4818 for (
i= 0;
i <
m;
i++ )
4827 WerrorS(
"Elements of second input ideal must be numbers!");
4835 number *ncpoly= vm.interpolateDense( wresults );
4837 poly rpoly= vm.numvec2poly( ncpoly );
4842 res->data= (
void*)rpoly;
static BOOLEAN rField_is_long_R(const ring r)
#define pIsConstant(p)
like above, except that Comp might be != 0
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)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
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)
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)