Home | Trees | Indices | Help |
|
---|
|
SVD
|
|||
ConvergedReason SVD convergence reasons |
|||
ErrorType SVD error type to assess accuracy of computed solutions |
|||
Type SVD types |
|||
Which SVD desired piece of spectrum |
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
bv | |||
max_it | |||
tol | |||
transpose_mode | |||
which | |||
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. |
Retrieve the eigensolver object (`EPS`) associated to the singular value solver. Returns ------- eps: EPS The eigensolver object. |
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: boolean True if ``H(A)`` is built explicitly. |
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: boolean 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 the matrix associated with the singular value problem. Returns ------- A: Mat The matrix associated with the singular value problem. |
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 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()`. |
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 |
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). |
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. |
Associate an eigensolver object (`EPS`) to the singular value solver. Parameters ---------- eps: EPS The eigensolver object. |
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: boolean True if ``H(A)`` is built explicitly. |
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: boolean 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: boolean 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 matrix associated with the singular value problem. Parameters ---------- A: Mat The matrix associated with the singular value problem. |
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_")
|
Indicate if the variant of the thick-restart Lanczos method to be used is one-sided or two-sided. Parameters ---------- flag: boolean 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 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. |
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). |
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 Wed Oct 14 09:49:45 2020 | http://epydoc.sourceforge.net |