slepc4py.SLEPc.DS#
- class slepc4py.SLEPc.DS#
Bases:
Object
DS.
Enumerations
To refer to one of the matrices stored internally in DS.
DS parallel types.
DS state types.
DS type.
Methods Summary
allocate
(ld)Allocate memory for internal storage or matrices in DS.
appendOptionsPrefix
([prefix])Append to the prefix used for searching for all DS options in the database.
cond
()Compute the inf-norm condition number of the first matrix.
create
([comm])Create the DS object.
destroy
()Destroy the DS object.
Duplicate the DS object with the same type and dimensions.
Get the block size.
Get the compact storage flag.
Get the current dimensions.
Get the extra row flag.
Get the leading dimension of the allocated matrices.
getMat
(matname)Get the requested matrix as a sequential dense Mat object.
Get the method currently used in the DS.
Get the prefix used for searching for all DS options in the database.
Get the mode of operation in parallel runs.
Get the refined vectors flag.
getState
()Get the current state.
getType
()Get the DS type of this object.
reset
()Reset the DS object.
restoreMat
(matname, mat)Restore the previously seized matrix.
setBlockSize
(bs)Set the block size.
setCompact
(comp)Set the matrices' compact storage flag.
setDimensions
([n, l, k])Set the matrices sizes in the DS object.
setExtraRow
(ext)Set a flag to indicate that the matrix has one extra row.
Set DS options from the options database.
setGSVDDimensions
(m, p)setIdentity
(matname)Set the identity on the active part of a matrix.
setMethod
(meth)Set the method to be used to solve the problem.
setOptionsPrefix
([prefix])Set the prefix used for searching for all DS options in the database.
setPEPCoefficients
(pbc)setPEPDegree
(deg)setParallel
(pmode)Set the mode of operation in parallel runs.
setRefined
(ref)Set a flag to indicate that refined vectors must be computed.
setState
(state)Set the state of the DS object.
setType
(ds_type)Set the type for the DS object.
solve
()Solve the problem.
truncate
(n[, trim])Truncate the system represented in the DS object.
Ensure that the extra row gets up-to-date after a call to
DS.solve()
.vectors
([matname])Compute vectors associated to the dense system such as eigenvectors.
view
([viewer])Print the DS data structure.
Attributes Summary
The block size.
Compact storage of matrices.
If the matrix has one extra row.
The method to be used to solve the problem.
The mode of operation in parallel runs.
If refined vectors must be computed.
The state of the DS object.
Methods Documentation
- allocate(ld)#
Allocate memory for internal storage or matrices in DS.
Logically collective.
- Parameters:
ld (int) – Leading dimension (maximum allowed dimension for the matrices, including the extra row if present).
- Return type:
- appendOptionsPrefix(prefix=None)#
Append to the prefix used for searching for all DS options in the database.
Logically collective.
- cond()#
Compute the inf-norm condition number of the first matrix.
Logically collective.
- Returns:
Condition number.
- Return type:
- create(comm=None)#
Create the DS object.
Collective.
- destroy()#
Destroy the DS object.
Collective.
Source code at slepc4py/SLEPc/DS.pyx:104
- Return type:
- duplicate()#
Duplicate the DS object with the same type and dimensions.
Collective.
Source code at slepc4py/SLEPc/DS.pyx:233
- Return type:
- getBlockSize()#
Get the block size.
Not collective.
- Returns:
The block size.
- Return type:
- getCompact()#
Get the compact storage flag.
Not collective.
- Returns:
The flag.
- Return type:
- getDimensions()#
Get the current dimensions.
Not collective.
- Returns:
- Return type:
- getExtraRow()#
Get the extra row flag.
Not collective.
- Returns:
The flag.
- Return type:
- getGSVDDimensions()#
Get the number of columns and rows of a
DS
of typeGSVD
.Not collective.
- Returns:
- Return type:
- getHSVDDimensions()#
Get the number of columns of a
DS
of typeHSVD
.Not collective.
- Returns:
The number of columns.
- Return type:
- getLeadingDimension()#
Get the leading dimension of the allocated matrices.
Not collective.
- Returns:
Leading dimension (maximum allowed dimension for the matrices).
- Return type:
- getMat(matname)#
Get the requested matrix as a sequential dense Mat object.
Not collective.
- Parameters:
matname (MatType) – The requested matrix.
- Returns:
The matrix.
- Return type:
- getMethod()#
Get the method currently used in the DS.
Not collective.
- Returns:
Identifier of the method.
- Return type:
- getOptionsPrefix()#
Get the prefix used for searching for all DS options in the database.
Not collective.
- Returns:
The prefix string set for this DS object.
- Return type:
- getPEPCoefficients()#
Get the polynomial basis coefficients of a
DS
of typePEP
.Not collective.
- Returns:
Coefficients.
- Return type:
- getPEPDegree()#
Get the polynomial degree of a
DS
of typePEP
.Not collective.
- Returns:
The polynomial degree.
- Return type:
- getParallel()#
Get the mode of operation in parallel runs.
Not collective.
- Returns:
The parallel mode.
- Return type:
- getRefined()#
Get the refined vectors flag.
Not collective.
- Returns:
The flag.
- Return type:
- getSVDDimensions()#
Get the number of columns of a
DS
of typeSVD
.Not collective.
- Returns:
The number of columns.
- Return type:
- getState()#
Get the current state.
Not collective.
- Returns:
The current state.
- Return type:
- getType()#
Get the DS type of this object.
Not collective.
- Returns:
The direct solver type currently being used.
- Return type:
- reset()#
Reset the DS object.
Collective.
Source code at slepc4py/SLEPc/DS.pyx:114
- Return type:
- restoreMat(matname, mat)#
Restore the previously seized matrix.
Not collective.
- Parameters:
matname (MatType) – The selected matrix.
mat (petsc4py.PETSc.Mat) – The matrix previously obtained with
getMat()
.
- Return type:
- setBlockSize(bs)#
Set the block size.
Logically collective.
- setCompact(comp)#
Set the matrices’ compact storage flag.
Logically collective.
Notes
Compact storage is used in some
DS
types such asDS.Type.HEP
when the matrix is tridiagonal. This flag can be used to indicate whether the user provides the matrix entries via the compact form (the tridiagonalDS.MatType.T
) or the non-compact one (DS.MatType.A
).The default is
False
.
- setDimensions(n=None, l=None, k=None)#
Set the matrices sizes in the DS object.
Logically collective.
- Parameters:
- Return type:
Notes
The internal arrays are not reallocated.
- setExtraRow(ext)#
Set a flag to indicate that the matrix has one extra row.
Logically collective.
Notes
In Krylov methods it is useful that the matrix representing the direct solver has one extra row, i.e., has dimension \((n+1) n\). If this flag is activated, all transformations applied to the right of the matrix also affect this additional row. In that case, \((n+1)\) must be less or equal than the leading dimension.
The default is
False
.
- setFromOptions()#
Set DS options from the options database.
Collective.
Notes
To see all options, run your program with the
-help
option.Source code at slepc4py/SLEPc/DS.pyx:220
- Return type:
- setGSVDDimensions(m, p)#
Set the number of columns and rows of a
DS
of typeGSVD
.Logically collective.
- Parameters:
- Return type:
- setIdentity(matname)#
Set the identity on the active part of a matrix.
Logically collective.
- setMethod(meth)#
Set the method to be used to solve the problem.
Logically collective.
- setOptionsPrefix(prefix=None)#
Set the prefix used for searching for all DS options in the database.
Logically collective.
- Parameters:
prefix (str | None) – The prefix string to prepend to all DS option requests.
- Return type:
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.
- setPEPCoefficients(pbc)#
Set the polynomial basis coefficients of a
DS
of typePEP
.Logically collective.
- setParallel(pmode)#
Set the mode of operation in parallel runs.
Logically collective.
- Parameters:
pmode (ParallelType) – The parallel mode.
- Return type:
- setRefined(ref)#
Set a flag to indicate that refined vectors must be computed.
Logically collective.
Notes
Normally the vectors returned in
DS.MatType.X
are eigenvectors of the projected matrix. With this flag activated,vectors()
will return the right singular vector of the smallest singular value of matrix \(At - theta I\), where \(At\) is the extended \((n+1) times n\) matrix and \(theta\) is the Ritz value. This is used in the refined Ritz approximation.The default is
False
.
- setState(state)#
Set the state of the DS object.
Logically collective.
Notes
The state indicates that the dense system is in an initial state (raw), in an intermediate state (such as tridiagonal, Hessenberg or Hessenberg-triangular), in a condensed state (such as diagonal, Schur or generalized Schur), or in a truncated state.
This function is normally used to return to the raw state when the condensed structure is destroyed.
- setType(ds_type)#
Set the type for the DS object.
Logically collective.
- solve()#
Solve the problem.
Logically collective.
- Returns:
Eigenvalues or singular values.
- Return type:
- truncate(n, trim=False)#
Truncate the system represented in the DS object.
Logically collective.
- Parameters:
- Return type:
- updateExtraRow()#
Ensure that the extra row gets up-to-date after a call to
DS.solve()
.Logically collective.
Perform all necessary operations so that the extra row gets up-to-date after a call to
DS.solve()
.Source code at slepc4py/SLEPc/DS.pyx:588
- Return type:
- vectors(matname=X)#
Compute vectors associated to the dense system such as eigenvectors.
Logically collective.
- Parameters:
matname (
DS.MatType
enumerate) – The matrix, used to indicate which vectors are required.- Return type:
- view(viewer=None)#
Print the DS data structure.
Collective.
Attributes Documentation
- block_size#
The block size.
- compact#
Compact storage of matrices.
- extra_row#
If the matrix has one extra row.
- method#
The method to be used to solve the problem.
- parallel#
The mode of operation in parallel runs.
- refined#
If refined vectors must be computed.
- state#
The state of the DS object.