>> help band_Arnoldi Band Arnoldi process This implementation is essentially Algorithm 6.1 in Roland W. Freund, Model reduction methods based on Krylov subspaces, Acta Numerica, 12 (2003), pp. 267-319. ----------------------------------------------------------------------------- Notes: 1) The matrices A and R are allowed to be complex. 2) The orthogonalizations performed in the algorithm are with respect to the Euclidean inner product (w,v) = w^H v (= w' * v), where w^H (= w') denotes the complex conjugate transpose of w. 3) The entries above and on the diagonal of the k-th column of the Arnoldi matrix H are computed via (modified) Gram-Schmidt orthogonalization of the vector A v_k against v_1, v_2, ..., v_k; the entries to the left of the diagonal of the k-th row of H are computed via inner products and norms of candidate vectors and previously deflated vectors. ----------------------------------------------------------------------------- Usage: result = band_Arnoldi(A,R,nmax) result = band_Arnoldi(A,R,nmax,tol) result = band_Arnoldi(A,R,nmax,tol,n,result) where A is a matrix, or, result = band_Arnoldi(@(x) afun(x,...),R,nmax) result = band_Arnoldi(@(x) afun(x,...),R,nmax,tol) result = band_Arnoldi(@(x) afun(x,...),R,nmax,tol,n,result) where "afun" is a function such that y = afun(x,...) computes the matrix-vector product y = A x (= A * x) with A ----------------------------------------------------------------------------- Required inputs: A = a square matrix or an (anonymous) function that computes matrix-vector products with A R = matrix the m columns of which are the starting vectors nmax = maximum number of Arnoldi vectors to be generated It is assumed that A is a square matrix and that A and R have the same number of rows; these assumptions are checked when the input A is a matrix, but not when A is a function. Optional inputs: tol = a structure that contains tolerances and parameters for the deflation procedure n = a nonnegative integer; n > 0 means that a previous call to the function "band_Arnoldi" has generated n Arnoldi vectors and that the current call to "band_Arnoldi" resumes the iteration at step n+1; n = 0 means that the band Arnoldi process is started from scratch result = the output structure of the previous call to "band_Arnoldi" if n > 0; if n = 0, this input is ignored If "tol" is provided as an input, it needs to contain tol.defl_tol = unscaled deflation tolerance and values of the following two flags: tol.defl_flag = 0 (use unscaled deflation tolerance) 1 (use scaled deflation tolerance) 2 (use scaled deflation tolerance only for the starting block R) 3 (use scaled deflation tolerance except for the starting block R) tol.normA_flag = 1 (an estimate for the norm of A is generated within the algorithm) 2 (an estimate for the norm of A is provided as tol.normA) If tol.normA_flag = 2, then an estimate for the norm of A needs to be provided as tol.normA If "tol" is not provided as an input, the following default values are used: tol.defl_tol = sqrt(eps) (eps = machine precision) tol.defl_flag = 1 tol.normA_flag = 1 If n is not provided as an input, n = 0 is used and the optional input "result" is ignored. If n > 0, the input "result" needs to be provided. It is assumed, but not checked, that "result" is the output structure of a previous call to the function "band_Arnoldi" (applied to the same matrices A and R). In this case, the input "tol" is ignored and tol = result.tol is used instead. ----------------------------------------------------------------------------- On return, "result" is a structure the fields of which include the following quantities: result.n = number of Arnoldi vectors that were generated result.V = matrix V the n columns of which are the Arnoldi vectors result.Vh_defl = matrix Vh_defl the columns of which are the candidate vectors for the next mc Arnoldi vectors and the m-mc deflated vectors result.H = the n x n matrix H that represents the projection of the matrix A onto the subspace spanned by the columns of V; A, V, and H are connected via the relation V' * A * V = H result.rho = the n x m matrix rho that contains the coefficients used to turn the starting vectors (in R) into the first Arnoldi vectors; R, V, and rho are connected via the relation V' * R = rho ----------------------------------------------------------------------------- This routine can be run in incremental fashion. Example 1: result = band_Arnoldi(A,R,nmax0,tol) n = result.n result = band_Arnoldi(A,R,nmax,tol,n,result) The first call to the function "band_Arnoldi" runs the band Arnoldi process from scratch and generates n Arnoldi vectors. The second call to the function "band_Arnoldi" resumes the iteration at step n+1. Example 2 (Band Arnoldi process, run one step at a time): result = band_Arnoldi(A,R,1,tol,0,[]) for n = 1 : nmax - 1, result = band_Arnoldi(A,R,n+1,[],result.n,result) end This will run the band Arnoldi process for nmax steps. ----------------------------------------------------------------------------- BANDITS: a Matlab Package of Band Krylov Subspace Iterations Copyright (c) 2018-2019 Roland W. Freund See LICENSE.txt for license -----------------------------------------------------------------------------