Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/09/12 11:42:08 (13 years ago)
Author:
gkronber
Message:

#1733 updated alglib sources to version 3.4.0 of alglib and updated project and plugin references

Location:
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ALGLIB/3.4.0
Files:
1 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ALGLIB/3.4.0/ALGLIB-3.4.0/linalg.cs

    r4977 r7294  
    13281328                    Array whose indexes range within [0..N-1, 0..N-1].
    13291329        N       -   size of matrix A.
    1330         IsUpper -   storage format.
    13311330        ZNeeded -   flag controlling whether the eigenvectors are needed or not.
    13321331                    If ZNeeded is equal to:
    13331332                     * 0, the eigenvectors are not returned;
    13341333                     * 1, the eigenvectors are returned.
     1334        IsUpper -   storage format.
    13351335
    13361336    Output parameters:
     
    1096010960                        Array whose indexes range within [0..N-1, 0..N-1].
    1096110961            N       -   size of matrix A.
    10962             IsUpper -   storage format.
    1096310962            ZNeeded -   flag controlling whether the eigenvectors are needed or not.
    1096410963                        If ZNeeded is equal to:
    1096510964                         * 0, the eigenvectors are not returned;
    1096610965                         * 1, the eigenvectors are returned.
     10966            IsUpper -   storage format.
    1096710967
    1096810968        Output parameters:
     
    1736817368    public class matgen
    1736917369    {
     17370        /*************************************************************************
     17371        Generation of a random uniformly distributed (Haar) orthogonal matrix
     17372
     17373        INPUT PARAMETERS:
     17374            N   -   matrix size, N>=1
     17375           
     17376        OUTPUT PARAMETERS:
     17377            A   -   orthogonal NxN matrix, array[0..N-1,0..N-1]
     17378
     17379          -- ALGLIB routine --
     17380             04.12.2009
     17381             Bochkanov Sergey
     17382        *************************************************************************/
    1737017383        public static void rmatrixrndorthogonal(int n,
    1737117384            ref double[,] a)
     
    1739617409
    1739717410
     17411        /*************************************************************************
     17412        Generation of random NxN matrix with given condition number and norm2(A)=1
     17413
     17414        INPUT PARAMETERS:
     17415            N   -   matrix size
     17416            C   -   condition number (in 2-norm)
     17417
     17418        OUTPUT PARAMETERS:
     17419            A   -   random matrix with norm2(A)=1 and cond(A)=C
     17420
     17421          -- ALGLIB routine --
     17422             04.12.2009
     17423             Bochkanov Sergey
     17424        *************************************************************************/
    1739817425        public static void rmatrixrndcond(int n,
    1739917426            double c,
     
    1743817465
    1743917466
     17467        /*************************************************************************
     17468        Generation of a random Haar distributed orthogonal complex matrix
     17469
     17470        INPUT PARAMETERS:
     17471            N   -   matrix size, N>=1
     17472
     17473        OUTPUT PARAMETERS:
     17474            A   -   orthogonal NxN matrix, array[0..N-1,0..N-1]
     17475
     17476          -- ALGLIB routine --
     17477             04.12.2009
     17478             Bochkanov Sergey
     17479        *************************************************************************/
    1744017480        public static void cmatrixrndorthogonal(int n,
    1744117481            ref complex[,] a)
     
    1746617506
    1746717507
     17508        /*************************************************************************
     17509        Generation of random NxN complex matrix with given condition number C and
     17510        norm2(A)=1
     17511
     17512        INPUT PARAMETERS:
     17513            N   -   matrix size
     17514            C   -   condition number (in 2-norm)
     17515
     17516        OUTPUT PARAMETERS:
     17517            A   -   random matrix with norm2(A)=1 and cond(A)=C
     17518
     17519          -- ALGLIB routine --
     17520             04.12.2009
     17521             Bochkanov Sergey
     17522        *************************************************************************/
    1746817523        public static void cmatrixrndcond(int n,
    1746917524            double c,
     
    1751217567
    1751317568
     17569        /*************************************************************************
     17570        Generation of random NxN symmetric matrix with given condition number  and
     17571        norm2(A)=1
     17572
     17573        INPUT PARAMETERS:
     17574            N   -   matrix size
     17575            C   -   condition number (in 2-norm)
     17576
     17577        OUTPUT PARAMETERS:
     17578            A   -   random matrix with norm2(A)=1 and cond(A)=C
     17579
     17580          -- ALGLIB routine --
     17581             04.12.2009
     17582             Bochkanov Sergey
     17583        *************************************************************************/
    1751417584        public static void smatrixrndcond(int n,
    1751517585            double c,
     
    1756117631
    1756217632
     17633        /*************************************************************************
     17634        Generation of random NxN symmetric positive definite matrix with given
     17635        condition number and norm2(A)=1
     17636
     17637        INPUT PARAMETERS:
     17638            N   -   matrix size
     17639            C   -   condition number (in 2-norm)
     17640
     17641        OUTPUT PARAMETERS:
     17642            A   -   random SPD matrix with norm2(A)=1 and cond(A)=C
     17643
     17644          -- ALGLIB routine --
     17645             04.12.2009
     17646             Bochkanov Sergey
     17647        *************************************************************************/
    1756317648        public static void spdmatrixrndcond(int n,
    1756417649            double c,
     
    1761317698
    1761417699
     17700        /*************************************************************************
     17701        Generation of random NxN Hermitian matrix with given condition number  and
     17702        norm2(A)=1
     17703
     17704        INPUT PARAMETERS:
     17705            N   -   matrix size
     17706            C   -   condition number (in 2-norm)
     17707
     17708        OUTPUT PARAMETERS:
     17709            A   -   random matrix with norm2(A)=1 and cond(A)=C
     17710
     17711          -- ALGLIB routine --
     17712             04.12.2009
     17713             Bochkanov Sergey
     17714        *************************************************************************/
    1761517715        public static void hmatrixrndcond(int n,
    1761617716            double c,
     
    1767017770
    1767117771
     17772        /*************************************************************************
     17773        Generation of random NxN Hermitian positive definite matrix with given
     17774        condition number and norm2(A)=1
     17775
     17776        INPUT PARAMETERS:
     17777            N   -   matrix size
     17778            C   -   condition number (in 2-norm)
     17779
     17780        OUTPUT PARAMETERS:
     17781            A   -   random HPD matrix with norm2(A)=1 and cond(A)=C
     17782
     17783          -- ALGLIB routine --
     17784             04.12.2009
     17785             Bochkanov Sergey
     17786        *************************************************************************/
    1767217787        public static void hpdmatrixrndcond(int n,
    1767317788            double c,
     
    1773017845
    1773117846
     17847        /*************************************************************************
     17848        Multiplication of MxN matrix by NxN random Haar distributed orthogonal matrix
     17849
     17850        INPUT PARAMETERS:
     17851            A   -   matrix, array[0..M-1, 0..N-1]
     17852            M, N-   matrix size
     17853
     17854        OUTPUT PARAMETERS:
     17855            A   -   A*Q, where Q is random NxN orthogonal matrix
     17856
     17857          -- ALGLIB routine --
     17858             04.12.2009
     17859             Bochkanov Sergey
     17860        *************************************************************************/
    1773217861        public static void rmatrixrndorthogonalfromtheright(ref double[,] a,
    1773317862            int m,
     
    1781617945
    1781717946
     17947        /*************************************************************************
     17948        Multiplication of MxN matrix by MxM random Haar distributed orthogonal matrix
     17949
     17950        INPUT PARAMETERS:
     17951            A   -   matrix, array[0..M-1, 0..N-1]
     17952            M, N-   matrix size
     17953
     17954        OUTPUT PARAMETERS:
     17955            A   -   Q*A, where Q is random MxM orthogonal matrix
     17956
     17957          -- ALGLIB routine --
     17958             04.12.2009
     17959             Bochkanov Sergey
     17960        *************************************************************************/
    1781817961        public static void rmatrixrndorthogonalfromtheleft(ref double[,] a,
    1781917962            int m,
     
    1790318046
    1790418047
     18048        /*************************************************************************
     18049        Multiplication of MxN complex matrix by NxN random Haar distributed
     18050        complex orthogonal matrix
     18051
     18052        INPUT PARAMETERS:
     18053            A   -   matrix, array[0..M-1, 0..N-1]
     18054            M, N-   matrix size
     18055
     18056        OUTPUT PARAMETERS:
     18057            A   -   A*Q, where Q is random NxN orthogonal matrix
     18058
     18059          -- ALGLIB routine --
     18060             04.12.2009
     18061             Bochkanov Sergey
     18062        *************************************************************************/
    1790518063        public static void cmatrixrndorthogonalfromtheright(ref complex[,] a,
    1790618064            int m,
     
    1798218140
    1798318141
     18142        /*************************************************************************
     18143        Multiplication of MxN complex matrix by MxM random Haar distributed
     18144        complex orthogonal matrix
     18145
     18146        INPUT PARAMETERS:
     18147            A   -   matrix, array[0..M-1, 0..N-1]
     18148            M, N-   matrix size
     18149
     18150        OUTPUT PARAMETERS:
     18151            A   -   Q*A, where Q is random MxM orthogonal matrix
     18152
     18153          -- ALGLIB routine --
     18154             04.12.2009
     18155             Bochkanov Sergey
     18156        *************************************************************************/
    1798418157        public static void cmatrixrndorthogonalfromtheleft(ref complex[,] a,
    1798518158            int m,
     
    1806218235
    1806318236
     18237        /*************************************************************************
     18238        Symmetric multiplication of NxN matrix by random Haar distributed
     18239        orthogonal  matrix
     18240
     18241        INPUT PARAMETERS:
     18242            A   -   matrix, array[0..N-1, 0..N-1]
     18243            N   -   matrix size
     18244
     18245        OUTPUT PARAMETERS:
     18246            A   -   Q'*A*Q, where Q is random NxN orthogonal matrix
     18247
     18248          -- ALGLIB routine --
     18249             04.12.2009
     18250             Bochkanov Sergey
     18251        *************************************************************************/
    1806418252        public static void smatrixrndmultiply(ref double[,] a,
    1806518253            int n)
     
    1813718325
    1813818326
     18327        /*************************************************************************
     18328        Hermitian multiplication of NxN matrix by random Haar distributed
     18329        complex orthogonal matrix
     18330
     18331        INPUT PARAMETERS:
     18332            A   -   matrix, array[0..N-1, 0..N-1]
     18333            N   -   matrix size
     18334
     18335        OUTPUT PARAMETERS:
     18336            A   -   Q^H*A*Q, where Q is random NxN orthogonal matrix
     18337
     18338          -- ALGLIB routine --
     18339             04.12.2009
     18340             Bochkanov Sergey
     18341        *************************************************************************/
    1813918342        public static void hmatrixrndmultiply(ref complex[,] a,
    1814018343            int n)
     
    2475224955    public class bdsvd
    2475324956    {
     24957        /*************************************************************************
     24958        Singular value decomposition of a bidiagonal matrix (extended algorithm)
     24959
     24960        The algorithm performs the singular value decomposition  of  a  bidiagonal
     24961        matrix B (upper or lower) representing it as B = Q*S*P^T, where Q and  P -
     24962        orthogonal matrices, S - diagonal matrix with non-negative elements on the
     24963        main diagonal, in descending order.
     24964
     24965        The  algorithm  finds  singular  values.  In  addition,  the algorithm can
     24966        calculate  matrices  Q  and P (more precisely, not the matrices, but their
     24967        product  with  given  matrices U and VT - U*Q and (P^T)*VT)).  Of  course,
     24968        matrices U and VT can be of any type, including identity. Furthermore, the
     24969        algorithm can calculate Q'*C (this product is calculated more  effectively
     24970        than U*Q,  because  this calculation operates with rows instead  of matrix
     24971        columns).
     24972
     24973        The feature of the algorithm is its ability to find  all  singular  values
     24974        including those which are arbitrarily close to 0  with  relative  accuracy
     24975        close to  machine precision. If the parameter IsFractionalAccuracyRequired
     24976        is set to True, all singular values will have high relative accuracy close
     24977        to machine precision. If the parameter is set to False, only  the  biggest
     24978        singular value will have relative accuracy  close  to  machine  precision.
     24979        The absolute error of other singular values is equal to the absolute error
     24980        of the biggest singular value.
     24981
     24982        Input parameters:
     24983            D       -   main diagonal of matrix B.
     24984                        Array whose index ranges within [0..N-1].
     24985            E       -   superdiagonal (or subdiagonal) of matrix B.
     24986                        Array whose index ranges within [0..N-2].
     24987            N       -   size of matrix B.
     24988            IsUpper -   True, if the matrix is upper bidiagonal.
     24989            IsFractionalAccuracyRequired -
     24990                        accuracy to search singular values with.
     24991            U       -   matrix to be multiplied by Q.
     24992                        Array whose indexes range within [0..NRU-1, 0..N-1].
     24993                        The matrix can be bigger, in that case only the  submatrix
     24994                        [0..NRU-1, 0..N-1] will be multiplied by Q.
     24995            NRU     -   number of rows in matrix U.
     24996            C       -   matrix to be multiplied by Q'.
     24997                        Array whose indexes range within [0..N-1, 0..NCC-1].
     24998                        The matrix can be bigger, in that case only the  submatrix
     24999                        [0..N-1, 0..NCC-1] will be multiplied by Q'.
     25000            NCC     -   number of columns in matrix C.
     25001            VT      -   matrix to be multiplied by P^T.
     25002                        Array whose indexes range within [0..N-1, 0..NCVT-1].
     25003                        The matrix can be bigger, in that case only the  submatrix
     25004                        [0..N-1, 0..NCVT-1] will be multiplied by P^T.
     25005            NCVT    -   number of columns in matrix VT.
     25006
     25007        Output parameters:
     25008            D       -   singular values of matrix B in descending order.
     25009            U       -   if NRU>0, contains matrix U*Q.
     25010            VT      -   if NCVT>0, contains matrix (P^T)*VT.
     25011            C       -   if NCC>0, contains matrix Q'*C.
     25012
     25013        Result:
     25014            True, if the algorithm has converged.
     25015            False, if the algorithm hasn't converged (rare case).
     25016
     25017        Additional information:
     25018            The type of convergence is controlled by the internal  parameter  TOL.
     25019            If the parameter is greater than 0, the singular values will have
     25020            relative accuracy TOL. If TOL<0, the singular values will have
     25021            absolute accuracy ABS(TOL)*norm(B).
     25022            By default, |TOL| falls within the range of 10*Epsilon and 100*Epsilon,
     25023            where Epsilon is the machine precision. It is not  recommended  to  use
     25024            TOL less than 10*Epsilon since this will  considerably  slow  down  the
     25025            algorithm and may not lead to error decreasing.
     25026        History:
     25027            * 31 March, 2007.
     25028                changed MAXITR from 6 to 12.
     25029
     25030          -- LAPACK routine (version 3.0) --
     25031             Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
     25032             Courant Institute, Argonne National Lab, and Rice University
     25033             October 31, 1999.
     25034        *************************************************************************/
    2475425035        public static bool rmatrixbdsvd(ref double[] d,
    2475525036            double[] e,
     
    2481825099
    2481925100
     25101        /*************************************************************************
     25102        Internal working subroutine for bidiagonal decomposition
     25103        *************************************************************************/
    2482025104        private static bool bidiagonalsvddecompositioninternal(ref double[] d,
    2482125105            double[] e,
     
    2806628350    public class inverseupdate
    2806728351    {
     28352        /*************************************************************************
     28353        Inverse matrix update by the Sherman-Morrison formula
     28354
     28355        The algorithm updates matrix A^-1 when adding a number to an element
     28356        of matrix A.
     28357
     28358        Input parameters:
     28359            InvA    -   inverse of matrix A.
     28360                        Array whose indexes range within [0..N-1, 0..N-1].
     28361            N       -   size of matrix A.
     28362            UpdRow  -   row where the element to be updated is stored.
     28363            UpdColumn - column where the element to be updated is stored.
     28364            UpdVal  -   a number to be added to the element.
     28365
     28366
     28367        Output parameters:
     28368            InvA    -   inverse of modified matrix A.
     28369
     28370          -- ALGLIB --
     28371             Copyright 2005 by Bochkanov Sergey
     28372        *************************************************************************/
    2806828373        public static void rmatrixinvupdatesimple(ref double[,] inva,
    2806928374            int n,
     
    2812028425
    2812128426
     28427        /*************************************************************************
     28428        Inverse matrix update by the Sherman-Morrison formula
     28429
     28430        The algorithm updates matrix A^-1 when adding a vector to a row
     28431        of matrix A.
     28432
     28433        Input parameters:
     28434            InvA    -   inverse of matrix A.
     28435                        Array whose indexes range within [0..N-1, 0..N-1].
     28436            N       -   size of matrix A.
     28437            UpdRow  -   the row of A whose vector V was added.
     28438                        0 <= Row <= N-1
     28439            V       -   the vector to be added to a row.
     28440                        Array whose index ranges within [0..N-1].
     28441
     28442        Output parameters:
     28443            InvA    -   inverse of modified matrix A.
     28444
     28445          -- ALGLIB --
     28446             Copyright 2005 by Bochkanov Sergey
     28447        *************************************************************************/
    2812228448        public static void rmatrixinvupdaterow(ref double[,] inva,
    2812328449            int n,
     
    2817328499
    2817428500
     28501        /*************************************************************************
     28502        Inverse matrix update by the Sherman-Morrison formula
     28503
     28504        The algorithm updates matrix A^-1 when adding a vector to a column
     28505        of matrix A.
     28506
     28507        Input parameters:
     28508            InvA        -   inverse of matrix A.
     28509                            Array whose indexes range within [0..N-1, 0..N-1].
     28510            N           -   size of matrix A.
     28511            UpdColumn   -   the column of A whose vector U was added.
     28512                            0 <= UpdColumn <= N-1
     28513            U           -   the vector to be added to a column.
     28514                            Array whose index ranges within [0..N-1].
     28515
     28516        Output parameters:
     28517            InvA        -   inverse of modified matrix A.
     28518
     28519          -- ALGLIB --
     28520             Copyright 2005 by Bochkanov Sergey
     28521        *************************************************************************/
    2817528522        public static void rmatrixinvupdatecolumn(ref double[,] inva,
    2817628523            int n,
     
    2822528572
    2822628573
     28574        /*************************************************************************
     28575        Inverse matrix update by the Sherman-Morrison formula
     28576
     28577        The algorithm computes the inverse of matrix A+u*v’ by using the given matrix
     28578        A^-1 and the vectors u and v.
     28579
     28580        Input parameters:
     28581            InvA    -   inverse of matrix A.
     28582                        Array whose indexes range within [0..N-1, 0..N-1].
     28583            N       -   size of matrix A.
     28584            U       -   the vector modifying the matrix.
     28585                        Array whose index ranges within [0..N-1].
     28586            V       -   the vector modifying the matrix.
     28587                        Array whose index ranges within [0..N-1].
     28588
     28589        Output parameters:
     28590            InvA - inverse of matrix A + u*v'.
     28591
     28592          -- ALGLIB --
     28593             Copyright 2005 by Bochkanov Sergey
     28594        *************************************************************************/
    2822728595        public static void rmatrixinvupdateuv(ref double[,] inva,
    2822828596            int n,
     
    2829028658    public class schur
    2829128659    {
     28660        /*************************************************************************
     28661        Subroutine performing the Schur decomposition of a general matrix by using
     28662        the QR algorithm with multiple shifts.
     28663
     28664        The source matrix A is represented as S'*A*S = T, where S is an orthogonal
     28665        matrix (Schur vectors), T - upper quasi-triangular matrix (with blocks of
     28666        sizes 1x1 and 2x2 on the main diagonal).
     28667
     28668        Input parameters:
     28669            A   -   matrix to be decomposed.
     28670                    Array whose indexes range within [0..N-1, 0..N-1].
     28671            N   -   size of A, N>=0.
     28672
     28673
     28674        Output parameters:
     28675            A   -   contains matrix T.
     28676                    Array whose indexes range within [0..N-1, 0..N-1].
     28677            S   -   contains Schur vectors.
     28678                    Array whose indexes range within [0..N-1, 0..N-1].
     28679
     28680        Note 1:
     28681            The block structure of matrix T can be easily recognized: since all
     28682            the elements below the blocks are zeros, the elements a[i+1,i] which
     28683            are equal to 0 show the block border.
     28684
     28685        Note 2:
     28686            The algorithm performance depends on the value of the internal parameter
     28687            NS of the InternalSchurDecomposition subroutine which defines the number
     28688            of shifts in the QR algorithm (similarly to the block width in block-matrix
     28689            algorithms in linear algebra). If you require maximum performance on
     28690            your machine, it is recommended to adjust this parameter manually.
     28691
     28692        Result:
     28693            True,
     28694                if the algorithm has converged and parameters A and S contain the result.
     28695            False,
     28696                if the algorithm has not converged.
     28697
     28698        Algorithm implemented on the basis of the DHSEQR subroutine (LAPACK 3.0 library).
     28699        *************************************************************************/
    2829228700        public static bool rmatrixschur(ref double[,] a,
    2829328701            int n,
Note: See TracChangeset for help on using the changeset viewer.