Date post: | 14-Jan-2016 |
Category: |
Documents |
Upload: | madeline-mckinney |
View: | 215 times |
Download: | 3 times |
Interface for Eigenvalue Interface for Eigenvalue MethodsMethods
John Wu Lawrence Berkeley National Laboratory
[email protected]@lbl.gov
OutlineOutline
• Review eigenvalue methodsReview eigenvalue methods
• Examine existing schemesExamine existing schemes
• Explore possible alternatives Explore possible alternatives
Types of Eigenvalue Types of Eigenvalue ProblemsProblems• Standard: Ax = Standard: Ax = xx
• Generalized: Ax = Generalized: Ax = BxBx
• Polynomial: -Ax+Polynomial: -Ax+BB11x+x+22BB22x+…=0x+…=0
• Constrains: Cx=0Constrains: Cx=0
Types of MethodsTypes of Methods
• QR based methods (direct methods)QR based methods (direct methods)– Need to access the elements of the Need to access the elements of the
matrixmatrix
– O(nO(n22) space complexity) space complexity
– O(nO(n33) time complexity) time complexity
• Projection based methods (iterative)Projection based methods (iterative)– Access matrix through MATVECAccess matrix through MATVEC
– Problem dependent space and time needProblem dependent space and time need
Existing SoftwareExisting Software
QR methodsQR methods
• LAPACKLAPACK
• EISPACKEISPACK
• ScaLAPACKScaLAPACK
• PLAPACKPLAPACK
Projection methodsProjection methods
• ARPACKARPACK
• LANSO, LASO, LANSO, LASO, LANZ, LANCZOS …LANZ, LANCZOS …
• Davidson method, Davidson method, JDQZ, …JDQZ, …
• RITZITRITZIT
• CG, CG,
Specifying an Eigenvalue Specifying an Eigenvalue ProblemProblem• Matrices: A, B, AMatrices: A, B, A-1-1, (A-, (A-B)B)-1-1B, BB, B-1-1AA
• Type of eigenvalues: largest, Type of eigenvalues: largest, smallest, around a center, in a smallest, around a center, in a rangerange
• Number of eigenvaluesNumber of eigenvalues
• Are eigenvectors needed as wellAre eigenvectors needed as well
Specifying an Eigenvalue Specifying an Eigenvalue Problem -- Computing Problem -- Computing IssuesIssues• Representations of matrices, Representations of matrices,
eigenvalues and eigenvectorseigenvalues and eigenvectors
• Interface to MATVEC and Interface to MATVEC and preconditionerpreconditioner
• Accuracy (reliability) requirementAccuracy (reliability) requirement
• Resource constrainsResource constrains
• Controlling parametersControlling parameters
netlib.org/lapackCase Study I -- LAPACKCase Study I -- LAPACK
SSYEVX(JOBZ, RANGE, UPLO, N, A, LDA, SSYEVX(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, IWORK, IFAIL, INFO)WORK, LWORK, IWORK, IFAIL, INFO)
• QR based methodQR based method
• Representing matrices as arrays (1-D)Representing matrices as arrays (1-D)
• User provide workspaceUser provide workspace
• User must set all optionsUser must set all options
ftp://ftp.caam.rice.edu/pub/software/ARPACK
Case Study II -- ARPACKCase Study II -- ARPACK
DNAUPD(COMM, IDO, BMAT, N, WHICH, DNAUPD(COMM, IDO, BMAT, N, WHICH, NEV, TOL, RESID, NCV, V, LDV, IPARAM, NEV, TOL, RESID, NCV, V, LDV, IPARAM, IPNTR, WORKD, WORKL, LWORKL, INFO)IPNTR, WORKD, WORKL, LWORKL, INFO)
• Implicitly restarted Arnoldi methodImplicitly restarted Arnoldi method
• Reverse communication for MATVECReverse communication for MATVEC
• Arguments are arrays (1-D)Arguments are arrays (1-D)
• User provides workspaceUser provides workspace
lbl.gov/~kwu
Case Study III -- TRLANCase Study III -- TRLAN
TRLAN(OP, INFO, NROW, MEV, EVAL, TRLAN(OP, INFO, NROW, MEV, EVAL, EVEC, LDE)EVEC, LDE)
• thick-restart Lanczos methodthick-restart Lanczos method
• MATVEC (OP) has a prescribed interfaceMATVEC (OP) has a prescribed interface
• eigenvalues/eigenvectors are arrayseigenvalues/eigenvectors are arrays
• use Fortran 90 TYPE (INFO) to store use Fortran 90 TYPE (INFO) to store controlling parameterscontrolling parameters
Case Study IV -- ARPACK+Case Study IV -- ARPACK+++
#include “areig.h”#include “areig.h”
Nconv = areig(EigValR, EigValI, Nconv = areig(EigValR, EigValI, EigVec, n, nnz, A, inrow, pcol, nev);EigVec, n, nnz, A, inrow, pcol, nev);
• Based on ARPACKBased on ARPACK
• Simple data structures for matrix, Simple data structures for matrix, eigenvalues and eigenvectorseigenvalues and eigenvectors
ftp://ftp.caam.rice.edu/pub/software/ARPACK
Case Study V -- Case Study V -- RogueWaveRogueWave
#include <rw/deig.h>#include <rw/deig.h>
DoubleEigDecomp eig(a);DoubleEigDecomp eig(a);
• QR based methodsQR based methods
• Solution stored in eig objectSolution stored in eig object
• Eig.eigenValues() for eigenvaluesEig.eigenValues() for eigenvalues
www.roguewave.com
Two Basic StrategiesTwo Basic Strategies
Eigenvalue functionEigenvalue function
• Closer to Closer to traditional librariestraditional libraries
• Explicit arguments Explicit arguments for eigenvalue and for eigenvalue and eigenvectoreigenvector
• May be an May be an interface of a interface of a matrix classmatrix class
Decomposition classDecomposition class
• Computation is Computation is hiddenhidden
• Contains functions Contains functions to output to output eigenvalues, etceigenvalues, etc
• Decomposition is Decomposition is an objectan object
Basic Data ElementsBasic Data Elements
Eigenvalue functionEigenvalue function
• MatricesMatrices
• Eigenvalue and Eigenvalue and eigenvector are eigenvector are function arguments function arguments
• Controlling Controlling parameters are parameters are function argumentsfunction arguments
Decomposition classDecomposition class
• MatricesMatrices
• Eigenvalue and Eigenvalue and eigenvector stored eigenvector stored internallyinternally
• Controlling Controlling parameters set by parameters set by member functionmember function
Interaction With Other Interaction With Other ComponentsComponentsEigenvalue functionEigenvalue function
• Reverse Reverse communication or communication or function pointer or function pointer or direct access to direct access to the matricesthe matrices
Decomposition classDecomposition class
• Function pointer Function pointer (functor) or direct (functor) or direct access to matricesaccess to matrices
• External functions External functions must use must use prescribed prescribed interfaceinterface
Feature ComparisonFeature Comparison
Function Classusability Familiar feel,
explicitargument
Pure objects,easy for starters
performance Do not impedeperformance
May need extracopy
externdability Need newinterface
Easy to add newthings
Eigenvalue Class always has a decomposefunction, but it may not be public
Relation With Equation Relation With Equation SolversSolvers• Share the same basic elements: Share the same basic elements:
vector, multi-vector, matricesvector, multi-vector, matrices
• Share the same external/user-Share the same external/user-supplied functions: MATVEC, supplied functions: MATVEC, preconditionerpreconditioner
• Eigenvalue solver may use equation Eigenvalue solver may use equation solversolver
Relation With Existing Relation With Existing SoftwareSoftware• Existing matrix libraries may be Existing matrix libraries may be
used to specify basic data elementsused to specify basic data elements
• Existing Fortran/C libraries may be Existing Fortran/C libraries may be used to perform the actual used to perform the actual computationscomputations
• Should make it easy to interact with Should make it easy to interact with existing frameworks, e.G., POOMAexisting frameworks, e.G., POOMA
Future WorkFuture Work
• Reviewing other OO eigenvalue Reviewing other OO eigenvalue softwaresoftware
• Concrete interface specificationConcrete interface specification
• Data structure of the basic elementsData structure of the basic elements
• Interface of MATVEC and Interface of MATVEC and preconditionerpreconditioner