Class SparseEigenvalue
- java.lang.Object
-
- gov.nih.mipav.model.structures.jama.SparseEigenvalue
-
- All Implemented Interfaces:
java.io.Serializable
public class SparseEigenvalue extends java.lang.Object implements java.io.Serializable
These sparse symmetric eigenvalue and eigenvector routines are ported from the FORTRAN ARPACK package. The license with the orginal ARPACK package is: BSD Software License Pertains to ARPACK and P_ARPACK Copyright (c) 1996-2008 Rice University. Developed by D.C. Sorensen, R.B. Lehoucq, C. Yang, and K. Maschhoff. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer listed in this license in the documentation and/or other materials provided with the distribution. - Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.- Author:
- ilb
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
dgetv0_first
private boolean
dgetv0_inits
private int[]
dgetv0_iseed
private int
dgetv0_iter
private int
dgetv0_msglvl
private boolean
dgetv0_orth
private double
dgetv0_rnorm0
private boolean
dsaitr_first
private int[]
dsaitr_ierr
private int
dsaitr_ipj
private int
dsaitr_irj
private int
dsaitr_iter
private int
dsaitr_itry
private int
dsaitr_ivj
private int
dsaitr_j
private int
dsaitr_msglvl
private boolean
dsaitr_orth1
private boolean
dsaitr_orth2
private double
dsaitr_rnorm1
private boolean
dsaitr_rstart
private double
dsaitr_safmin
private boolean
dsaitr_step3
private boolean
dsaitr_step4
private double
dsaitr_wnorm
private double
dsapps_epsmch
private boolean
dsapps_first
private boolean
dsaup2_cnorm
private double
dsaup2_eps23
private boolean
dsaup2_getv0
private boolean
dsaup2_initv
private int
dsaup2_iter
private int
dsaup2_kplusp
private int
dsaup2_msglvl
private int[]
dsaup2_nconv
private int
dsaup2_nev0
private int
dsaup2_np0
private double[]
dsaup2_rnorm
private boolean
dsaup2_update
private boolean
dsaup2_ushift
private int
dsaupd_bounds
private int
dsaupd_ierr
private int
dsaupd_ih
private int
dsaupd_iq
private int
dsaupd_ishift
private int
dsaupd_iupd
private int
dsaupd_iw
private int
dsaupd_ldh
private int
dsaupd_ldq
private int
dsaupd_mode
private int
dsaupd_msglvl
private int[]
dsaupd_mxiter
private int
dsaupd_nb
private int[]
dsaupd_nev0
private int
dsaupd_next
private int[]
dsaupd_np
private int
dsaupd_ritz
(package private) GeneralizedEigenvalue
ge
(package private) LinearEquations
le
private int
mgetv0
private int
msaitr
private int
msapps
private int
msaup2
private int
msaupd
private int
mseigt
private int
mseupd
private int
msgets
private int
nbx
(package private) java.text.DecimalFormat
nf
private int
nitref
private int
nopx
private int
nrorth
private int
nrstrt
private long
t0
private long
t1
private long
t2
private long
t3
private long
t4
private long
t5
private double
tgetv0
private double
titref
private double
tmvbx
private double
tmvopx
private double
tsaitr
private double
tsapps
private double
tsaup2
private double
tsaupd
private double
tsconv
private double
tseigt
private double
tsgets
private ViewUserInterface
UI
-
Constructor Summary
Constructors Constructor Description SparseEigenvalue()
Creates a new SparseEigenvalue object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
atv(int m, int n, double[] w, double[] y)
private void
av(int nx, double[] v, double[] w)
private void
av2(int n, double[] v, double[] w)
private void
av3(int n, double[] v, double[] w)
private void
av4(int n, double[] v, double[] w)
private void
av5(int n, double[] v, double[] w)
private void
av6(int n, double[] v, double[] w)
private void
avsimp(int nx, double[] v, double[] w)
private void
avsvd(int m, int n, double[] x, double[] w)
private void
dchkgt(boolean[] dotype, int nn, int[] nval, int nns, int[] nsval, double thresh, double[] a, double[] af, double[] b, double[] x, double[] xact, double[] work, double[] rwork, int[] iwork)
void
dchkgt_test()
This dchkgt_test routine is a port of a portion of the version 3.4.1 LAPACK test routine DCHKAA by Univ. of Tennessee, Univ.private void
dgetv0(int[] ido, java.lang.String bmat, int itry, boolean initv, int n, int j, double[][] v, int ldv, double[] resid, double[] rnorm, int[] ipntr, double[] workd, int[] ierr)
private void
dgtcon(char NORM, int N, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, double ANORM, double[] RCOND, double[] WORK, int[] IWORK, int[] INFO)
private void
dgtrfs(char trans, int n, int nrhs, double[] dl, double[] d, double[] du, double[] dlf, double[] df, double[] duf, double[] du2, int[] ipiv, double[][] b, int ldb, double[][] x, int ldx, double[] ferr, double[] berr, double[] work, int[] iwork, int[] info)
private void
dgtt01(int n, double[] dl, double[] d, double[] du, double[] dlf, double[] df, double[] duf, double[] du2, int[] ipiv, double[][] work, int ldwork, double[] rwork, double[] resid)
private void
dgtt02(char TRANS, int N, int NRHS, double[] DL, double[] D, double[] DU, double[][] X, int LDX, double[][] B, int LDB, double[] RWORK, double[] RESID)
private void
dgtt05(char trans, int n, int nrhs, double[] dl, double[] d, double[] du, double[][] b, int ldb, double[][] x, int ldx, double[][] xact, int ldxact, double[] ferr, double[] berr, double[] reslts)
private void
dgttrf(int N, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, int[] INFO)
private void
dgttrs(char TRANS, int N, int NRHS, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, double[][] B, int LDB, int[] INFO)
private void
DGTTS2(int ITRANS, int N, int NRHS, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, double[][] B, int LDB)
private void
dlagtm(char trans, int n, int nrhs, double alpha, double[] dl, double[] d, double[] du, double[][] x, int ldx, double beta, double[][] b, int ldb)
private double
dlangt(char norm, int n, double[] dl, double[] d, double[] du)
private void
dsaitr(int[] ido, java.lang.String bmat, int n, int k, int np, int mode, double[] resid, double[] rnorm, double[][] v, int ldv, double[][] h, int ldh, int[] ipntr, double[] workd, int[] info)
private void
dsapps(int n, int kev, int np, double[] shift, double[][] v, int ldv, double[][] h, int ldh, double[] resid, double[][] q, int ldq, double[] workd)
private void
dsaup2(int[] ido, java.lang.String bmat, int n, java.lang.String which, int[] nev, int[] np, double[] tol, double[] resid, int mode, int iupd, int ishift, int[] mxiter, double[][] v, int ldv, double[][] h, int ldh, double[] ritz, double[] bounds, double[][] q, int ldq, double[] workl, int[] ipntr, double[] workd, int[] info)
void
dsaupd(int[] ido, java.lang.String bmat, int n, java.lang.String which, int nev, double[] tol, double[] resid, int ncv, double[][] v, int ldv, int[] iparam, int[] ipntr, double[] workd, double[] workl, int lworkl, int[] info)
private void
dsconv(int n, double[] ritz, double[] bounds, double tol, int[] nconv)
void
dsdrv1()
void
dsdrv2()
void
dsdrv3()
void
dsdrv4()
void
dsdrv5()
void
dsdrv6()
private void
dseigt(double rnorm, int n, double[][] h, int ldh, double[] eig, double[] bounds, double[] workl, int[] ierr)
private void
dsesrt(java.lang.String which, boolean apply, int n, double[] x, int na, double[][] a, int lda)
void
dseupd(boolean rvec, java.lang.String howmny, boolean[] select, double[] d, double[][] z, int ldz, double sigma, java.lang.String bmat, int n, java.lang.String which, int nev, double tol, double[] resid, int ncv, double[][] v, int ldv, int[] iparam, int[] ipntr, double[] workd, double[] workl, int lworkl, int[] info)
private void
dsgets(int ishift, java.lang.String which, int kev, int np, double[] ritz, double[] bounds, double[] shifts)
private void
dsortr(java.lang.String which, boolean apply, int n, double[] x1, double[] x2)
void
dssimp()
private void
dstats()
private void
dstqrb(int n, double[] d, double[] e, double[] z, double[] work, int[] info)
void
dsvd()
private void
matMult(int n, double[][] A, double[] x, double[] y)
private void
mv3(int n, double[] v, double[] w)
private void
mv4(int n, double[] v, double[] w)
private void
mv5(int n, double[] v, double[] w)
private void
mv6(int n, double[] v, double[] w)
private void
printHeader()
void
simpleEigenvalue(double[][] A, int nev, java.lang.String which, double[] tol, int ncv, double[] d, double[][] Z)
Calculate requested eigenvalues and eigenvectors of a matrixvoid
simpleEigenvalueTest1()
private void
tv(int nx, double[] x, double[] y)
private void
tvsimp(int nx, double[] x, double[] y)
-
-
-
Field Detail
-
ge
GeneralizedEigenvalue ge
-
le
LinearEquations le
-
UI
private ViewUserInterface UI
-
nf
java.text.DecimalFormat nf
-
dsaupd_bounds
private int dsaupd_bounds
-
dsaupd_ierr
private int dsaupd_ierr
-
dsaupd_ih
private int dsaupd_ih
-
dsaupd_iq
private int dsaupd_iq
-
dsaupd_ishift
private int dsaupd_ishift
-
dsaupd_iupd
private int dsaupd_iupd
-
dsaupd_iw
private int dsaupd_iw
-
dsaupd_ldh
private int dsaupd_ldh
-
dsaupd_ldq
private int dsaupd_ldq
-
dsaupd_msglvl
private int dsaupd_msglvl
-
dsaupd_mxiter
private int[] dsaupd_mxiter
-
dsaupd_mode
private int dsaupd_mode
-
dsaupd_nb
private int dsaupd_nb
-
dsaupd_nev0
private int[] dsaupd_nev0
-
dsaupd_next
private int dsaupd_next
-
dsaupd_np
private int[] dsaupd_np
-
dsaupd_ritz
private int dsaupd_ritz
-
t0
private long t0
-
t1
private long t1
-
t2
private long t2
-
t3
private long t3
-
t4
private long t4
-
t5
private long t5
-
nopx
private int nopx
-
nbx
private int nbx
-
nrorth
private int nrorth
-
nitref
private int nitref
-
nrstrt
private int nrstrt
-
tsaupd
private double tsaupd
-
tsaup2
private double tsaup2
-
tsaitr
private double tsaitr
-
tseigt
private double tseigt
-
tsgets
private double tsgets
-
tsapps
private double tsapps
-
tsconv
private double tsconv
-
titref
private double titref
-
tgetv0
private double tgetv0
-
tmvopx
private double tmvopx
-
tmvbx
private double tmvbx
-
mgetv0
private int mgetv0
-
msaupd
private int msaupd
-
msaup2
private int msaup2
-
msaitr
private int msaitr
-
mseigt
private int mseigt
-
msapps
private int msapps
-
msgets
private int msgets
-
mseupd
private int mseupd
-
dsaup2_cnorm
private boolean dsaup2_cnorm
-
dsaup2_getv0
private boolean dsaup2_getv0
-
dsaup2_initv
private boolean dsaup2_initv
-
dsaup2_update
private boolean dsaup2_update
-
dsaup2_ushift
private boolean dsaup2_ushift
-
dsaup2_iter
private int dsaup2_iter
-
dsaup2_kplusp
private int dsaup2_kplusp
-
dsaup2_msglvl
private int dsaup2_msglvl
-
dsaup2_nconv
private int[] dsaup2_nconv
-
dsaup2_nev0
private int dsaup2_nev0
-
dsaup2_np0
private int dsaup2_np0
-
dsaup2_rnorm
private double[] dsaup2_rnorm
-
dsaup2_eps23
private double dsaup2_eps23
-
dgetv0_first
private boolean dgetv0_first
-
dgetv0_inits
private boolean dgetv0_inits
-
dgetv0_orth
private boolean dgetv0_orth
-
dgetv0_iseed
private int[] dgetv0_iseed
-
dgetv0_iter
private int dgetv0_iter
-
dgetv0_msglvl
private int dgetv0_msglvl
-
dgetv0_rnorm0
private double dgetv0_rnorm0
-
dsaitr_orth1
private boolean dsaitr_orth1
-
dsaitr_orth2
private boolean dsaitr_orth2
-
dsaitr_rstart
private boolean dsaitr_rstart
-
dsaitr_step3
private boolean dsaitr_step3
-
dsaitr_step4
private boolean dsaitr_step4
-
dsaitr_first
private boolean dsaitr_first
-
dsaitr_ierr
private int[] dsaitr_ierr
-
dsaitr_ipj
private int dsaitr_ipj
-
dsaitr_irj
private int dsaitr_irj
-
dsaitr_ivj
private int dsaitr_ivj
-
dsaitr_iter
private int dsaitr_iter
-
dsaitr_itry
private int dsaitr_itry
-
dsaitr_j
private int dsaitr_j
-
dsaitr_msglvl
private int dsaitr_msglvl
-
dsaitr_rnorm1
private double dsaitr_rnorm1
-
dsaitr_safmin
private double dsaitr_safmin
-
dsaitr_wnorm
private double dsaitr_wnorm
-
dsapps_epsmch
private double dsapps_epsmch
-
dsapps_first
private boolean dsapps_first
-
-
Method Detail
-
simpleEigenvalueTest1
public void simpleEigenvalueTest1()
-
simpleEigenvalue
public void simpleEigenvalue(double[][] A, int nev, java.lang.String which, double[] tol, int ncv, double[] d, double[][] Z)
Calculate requested eigenvalues and eigenvectors of a matrix- Parameters:
A
- Symmetric real matrix for which eigenvalues and eigenvectors will be calculated n = A.length = A[0].lengthnev
- Number of eigenvalues and accompanying eigenvectors to be calculatedwhich
- WHICH must be one of "LM", "SM", "LA", "SA" or "BE" largest and smallest magnitudes, largest and smallest amplitudes, both ends of the spectrumtol
- determines the stopping criterion. Expect | abs(lambdaC - lambdaT) < tol*abs(lambdaC) computed true If tol .le. 0, then tol <- macheps (machine precision) is used.ncv
- The largest number of basis vectors that will be used in the Implicitly Restarted Arnoldi Process. Work per major iteration is proportional to n*ncv*ncv. As a rule of thumb, ncv >= 2 * nev is reasonable. ncv must be >= nev+1 and ncv must be <= n.d
- User supplied array of size nev will hold the calculated eigenvaluesZ
- User supplied array of size [A.length][nev] to hold the calculated eigenvalues
-
matMult
private void matMult(int n, double[][] A, double[] x, double[] y)
-
dssimp
public void dssimp()
-
avsimp
private void avsimp(int nx, double[] v, double[] w)
-
tvsimp
private void tvsimp(int nx, double[] x, double[] y)
-
dsvd
public void dsvd()
-
avsvd
private void avsvd(int m, int n, double[] x, double[] w)
-
atv
private void atv(int m, int n, double[] w, double[] y)
-
dsdrv1
public void dsdrv1()
-
av
private void av(int nx, double[] v, double[] w)
-
tv
private void tv(int nx, double[] x, double[] y)
-
dsdrv2
public void dsdrv2()
-
av2
private void av2(int n, double[] v, double[] w)
-
dsdrv3
public void dsdrv3()
-
mv3
private void mv3(int n, double[] v, double[] w)
-
av3
private void av3(int n, double[] v, double[] w)
-
dsdrv4
public void dsdrv4()
-
mv4
private void mv4(int n, double[] v, double[] w)
-
av4
private void av4(int n, double[] v, double[] w)
-
dsdrv5
public void dsdrv5()
-
mv5
private void mv5(int n, double[] v, double[] w)
-
av5
private void av5(int n, double[] v, double[] w)
-
dsdrv6
public void dsdrv6()
-
mv6
private void mv6(int n, double[] v, double[] w)
-
av6
private void av6(int n, double[] v, double[] w)
-
dchkgt_test
public void dchkgt_test()
This dchkgt_test routine is a port of a portion of the version 3.4.1 LAPACK test routine DCHKAA by Univ. of Tennessee, Univ. Of California Berkeley and NAG Ltd., April, 2012. and some values from the test data file dtest.in. Received message In dchkgt all 2694 tests run passed the threshold.
-
dchkgt
private void dchkgt(boolean[] dotype, int nn, int[] nval, int nns, int[] nsval, double thresh, double[] a, double[] af, double[] b, double[] x, double[] xact, double[] work, double[] rwork, int[] iwork)
-
dgtt05
private void dgtt05(char trans, int n, int nrhs, double[] dl, double[] d, double[] du, double[][] b, int ldb, double[][] x, int ldx, double[][] xact, int ldxact, double[] ferr, double[] berr, double[] reslts)
-
dgtrfs
private void dgtrfs(char trans, int n, int nrhs, double[] dl, double[] d, double[] du, double[] dlf, double[] df, double[] duf, double[] du2, int[] ipiv, double[][] b, int ldb, double[][] x, int ldx, double[] ferr, double[] berr, double[] work, int[] iwork, int[] info)
-
dgtt02
private void dgtt02(char TRANS, int N, int NRHS, double[] DL, double[] D, double[] DU, double[][] X, int LDX, double[][] B, int LDB, double[] RWORK, double[] RESID)
-
printHeader
private void printHeader()
-
dlagtm
private void dlagtm(char trans, int n, int nrhs, double alpha, double[] dl, double[] d, double[] du, double[][] x, int ldx, double beta, double[][] b, int ldb)
-
dgtcon
private void dgtcon(char NORM, int N, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, double ANORM, double[] RCOND, double[] WORK, int[] IWORK, int[] INFO)
-
dgtt01
private void dgtt01(int n, double[] dl, double[] d, double[] du, double[] dlf, double[] df, double[] duf, double[] du2, int[] ipiv, double[][] work, int ldwork, double[] rwork, double[] resid)
-
dlangt
private double dlangt(char norm, int n, double[] dl, double[] d, double[] du)
-
dgttrf
private void dgttrf(int N, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, int[] INFO)
-
dgttrs
private void dgttrs(char TRANS, int N, int NRHS, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, double[][] B, int LDB, int[] INFO)
-
DGTTS2
private void DGTTS2(int ITRANS, int N, int NRHS, double[] DL, double[] D, double[] DU, double[] DU2, int[] IPIV, double[][] B, int LDB)
-
dseupd
public void dseupd(boolean rvec, java.lang.String howmny, boolean[] select, double[] d, double[][] z, int ldz, double sigma, java.lang.String bmat, int n, java.lang.String which, int nev, double tol, double[] resid, int ncv, double[][] v, int ldv, int[] iparam, int[] ipntr, double[] workd, double[] workl, int lworkl, int[] info)
-
dsesrt
private void dsesrt(java.lang.String which, boolean apply, int n, double[] x, int na, double[][] a, int lda)
-
dsaupd
public void dsaupd(int[] ido, java.lang.String bmat, int n, java.lang.String which, int nev, double[] tol, double[] resid, int ncv, double[][] v, int ldv, int[] iparam, int[] ipntr, double[] workd, double[] workl, int lworkl, int[] info)
-
dsaup2
private void dsaup2(int[] ido, java.lang.String bmat, int n, java.lang.String which, int[] nev, int[] np, double[] tol, double[] resid, int mode, int iupd, int ishift, int[] mxiter, double[][] v, int ldv, double[][] h, int ldh, double[] ritz, double[] bounds, double[][] q, int ldq, double[] workl, int[] ipntr, double[] workd, int[] info)
-
dsapps
private void dsapps(int n, int kev, int np, double[] shift, double[][] v, int ldv, double[][] h, int ldh, double[] resid, double[][] q, int ldq, double[] workd)
-
dsconv
private void dsconv(int n, double[] ritz, double[] bounds, double tol, int[] nconv)
-
dsgets
private void dsgets(int ishift, java.lang.String which, int kev, int np, double[] ritz, double[] bounds, double[] shifts)
-
dsortr
private void dsortr(java.lang.String which, boolean apply, int n, double[] x1, double[] x2)
-
dseigt
private void dseigt(double rnorm, int n, double[][] h, int ldh, double[] eig, double[] bounds, double[] workl, int[] ierr)
-
dstqrb
private void dstqrb(int n, double[] d, double[] e, double[] z, double[] work, int[] info)
-
dsaitr
private void dsaitr(int[] ido, java.lang.String bmat, int n, int k, int np, int mode, double[] resid, double[] rnorm, double[][] v, int ldv, double[][] h, int ldh, int[] ipntr, double[] workd, int[] info)
-
dgetv0
private void dgetv0(int[] ido, java.lang.String bmat, int itry, boolean initv, int n, int j, double[][] v, int ldv, double[] resid, double[] rnorm, int[] ipntr, double[] workd, int[] ierr)
-
dstats
private void dstats()
-
-