Home | Trees | Indices | Help |
|
---|
|
SVD
|
|||
Conv SVD convergence test |
|||
ConvergedReason SVD convergence reasons |
|||
ErrorType SVD error type to assess accuracy of computed solutions |
|||
ProblemType SVD problem type |
|||
Stop SVD stopping test |
|||
TRLanczosGBidiag SVD TRLanczos bidiagonalization choices for the GSVD case |
|||
Type SVD types |
|||
Which SVD desired part of spectrum |
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|
Appends to the prefix used for searching for all SVD options in the database. Parameters ---------- prefix: string The prefix string to prepend to all SVD option requests. |
Computes the error (based on the residual norm) associated with the i-th singular triplet. Parameters ---------- i: int Index of the solution to be considered. etype: `SVD.ErrorType` enumerate The error type to compute. Returns ------- e: real The relative error bound, computed in various ways from the residual norm ``sqrt(n1^2+n2^2)`` where ``n1 = ||A*v-sigma*u||_2``, ``n2 = ||A^T*u-sigma*v||_2``, ``sigma`` is the singular value, ``u`` and ``v`` are the left and right singular vectors. Notes ----- The index ``i`` should be a value between ``0`` and ``nconv-1`` (see `getConverged()`). |
Creates the SVD object. Parameters ---------- comm: Comm, optional MPI communicator; if not provided, it defaults to all processes. |
Destroys the SVD object.
|
Displays the errors associated with the computed solution (as well as the eigenvalues). Parameters ---------- etype: `SVD.ErrorType` enumerate, optional The error type to compute. viewer: Viewer, optional. Visualization context; if not provided, the standard output is used. Notes ----- By default, this function checks the error of all eigenpairs and prints the eigenvalues if all of them are below the requested tolerance. If the viewer has format ``ASCII_INFO_DETAIL`` then a table with eigenvalues and corresponding errors is printed. |
Obtain the basis vectors objects associated to the SVD object. Returns ------- V: BV The basis vectors context for right singular vectors. U: BV The basis vectors context for left singular vectors. |
Gets the number of converged singular triplets. Returns ------- nconv: int Number of converged singular triplets. Notes ----- This function should be called after `solve()` has finished. |
Gets the reason why the `solve()` iteration was stopped. Returns ------- reason: `SVD.ConvergedReason` enumerate Negative value indicates diverged, positive value converged. |
Return the method used to compute the error estimate used in the convergence test. Returns ------- conv: SVD.Conv The method used to compute the error estimate used in the convergence test. |
Retrieve the eigensolver object (`EPS`) associated to the singular value solver. Returns ------- eps: EPS The eigensolver object. |
Returns the flag indicating if ``A^T*A`` is built explicitly. Returns ------- flag: bool True if ``A^T*A`` is built explicitly. |
Retrieve the eigensolver object (`EPS`) associated to the singular value solver. Returns ------- eps: EPS The eigensolver object. |
Returns the flag indicating if ``H(A) = [ 0 A ; A^T 0 ]`` is built explicitly. Returns ------- flag: bool True if ``H(A)`` is built explicitly. |
Obtain the direct solver associated to the singular value solver. Returns ------- ds: DS The direct solver context. |
Gets the number of singular values to compute and the dimension of the subspace. Returns ------- nsv: int Number of singular values to compute. ncv: int Maximum dimension of the subspace to be used by the solver. mpd: int Maximum dimension allowed for the projected problem. |
Gets the mode used to handle the transpose of the matrix associated with the singular value problem. Returns ------- impl: bool How to handle the transpose (implicitly or not). |
Gets the current iteration number. If the call to `solve()` is complete, then it returns the number of iterations carried out by the solution method. Returns ------- its: int Iteration number. |
Gets if the variant of the Lanczos method to be used is one-sided or two-sided. Returns ------- delayed: bool True if the method is one-sided. |
Gets the matrices associated with the singular value problem. Returns ------- A: Mat The matrix associated with the singular value problem. B: Mat The second matrix in the case of GSVD. |
Gets the prefix used for searching for all SVD options in the database. Returns ------- prefix: string The prefix string set for this SVD object.
|
Gets the problem type from the SVD object. Returns ------- problem_type: `SVD.ProblemType` enumerate The problem type that was previously set. |
Gets the i-th triplet of the singular value decomposition as computed by `solve()`. The solution consists of the singular value and its left and right singular vectors. Parameters ---------- i: int Index of the solution to be obtained. U: Vec Placeholder for the returned left singular vector. V: Vec Placeholder for the returned right singular vector. Returns ------- s: float The computed singular value. Notes ----- The index ``i`` should be a value between ``0`` and ``nconv-1`` (see `getConverged()`. Singular triplets are indexed according to the ordering criterion established with `setWhichSingularTriplets()`. |
Returns the flag indicating if ``Z=[A;B]`` is built explicitly. Returns ------- flag: bool True if ``Z=[A;B]`` is built explicitly. |
Returns bidiagonalization choice used in the GSVD TRLanczos solver. Returns ------- bidiag: `SVD.TRLanczosGBidiag` enumerate The bidiagonalization choice. |
Retrieve the linear solver object associated with the SVD solver. Returns ------- ksp: `KSP` The linear solver object. |
Gets the locking flag used in the thick-restart Lanczos method. Returns ------- lock: bool The locking flag. |
Gets if the variant of the thick-restart Lanczos method to be used is one-sided or two-sided. Returns ------- delayed: bool True if the method is one-sided. |
Gets the restart parameter used in the thick-restart Lanczos method. Returns ------- keep: float The number of vectors to be kept at restart. |
Gets the tolerance and maximum iteration count used by the default SVD convergence tests. Returns ------- tol: float The convergence tolerance. max_it: int The maximum number of iterations |
Returns the flag indicating whether all residual norms must be computed or not. Returns ------- trackall: bool Whether the solver compute all residuals or not. |
Gets the SVD type of this object. Returns ------- type: `SVD.Type` enumerate The solver currently being used.
|
Gets the i-th singular value as computed by `solve()`. Parameters ---------- i: int Index of the solution to be obtained. Returns ------- s: float The computed singular value. Notes ----- The index ``i`` should be a value between ``0`` and ``nconv-1`` (see `getConverged()`. Singular triplets are indexed according to the ordering criterion established with `setWhichSingularTriplets()`. |
Gets the i-th left and right singular vectors as computed by `solve()`. Parameters ---------- i: int Index of the solution to be obtained. U: Vec Placeholder for the returned left singular vector. V: Vec Placeholder for the returned right singular vector. Notes ----- The index ``i`` should be a value between ``0`` and ``nconv-1`` (see `getConverged()`. Singular triplets are indexed according to the ordering criterion established with `setWhichSingularTriplets()`. |
Returns which singular triplets are to be sought. Returns ------- which: `SVD.Which` enumerate The singular values to be sought (either largest or smallest). |
Tells whether the SVD object corresponds to a generalized singular value problem. Returns ------- flag: bool True if two matrices were set with `setOperators()`. |
Associates basis vectors objects to the SVD solver. Parameters ---------- V: BV The basis vectors context for right singular vectors. U: BV The basis vectors context for left singular vectors. |
Specifies how to compute the error estimate used in the convergence test. Parameters ---------- conv: SVD.Conv The method used to compute the error estimate used in the convergence test. |
Associate an eigensolver object (`EPS`) to the singular value solver. Parameters ---------- eps: EPS The eigensolver object. |
Indicate if the eigensolver operator ``A^T*A`` must be computed explicitly. Parameters ---------- flag: bool True if ``A^T*A`` is built explicitly. |
Associate an eigensolver object (`EPS`) to the singular value solver. Parameters ---------- eps: EPS The eigensolver object. |
Indicate if the eigensolver operator ``H(A) = [ 0 A ; A^T 0 ]`` must be computed explicitly. Parameters ---------- flag: bool True if ``H(A)`` is built explicitly. |
Associates a direct solver object to the singular value solver. Parameters ---------- ds: DS The direct solver context. |
Sets the number of singular values to compute and the dimension of the subspace. Parameters ---------- nsv: int, optional Number of singular values to compute. ncv: int, optional Maximum dimension of the subspace to be used by the solver. mpd: int, optional Maximum dimension allowed for the projected problem. Notes ----- Use `DECIDE` for `ncv` and `mpd` to assign a reasonably good value, which is dependent on the solution method. The parameters `ncv` and `mpd` are intimately related, so that the user is advised to set one of them at most. Normal usage is the following: - In cases where `nsv` is small, the user sets `ncv` (a reasonable default is 2 * `nsv`). - In cases where `nsv` is large, the user sets `mpd`. The value of `ncv` should always be between `nsv` and (`nsv` + `mpd`), typically `ncv` = `nsv` + `mpd`. If `nsv` is not too large, `mpd` = `nsv` is a reasonable choice, otherwise a smaller value should be used. |
Sets SVD options from the options database. This routine must be called before `setUp()` if the user is to be allowed to set the solver type. Notes ----- To see all options, run your program with the ``-help`` option.
|
Indicates how to handle the transpose of the matrix associated with the singular value problem. Parameters ---------- impl: bool How to handle the transpose (implicitly or not). Notes ----- By default, the transpose of the matrix is explicitly built (if the matrix has defined the MatTranspose operation). If this flag is set to true, the solver does not build the transpose, but handles it implicitly via MatMultTranspose(). |
Sets the initial spaces from which the SVD solver starts to iterate. Parameters ---------- spaceright: sequence of Vec The right initial space. spaceleft: sequence of Vec The left initial space. |
Indicate if the variant of the Lanczos method to be used is one-sided or two-sided. Parameters ---------- flag: bool True if the method is one-sided. Notes ----- By default, a two-sided variant is selected, which is sometimes slightly more robust. However, the one-sided variant is faster because it avoids the orthogonalization associated to left singular vectors. It also saves the memory required for storing such vectors. |
Sets the matrices associated with the singular value problem. Parameters ---------- A: Mat The matrix associated with the singular value problem. B: Mat, optional The second matrix in the case of GSVD; if not provided, a usual SVD is assumed. |
Sets the matrices associated with the singular value problem. Parameters ---------- A: Mat The matrix associated with the singular value problem. B: Mat, optional The second matrix in the case of GSVD; if not provided, a usual SVD is assumed. |
Sets the prefix used for searching for all SVD options in the database. Parameters ---------- prefix: string The prefix string to prepend to all SVD option requests. Notes ----- A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. For example, to distinguish between the runtime options for two different SVD contexts, one could call:: S1.setOptionsPrefix("svd1_") S2.setOptionsPrefix("svd2_")
|
Specifies the type of the singular value problem. Parameters ---------- problem_type: `SVD.ProblemType` enumerate The problem type to be set. |
Indicate if the matrix ``Z=[A;B]`` must be built explicitly. Parameters ---------- flag: bool True if ``Z=[A;B]`` is built explicitly. |
Sets the bidiagonalization choice to use in the GSVD TRLanczos solver. Parameters ---------- bidiag: `SVD.TRLanczosGBidiag` enumerate The bidiagonalization choice. |
Associate a linear solver object to the SVD solver. Parameters ---------- ksp: `KSP` The linear solver object. |
Choose between locking and non-locking variants of the thick-restart Lanczos method. Parameters ---------- lock: bool True if the locking variant must be selected. Notes ----- The default is to lock converged singular triplets when the method restarts. This behaviour can be changed so that all directions are kept in the working subspace even if already converged to working accuracy (the non-locking variant). |
Indicate if the variant of the thick-restart Lanczos method to be used is one-sided or two-sided. Parameters ---------- flag: bool True if the method is one-sided. Notes ----- By default, a two-sided variant is selected, which is sometimes slightly more robust. However, the one-sided variant is faster because it avoids the orthogonalization associated to left singular vectors. |
Sets the restart parameter for the thick-restart Lanczos method, in particular the proportion of basis vectors that must be kept after restart. Parameters ---------- keep: float The number of vectors to be kept at restart. Notes ----- Allowed values are in the range [0.1,0.9]. The default is 0.5. |
Sets the tolerance and maximum iteration count used by the default SVD convergence tests. Parameters ---------- tol: float, optional The convergence tolerance. max_it: int, optional The maximum number of iterations Notes ----- Use `DECIDE` for `max_it` to assign a reasonably good value, which is dependent on the solution method. |
Specifies if the solver must compute the residual of all approximate singular triplets or not. Parameters ---------- trackall: bool Whether compute all residuals or not. |
Selects the particular solver to be used in the SVD object. Parameters ---------- svd_type: `SVD.Type` enumerate The solver to be used. Notes ----- See `SVD.Type` for available methods. The default is CROSS. Normally, it is best to use `setFromOptions()` and then set the SVD type from the options database rather than by using this routine. Using the options database provides the user with maximum flexibility in evaluating the different available methods. |
Sets up all the internal data structures necessary for the execution of the singular value solver. Notes ----- This function need not be called explicitly in most cases, since `solve()` calls it. It can be useful when one wants to measure the set-up time separately from the solve time. |
Specifies which singular triplets are to be sought. Parameters ---------- which: `SVD.Which` enumerate The singular values to be sought (either largest or smallest). |
Displays the computed singular values in a viewer. Parameters ---------- viewer: Viewer, optional. Visualization context; if not provided, the standard output is used. |
Outputs computed singular vectors to a viewer. Parameters ---------- viewer: Viewer, optional. Visualization context; if not provided, the standard output is used. |
Prints the SVD data structure. Parameters ---------- viewer: Viewer, optional Visualization context; if not provided, the standard output is used.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 4 12:32:50 2021 | http://epydoc.sourceforge.net |