Changeset 3fec85e in git
- Timestamp:
- Jun 27, 2017, 3:47:44 PM (7 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- b50b0b8a544a2c327dc314387550d68648f40c1e
- Parents:
- 2a1f11fce595ce5d7bd2454067f03fce4477208f4383b70207f6512bffe5479264c1bc0a9c8043b1
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2017-06-27 15:47:44+02:00
- git-committer:
- GitHub <noreply@github.com>2017-06-27 15:47:44+02:00
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/rootisolation.lib
r2a1f11 r3fec85e 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="version root Isolation.lib 0.2Jun_2017 ";2 version="version rootisolation.lib 4.1.0.0 Jun_2017 "; 3 3 info=" 4 LIBRARY: root Isolation.lib implements an algorithm for real root isolation4 LIBRARY: rootisolation.lib implements an algorithm for real root isolation 5 5 using interval arithmetic 6 AUTHORS: Dominik Bendle 7 @* Clara Petroll 8 9 OVERVIEW: In this library the interval arithmetic from interval.so is used. 10 The new type 'ivmat', a matrix consiting of intervals is 11 implemented as newstruct. There are various functions for 12 computations with interval matrices implemented, such as Gaussian 13 elimination for interval matrices. 14 Interval arithmetic, the interval Newton Step and exclusion methods 15 are used to implement the procedure 'realRootIsolation', an 6 AUTHORS: Dominik Bendle (bendle@rhrk.uni-kl.de) 7 @* Clara Petroll (petroll@rhrk.uni-kl.de) 8 9 OVERVIEW: In this library the interval arithmetic from \"@code{interval.so}\" 10 is used. The new type \"@code{ivmat}\", a matrix consiting of 11 intervals is implemented as \"@code{newstruct}\". There are various 12 functions for computations with interval matrices implemented, such 13 as Gaussian elimination for interval matrices. 14 15 @* Interval arithmetic, the interval Newton Step and exclusion methods 16 are used to implement the procedure \"@code{rootIsolation}\", an 16 17 algorithm which finds boxes containing elements of the vanishing 17 18 locus of an ideal. This algorithm is specialised for 18 19 zero-dimensional radical ideals. The theory about the interval 19 20 Newton Step is detailed in [2]. 21 22 @* Note that interval arithmetic and the aforementioned procedures are 23 intended for rational or real polynomial rings. 20 24 21 25 REFERENCES: [1] Cloud, Kearfott, Moore: Introduction to Interval Analysis, … … 29 33 30 34 OVERLOADS: 31 // interval matrices32 35 [ ivmatGet indexing 33 36 print ivmatPrint printing 34 37 nrows ivmatNrows number of rows 35 ncols ivmatNcols number of columns 36 det determinant determinant 38 ncols ivmatNcols number of columns@* 37 39 * ivmatMultiplyGeneral matrix multiplication 38 40 … … 53 55 static proc mod_init() 54 56 { 55 LIB "interval.so"; // use this if integrated into Singular Sources 56 //LIB "dyn_modules/interval.so"; 57 LIB "interval.so"; 57 58 LIB "atkins.lib"; // for round (tmp?) 58 59 … … 71 72 // helper function for assignment 72 73 proc bounds(number a, list #) 73 "USAGE: bounds(a); a number; 74 @* bounds(a, b); a, b number; 75 RETURN: if size(#)==0 it returns the interval [a,a], else the interval [a,#[1]] 74 "USAGE: @code{bounds(a)}; @code{a number}; 75 @* @code{bounds(a, b)}; @code{a, b number}; 76 RETURN: interval: if @code{size(#)==0} it returns the interval @code{[a, a]}, 77 else the interval @code{[a,#[1]]} 76 78 EXAMPLE: example bounds; create two intervals" 77 79 { … … 235 237 236 238 proc ivmatInit(numrows, numcols) 237 "USAGE: ivmatInit(m, n); m, n int 238 RETURN: mxn matrix of [0,0]-intervals 239 "USAGE: @code{ivmatInit(m, n)}; @code{m, n int} 240 RETURN: @code{m}x@code{n} matrix of [0,0]-intervals 241 PURPOSE: initialises an interval matrix with [0,0] intervals to ensure the 242 proper structure of the @code{ivmat} type 239 243 EXAMPLE: example ivmatInit; initialises an interval matrix" 240 244 { … … 301 305 302 306 proc ivmatSet(ivmat A, int i, int j, interval I) 303 "USAGE: ivmatSet(A, i, j, I), A ivmat, i, j, int, I interval 304 RETURN: ivmat A where A[i][j] == I 307 "USAGE: @code{ivmatSet(A, i, j, I)}; @code{A ivmat, i, j, int, I interval} 308 RETURN: interval matrix @code{A} where @code{A[i][j] == I} 309 PURPOSE: modify a single entry of an @code{ivmat} 305 310 EXAMPLE: example ivmatSet; assign values to A" 306 311 { … … 335 340 } 336 341 337 static proc unitMatrix(int n) 338 "USAGE: unitMatrix(n) 339 RETURN: nxn unit matrix" 342 proc unitMatrix(int n) 343 "USAGE: @code{unitMatrix(n)}; @code{n int} 344 RETURN: @code{n}x@code{n} unit interval matrix 345 EXAMPLE: example unitMatrix; generate a unit matrix" 340 346 { 341 347 return(diagMatrix(n, 1)); 348 } 349 example 350 { 351 ring R = 0,(x,y),lp; 352 unitMatrix(2); 353 unitMatrix(3); 342 354 } 343 355 … … 374 386 375 387 proc ivmatGaussian(ivmat A) 376 "USAGE: ivmatGaussian(A); A ivmat 377 RETURN: 0 if A not invertible, 1,Ainv if A invertible 378 NOTE: Inverts an interval matrix using Gussian elimination in the setting 379 of interval arithmetic. Pivotting is handled as a special case as 380 I/I != [1,1] and I-I != [0,0] in general. 388 "USAGE: @code{ivmatGaussian(A)}; @code{A ivmat} 389 RETURN: 0 if @code{A} not invertible, @code{(1, Ainv)} if @code{A} invertible 390 where @code{Ainv} is the inverse matrix 391 PURPOSE: Inverts an interval matrix using Gaussian elimination in the setting 392 of interval arithmetic. Pivoting is handled as a special case as 393 @code{I/I != [1,1]} and @code{I-I != [0,0]} in general. 381 394 EXAMPLE: example ivmatGaussian; inverts a matrix" 382 395 { … … 505 518 506 519 proc evalJacobianAtBox(ideal I, box B) 507 "USAGE: evalJacobianAtBox(I, B); I ideal B box 508 RETURN: jacobian matrix of I where polynomials are evaluated at B 520 "USAGE: @code{evalJacobianAtBox(I, B)}; @code{I ideal B box} 521 RETURN: Jacobian matrix of @code{I} where polynomials are evaluated at @code{B} 522 PURPOSE: evaluates each polynomial of the Jacobian matrix of @code{I} using 523 interval arithmetic 509 524 EXAMPLE: example evalJacobianAtBox; evalate Jacobian at box" 510 525 { … … 686 701 687 702 proc rootIsolationNoPreprocessing(ideal I, def start, number eps) 688 "USAGE: rootIsolationNoPreprocessing(I, B, eps); I ideal, B box/list of boxes, 689 eps number; 690 ASSUME: I is a zero-dimensional radical ideal 691 RETURN: L1, L2, where L1 contains boxes smaller than eps which may contain an 692 element of V(I), i.e. a root and L2 contains boxes which contain 693 exactly one element of V(I) 694 PURPOSE: Given input box(es) start we try to find all roots of I lying in start 695 by computing boxes that contain exactly on root. If eps > 0 then boxes 696 that become smaller than eps will be returned. 703 "USAGE: @code{rootIsolationNoPreprocessing(I, B, eps)}; @code{I ideal, B box/list of boxes, 704 eps number}; 705 ASSUME: @code{I} is a zero-dimensional radical ideal 706 RETURN: @code{(L1, L2)}, where @code{L1} contains boxes smaller than eps which may contain an 707 element of V(@code{I}), i.e. a root and @code{L2} contains boxes which contain 708 exactly one element of V(@code{I}) 709 PURPOSE: Given input box(es) @code{start} we try to find all roots of @code{I} 710 lying in @code{start} by computing boxes that contain exactly one root. 711 If @code{eps} > 0 then boxes that become smaller than @code{eps} will 712 be returned. 697 713 THEORY: We first check for every box if it contains no roots by interval 698 arithmetic. If this is inconclusive we apply the Newton step , whichas699 outlined in [2] and [3] converges to a root lying in the starting box.714 arithmetic. If this is inconclusive we apply the Newton step which, as 715 outlined in [2] and [3], converges to a root lying in the starting box. 700 716 If the result of the Newton step is already contained in the interior 701 717 of the starting box, it contains a unique root. … … 733 749 734 750 // debug 735 int cnt;751 //int cnt; 736 752 737 753 while (size(B) <> 0) … … 768 784 769 785 // debug 770 cnt++;771 print(string(cnt, " ", s, " ", int(memory(0)/1024), "k"));786 //cnt++; 787 //print(string(cnt, " ", s, " ", int(memory(0)/1024), "k")); 772 788 773 789 B = B_prime; … … 842 858 //im Moment geht das nur mit eingegebener eliminationsordnung 843 859 proc rootIsolation(ideal I, box start, number eps) 844 "USAGE: rootIsolation(I, start, eps); I ideal, start box, eps number845 ASSUME: Iis a zero-dimensional radical ideal846 and basering is defined with an elimination ordering;847 RETURN: L1, L2, where L1contains boxes smaller than eps which may contain an848 element of V( I), i.e. a root and L2contains boxes which contain849 exactly one element of V( I)850 PURPOSE: same as rootIsolationNoPreprocessing, but speeds up computation by860 "USAGE: @code{rootIsolation(I, start, eps)}; @code{I ideal, start box, eps number} 861 ASSUME: @code{I} is a zero-dimensional radical ideal 862 and @code{basering} is defined with an elimination ordering. 863 RETURN: @code{(L1, L2)}, where @code{L1} contains boxes smaller than eps which may contain an 864 element of V(@code{I}), i.e. a root and @code{L2} contains boxes which contain 865 exactly one element of V(@code{I}) 866 PURPOSE: same as @code{rootIsolationNoPreprocessing}, but speeds up computation by 851 867 preprocessing starting box 852 THEORY: As every root of I is a root of the polynomials I[i], we use Groebner853 elimination to find univariate polynomials for every variable which854 have these roots as well. Applying root isolation to these univariate855 polynomials then provides smaller starting boxes which speed up856 computations in the multivariate case.868 THEORY: As every root of @code{I} is a root of the polynomials @code{I[i]}, we 869 use Groebner elimination to find univariate polynomials for every 870 variable which have these roots as well. Applying root isolation to 871 these univariate polynomials then provides smaller starting boxes which 872 speed up computations in the multivariate case. 857 873 EXAMPLE: example rootIsolation; for intersection of two ellipses" 858 874 { -
Singular/singular-libs
r4383b7 r3fec85e 50 50 orbitparam.lib \ 51 51 parallel.lib polymake.lib polybori.lib \ 52 realizationMatroids.lib resources.lib ringgb.lib rwalk.lib rstandard.lib \ 52 realizationMatroids.lib resources.lib ringgb.lib \ 53 rootisolation.lib rwalk.lib rstandard.lib \ 53 54 schreyer.lib symodstd.lib schubert.lib swalk.lib \ 54 55 tasks.lib tropical.lib tropicalNewton.lib
Note: See TracChangeset
for help on using the changeset viewer.