Changeset 6035d5 in git
- Timestamp:
- Jun 28, 1999, 6:48:58 PM (24 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 9a6c4ae84f7d2709f65215910c1238b8642ea6ff
- Parents:
- e858e7474c86dc4faa76dde10fcfb590dcdaabae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/solve.lib
re858e7 r6035d5 1 1 /////////////////////////////////////////////////////////////////////////////// 2 2 3 version="$Id: solve.lib,v 1. 1 1999-06-28 13:35:06 wenkExp $";3 version="$Id: solve.lib,v 1.2 1999-06-28 16:48:58 Singular Exp $"; 4 4 info=" 5 5 LIBRARY: solve.lib PROCEDURES TO SOLVE POLYNOMIAL SYSTEMS … … 20 20 l>0: defines precision of fractional part if groundfield is Q 21 21 m=0,1,2: number of iterations for approximation of roots (default=2) 22 ASSUME: i is a zerodimensional ideal with 23 nvars(basering) = ncols(i) = number of vars actually occuring in i 22 ASSUME: i is a zerodimensional ideal with 23 nvars(basering) = ncols(i) = number of vars actually occuring in i 24 24 RETURN: list of all (complex) roots of the polynomial system i = 0, 25 25 of type number if the groundfield is the complex numbers, … … 32 32 int prec=30; 33 33 34 if ( size(#) >= 1 ) 35 36 37 if ( typ < 0 || typ > 1 )38 39 40 41 42 43 44 if ( size(#) >= 2 ) 45 46 47 48 if ( prec < 0 )49 50 51 52 53 54 if ( size(#) >= 3 ) 55 56 57 if ( polish < 0 || polish > 3 )58 59 60 61 62 63 64 65 66 if ( size(#) > 3 ) 67 68 69 70 71 34 if ( size(#) >= 1 ) 35 { 36 typ= #[1]; 37 if ( typ < 0 || typ > 1 ) 38 { 39 ERROR("// Valid values for second parameter are: 40 // 0: use sparse Resultant (default) 41 // 1: use Macaulay Resultant"); 42 } 43 } 44 if ( size(#) >= 2 ) 45 { 46 prec= #[2]; 47 if ( prec == 0 ) { prec = 30; } 48 if ( prec < 0 ) 49 { 50 "// Fourth parameter must be positive!"; 51 return(); 52 } 53 } 54 if ( size(#) >= 3 ) 55 { 56 polish= #[3]; 57 if ( polish < 0 || polish > 3 ) 58 { 59 "// Valid values for third parameter are: "; 60 "// 0,1,2: number of iterations for approximation of roots"; 61 return(); 62 } 63 if ( polish == 0 ) { polish = 3; } 64 } 65 66 if ( size(#) > 3 ) 67 { 68 // Error 69 "// only three parameters allowed!"; 70 return(); 71 } 72 72 73 73 int digits= system("setFloatDigits",prec); 74 74 75 75 return(uressolve(gls,typ,polish)); 76 76 77 77 } 78 78 example … … 86 86 87 87 pause; 88 // now with complex coefficient field, precision is 10 digits 88 // now with complex coefficient field, precision is 10 digits 89 89 ring rsc= (real,10,I),(x,y),lp; 90 90 ideal i = x2 + y2 - 8,x2 + xy + 2y2; … … 106 106 int prec=30; 107 107 108 if ( size(#) >= 1 ) 109 110 111 112 if ( prec < 0 )113 114 115 116 117 118 if ( size(#) >= 2 ) 119 120 121 122 if ( polish < 0 || polish > 2 )123 124 125 126 127 128 129 if ( size(#) > 2 ) 130 131 132 133 108 if ( size(#) >= 1 ) 109 { 110 prec= #[1]; 111 if ( prec == 0 ) { prec = 30; } 112 if ( prec < 0 ) 113 { 114 "// Fisrt parameter must be positive!"; 115 return(); 116 } 117 } 118 if ( size(#) >= 2 ) 119 { 120 polish= #[2]; 121 if ( polish == 0 ) { polish = 3; } 122 if ( polish < 0 || polish > 2 ) 123 { 124 "// Valid values for third parameter are: "; 125 "// 0,1,2: number of iterations for approximation of roots"; 126 return(); 127 } 128 } 129 if ( size(#) > 2 ) 130 { 131 "// only two parameters allowed!"; 132 return(); 133 } 134 134 135 135 int digits= system("setFloatDigits",prec); 136 136 137 137 return(laguerre(f,polish)); 138 138 139 139 } 140 140 example … … 163 163 k=1: resultant matrix of Macaulay (k=0 is default) 164 164 ASSUME: nvars(basering) = ncols(i)-1 = number of vars actually occuring in i, 165 for k=1 i must be homogeneous 166 RETURN: module representing the multipolynomial resultant matrix 165 for k=1 i must be homogeneous 166 RETURN: module representing the multipolynomial resultant matrix 167 167 EXAMPLE: example mp_res_mat; shows an example 168 168 " … … 170 170 int typ=2; 171 171 172 if ( size(#) == 1 ) 173 { 174 typ= #[1]; 175 if ( typ == 0 ) { typ = 2; } 176 if ( typ < 0 || typ > 2 ) 177 { 178 "// Valid values for third parameter are: "; 179 "// 0: sparse resultant (default)"; 180 "// 1: Macaulay resultant"; 181 return(); 182 } 183 } 184 if ( size(#) > 1 ) 185 { 186 "// only two parameters allowed!"; 187 return(); 188 } 189 172 if ( size(#) == 1 ) 173 { 174 typ= #[1]; 175 if ( typ == 0 ) { typ = 2; } 176 if ( typ < 0 || typ > 2 ) 177 { 178 "// Valid values for third parameter are: "; 179 "// 0: sparse resultant (default)"; 180 "// 1: Macaulay resultant"; 181 return(); 182 } 183 } 184 if ( size(#) > 1 ) 185 { 186 "// only two parameters allowed!"; 187 return(); 188 } 190 189 return(mpresmat(gls,typ)); 191 192 190 } 193 191 example … … 227 225 ASSUME: ground field K is the rational or real or complex numbers, 228 226 p and v consist of numbers of the ground filed K, p must have 229 n elements, v must have N=(d+1)^n elements where n=nvars(basering) 230 and d=deg(f) (f is the unknown polynomial in K[x1,...,xn]) 227 n elements, v must have N=(d+1)^n elements where n=nvars(basering) 228 and d=deg(f) (f is the unknown polynomial in K[x1,...,xn]) 231 229 COMPUTE: polynomial f with values given by v at points p1,..,pN derived from p; 232 230 more precisely: consider p as point in K^n and v as N elements in K, … … 246 244 ring r1 = 0,(x),lp; 247 245 // First example: 248 // deg(f) = 4, 246 // deg(f) = 4, 249 247 // v = values of f at points 3^0, 3^1, 3^2, 3^3, 3^4 250 248 ideal v=16,0,11376,1046880,85949136; … … 252 250 253 251 ring r2 = 0,(x,y),dp; 254 // Second example: 252 // Second example: 255 253 // deg(f) = 3 256 254 // valuation point (2,3) … … 261 259 } 262 260 /////////////////////////////////////////////////////////////////////////////// 263 264 265 266 267 268
Note: See TracChangeset
for help on using the changeset viewer.