Changeset 3fec85e in git


Ignore:
Timestamp:
Jun 27, 2017, 3:47:44 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
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
Message:
Merge pull request #822 from bendooru/spielwiese

rootisolation.lib documentation improvement
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/rootisolation.lib

    r2a1f11 r3fec85e  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="version rootIsolation.lib 0.2 Jun_2017 ";
     2version="version rootisolation.lib 4.1.0.0 Jun_2017 ";
    33info="
    4 LIBRARY:    rootIsolation.lib implements an algorithm for real root isolation
     4LIBRARY:    rootisolation.lib implements an algorithm for real root isolation
    55            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
     6AUTHORS:    Dominik Bendle (bendle@rhrk.uni-kl.de)
     7@*          Clara Petroll (petroll@rhrk.uni-kl.de)
     8
     9OVERVIEW:   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
    1617            algorithm which finds boxes containing elements of the vanishing
    1718            locus of an ideal. This algorithm is specialised for
    1819            zero-dimensional radical ideals. The theory about the interval
    1920            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.
    2024
    2125REFERENCES: [1] Cloud, Kearfott, Moore: Introduction to Interval Analysis,
     
    2933
    3034OVERLOADS:
    31 // interval matrices
    3235[           ivmatGet              indexing
    3336print       ivmatPrint            printing
    3437nrows       ivmatNrows            number of rows
    35 ncols       ivmatNcols            number of columns
    36 det         determinant           determinant
     38ncols       ivmatNcols            number of columns@*
    3739*           ivmatMultiplyGeneral  matrix multiplication
    3840
     
    5355static proc mod_init()
    5456{
    55     LIB "interval.so"; // use this if integrated into Singular Sources
    56     //LIB "dyn_modules/interval.so";
     57    LIB "interval.so";
    5758    LIB "atkins.lib"; // for round (tmp?)
    5859
     
    7172// helper function for assignment
    7273proc 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};
     76RETURN: interval: if @code{size(#)==0} it returns the interval @code{[a, a]},
     77        else the interval @code{[a,#[1]]}
    7678EXAMPLE: example bounds; create two intervals"
    7779{
     
    235237
    236238proc 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}
     240RETURN: @code{m}x@code{n} matrix of [0,0]-intervals
     241PURPOSE: initialises an interval matrix with [0,0] intervals to ensure the
     242        proper structure of the @code{ivmat} type
    239243EXAMPLE: example ivmatInit; initialises an interval matrix"
    240244{
     
    301305
    302306proc 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}
     308RETURN: interval matrix @code{A} where @code{A[i][j] == I}
     309PURPOSE: modify a single entry of an @code{ivmat}
    305310EXAMPLE: example ivmatSet; assign values to A"
    306311{
     
    335340}
    336341
    337 static proc unitMatrix(int n)
    338 "USAGE: unitMatrix(n)
    339 RETURN: nxn unit matrix"
     342proc unitMatrix(int n)
     343"USAGE: @code{unitMatrix(n)}; @code{n int}
     344RETURN: @code{n}x@code{n} unit interval matrix
     345EXAMPLE: example unitMatrix; generate a unit matrix"
    340346{
    341347    return(diagMatrix(n, 1));
     348}
     349example
     350{
     351    ring R = 0,(x,y),lp;
     352    unitMatrix(2);
     353    unitMatrix(3);
    342354}
    343355
     
    374386
    375387proc 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}
     389RETURN: 0 if @code{A} not invertible, @code{(1, Ainv)} if @code{A} invertible
     390        where @code{Ainv} is the inverse matrix
     391PURPOSE: 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.
    381394EXAMPLE: example ivmatGaussian; inverts a matrix"
    382395{
     
    505518
    506519proc 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}
     521RETURN: Jacobian matrix of @code{I} where polynomials are evaluated at @code{B}
     522PURPOSE: evaluates each polynomial of the Jacobian matrix of @code{I} using
     523        interval arithmetic
    509524EXAMPLE: example evalJacobianAtBox; evalate Jacobian at box"
    510525{
     
    686701
    687702proc 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};
     705ASSUME: @code{I} is a zero-dimensional radical ideal
     706RETURN: @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})
     709PURPOSE: 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.
    697713THEORY: We first check for every box if it contains no roots by interval
    698         arithmetic. If this is inconclusive we apply the Newton step, which as
    699         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.
    700716        If the result of the Newton step is already contained in the interior
    701717        of the starting box, it contains a unique root.
     
    733749
    734750    // debug
    735     int cnt;
     751    //int cnt;
    736752
    737753    while (size(B) <> 0)
     
    768784
    769785        // 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"));
    772788
    773789        B = B_prime;
     
    842858//im Moment geht das nur mit eingegebener eliminationsordnung
    843859proc rootIsolation(ideal I, box start, number eps)
    844 "USAGE:  rootIsolation(I, start, eps); I ideal, start box, eps number
    845 ASSUME: I is a zero-dimensional radical ideal
    846         and basering is defined with an elimination ordering;
    847 RETURN: L1, L2, where L1 contains boxes smaller than eps which may contain an
    848         element of V(I), i.e. a root and L2 contains boxes which contain
    849         exactly one element of V(I)
    850 PURPOSE: same as rootIsolationNoPreprocessing, but speeds up computation by
     860"USAGE:  @code{rootIsolation(I, start, eps)}; @code{I ideal, start box, eps number}
     861ASSUME: @code{I} is a zero-dimensional radical ideal
     862        and @code{basering} is defined with an elimination ordering.
     863RETURN: @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})
     866PURPOSE: same as @code{rootIsolationNoPreprocessing}, but speeds up computation by
    851867        preprocessing starting box
    852 THEORY: As every root of I is a root of the polynomials I[i], we use Groebner
    853         elimination to find univariate polynomials for every variable which
    854         have these roots as well. Applying root isolation to these univariate
    855         polynomials then provides smaller starting boxes which speed up
    856         computations in the multivariate case.
     868THEORY: 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.
    857873EXAMPLE: example rootIsolation; for intersection of two ellipses"
    858874{
  • Singular/singular-libs

    r4383b7 r3fec85e  
    5050        orbitparam.lib \
    5151        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 \
    5354        schreyer.lib symodstd.lib schubert.lib swalk.lib \
    5455        tasks.lib tropical.lib tropicalNewton.lib
Note: See TracChangeset for help on using the changeset viewer.