952 if(elementarray ==
NULL ||
poly ==
NULL || coef != elementarray[0]->basecoeffs()){
957 for(
int i=1;
i<size_elementarray;
i++){
958 if(coef != elementarray[0]->basecoeffs()){
967 WerrorS(
"Ground field not implemented!\n");
972 WerrorS(
"degree of polynomial to small\n");
985 char*
n[] = {(
char*)
"i"};
986 ring newring =
rDefault(coef, 1, n);
991 rootcont->
solver( precision+12);
993 if(number_roots != deg){
994 WerrorS(
"something went wrong: \n\tnot all roots found\n");
1000 paramComp.
par_name=(
const char*)
"i";
1004 number* roots =
new number[deg+1];
1005 number* complexroots =
new number[deg+1];
1008 for(
int j=0;
j<deg;
j++){
1011 roots[r1] =
n_Copy(a,comp);
1014 complexroots[r2] =
n_Copy(a,comp);
1026 for(
int j=0;
j<r2;
j++){
1027 roots[r1+
j]=
n_Copy(complexroots[
j],comp);
1030 delete complexroots;
1033 for(
int i=0;
i<size_elementarray;
i++){
1039 for(
int i=1;
i<= r1;
i++){
1040 number pot =
n_Init(1,comp);
1041 for(
int l=0;
l< deg;
l++){
1042 for(
int j=0;
j<size_elementarray;
j++){
1052 number sqrt2 =
n_Init(1,comp);
1054 number two =
n_Init(2,comp);
1055 number sqrt2 =
squareroot(two,comp,precision+10);
1057 for(
int i=1;
i<= r2;
i++){
1058 number pot =
n_Init(1,comp);
1059 for(
int l=0;
l< deg;
l++){
1060 for(
int j=0;
j<size_elementarray;
j++){
1068 for(
int j=1;
j<=size_elementarray;
j++){
1076 for(
int i=0;
i<size_elementarray;
i++){
1080 for(
int i=0;
i<r1+r2;
i++){
1089 paramComp.
par_name=(
const char*)
"i";
number view(int i, int j) const
view an entry an entry. NOTE: starts at [1,1]
complex root finder for univariate polynomials based on laguers algorithm
static void view(const intvec *v)
static int si_min(const int a, const int b)
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
const CanonicalForm CFMap CFMap int &both_non_zero int n
bool solver(const int polishmode=PM_NONE)
void WerrorS(const char *s)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
real floating point (GMP) numbers
void set(int i, int j, number n, const coeffs C=NULL)
replace an entry with a copy (delete old + copy new!). NOTE: starts at [1,1]
short float_len2
additional char-flags, rInit
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
void rawset(int i, number n, const coeffs C=NULL)
replace an entry with the given number n (only delete old). NOTE: starts at [0]. Should be named set_...
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
short float_len
additional char-flags, rInit
The main handler for Singular numbers which are suitable for Singular polynomials.
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
complex floating point (GMP) numbers
ring rDefault(const coeffs cf, int N, char **n, int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
void fillContainer(number *_coeffs, number *_ievpoint, const int _var, const int _tdg, const rootType _rt, const int _anz)
bool ImagGreaterZero(number a, coeffs coef)
gmp_complex * getRoot(const int i)
bigintmat * bimChangeCoeff(bigintmat *a, coeffs cnew)
Liefert Kopier von Matrix a zurück, mit coeffs cnew statt den ursprünglichen.
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
void rChangeCurrRing(ring r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void rDelete(ring r)
unconditionally deletes fields in r
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
const char * par_name
parameter name
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
number squareroot(number a, coeffs coef, int prec)
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...
bool IsReal(number a, coeffs coef)
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL