slepc4py.SLEPc.FN#
- class slepc4py.SLEPc.FN#
Bases:
Object
FN.
Enumerations
FN type of combination of child functions.
FN parallel types.
FN type.
Methods Summary
appendOptionsPrefix
([prefix])Append to the prefix used for searching for all FN options in the database.
create
([comm])Create the FN object.
destroy
()Destroy the FN object.
duplicate
([comm])Duplicate the FN object copying all parameters.
Compute the value of the derivative \(f'(x)\) for a given x.
Compute the value of the function f(x) for a given x.
evaluateFunctionMat
(A[, B])Compute the value of the function \(f(A)\) for a given matrix A.
evaluateFunctionMatVec
(A[, v])Compute the first column of the matrix f(A) for a given matrix A.
Get the two child functions that constitute this combined function.
Get the method currently used for matrix functions.
Get the prefix used for searching for all FN options in the database.
Get the mode of operation in parallel runs.
Get the index of the phi-function.
Get the coefficients of the denominator of the rational function.
Get the coefficients of the numerator of the rational function.
getScale
()Get the scaling parameters that define the matematical function.
getType
()Get the FN type of this object.
setCombineChildren
(comb, f1, f2)Set the two child functions that constitute this combined function.
Set FN options from the options database.
setMethod
(meth)Set the method to be used to evaluate functions of matrices.
setOptionsPrefix
([prefix])Set the prefix used for searching for all FN options in the database.
setParallel
(pmode)Set the mode of operation in parallel runs.
setPhiIndex
(k)Set the index of the phi-function.
setRationalDenominator
(alpha)Set the coefficients of the denominator of the rational function.
setRationalNumerator
(alpha)Set the coefficients of the numerator of the rational function.
setScale
([alpha, beta])Set the scaling parameters that define the matematical function.
setType
(fn_type)Set the type for the FN object.
view
([viewer])Print the FN data structure.
Attributes Summary
The method to be used to evaluate functions of matrices.
The mode of operation in parallel runs.
Methods Documentation
- appendOptionsPrefix(prefix=None)#
Append to the prefix used for searching for all FN options in the database.
Logically collective.
- create(comm=None)#
Create the FN object.
Collective.
- destroy()#
Destroy the FN object.
Collective.
Source code at slepc4py/SLEPc/FN.pyx:134
- Return type:
- duplicate(comm=None)#
Duplicate the FN object copying all parameters.
Collective.
Duplicate the FN object copying all parameters, possibly with a different communicator.
- evaluateDerivative(x)#
Compute the value of the derivative \(f'(x)\) for a given x.
Not collective.
- Parameters:
x (Scalar) – Value where the derivative must be evaluated.
- Returns:
The result of \(f'(x)\).
- Return type:
- evaluateFunction(x)#
Compute the value of the function f(x) for a given x.
Not collective.
- Parameters:
x (Scalar) – Value where the function must be evaluated.
- Returns:
The result of f(x).
- Return type:
- evaluateFunctionMat(A, B=None)#
Compute the value of the function \(f(A)\) for a given matrix A.
Logically collective.
- Parameters:
A (petsc4py.PETSc.Mat) – Matrix on which the function must be evaluated.
B (petsc4py.PETSc.Mat | None) – Placeholder for the result.
- Returns:
The result of \(f(A)\).
- Return type:
- evaluateFunctionMatVec(A, v=None)#
Compute the first column of the matrix f(A) for a given matrix A.
Logically collective.
- Parameters:
A (petsc4py.PETSc.Mat) – Matrix on which the function must be evaluated.
v (petsc4py.PETSc.Vec | None)
- Returns:
The first column of the result f(A).
- Return type:
- getCombineChildren()#
Get the two child functions that constitute this combined function.
Not collective.
Get the two child functions that constitute this combined function, and the way they must be combined.
- Returns:
comb (
CombineType
) – How to combine the functions (addition, multiplication, division, composition).f1 (
FN
) – First function.f2 (
FN
) – Second function.
- Return type:
tuple[CombineType, FN, FN]
- getMethod()#
Get the method currently used for matrix functions.
Not collective.
- Returns:
An index identifying the method.
- Return type:
- getOptionsPrefix()#
Get the prefix used for searching for all FN options in the database.
Not collective.
- Returns:
The prefix string set for this FN object.
- Return type:
- getParallel()#
Get the mode of operation in parallel runs.
Not collective.
- Returns:
The parallel mode.
- Return type:
- getPhiIndex()#
Get the index of the phi-function.
Not collective.
- Returns:
The index.
- Return type:
- getRationalDenominator()#
Get the coefficients of the denominator of the rational function.
Not collective.
- Returns:
Coefficients.
- Return type:
- getRationalNumerator()#
Get the coefficients of the numerator of the rational function.
Not collective.
- Returns:
Coefficients.
- Return type:
- getScale()#
Get the scaling parameters that define the matematical function.
Not collective.
- Returns:
- Return type:
- getType()#
Get the FN type of this object.
Not collective.
- Returns:
The inner product type currently being used.
- Return type:
- setCombineChildren(comb, f1, f2)#
Set the two child functions that constitute this combined function.
Logically collective.
Set the two child functions that constitute this combined function, and the way they must be combined.
- Parameters:
comb (CombineType) – How to combine the functions (addition, multiplication, division, composition).
f1 (FN) – First function.
f2 (FN) – Second function.
- Return type:
- setFromOptions()#
Set FN options from the options database.
Collective.
Notes
To see all options, run your program with the
-help
option.Source code at slepc4py/SLEPc/FN.pyx:242
- Return type:
- setMethod(meth)#
Set the method to be used to evaluate functions of matrices.
Logically collective.
Notes
In some
FN
types there are more than one algorithms available for computing matrix functions. In that case, this function allows choosing the wanted method.If
meth
is currently set to 0 and the input argument ofFN.evaluateFunctionMat()
is a symmetric/Hermitian matrix, then the computation is done via the eigendecomposition, rather than with the general algorithm.
- setOptionsPrefix(prefix=None)#
Set the prefix used for searching for all FN options in the database.
Logically collective.
- Parameters:
prefix (str | None) – The prefix string to prepend to all FN 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.
- setParallel(pmode)#
Set the mode of operation in parallel runs.
Logically collective.
- Parameters:
pmode (ParallelType) – The parallel mode.
- Return type:
- setPhiIndex(k)#
Set the index of the phi-function.
Logically collective.
- setRationalDenominator(alpha)#
Set the coefficients of the denominator of the rational function.
Logically collective.
- setRationalNumerator(alpha)#
Set the coefficients of the numerator of the rational function.
Logically collective.
- setScale(alpha=None, beta=None)#
Set the scaling parameters that define the matematical function.
Logically collective.
- Parameters:
- Return type:
- setType(fn_type)#
Set the type for the FN object.
Logically collective.
- view(viewer=None)#
Print the FN data structure.
Collective.
Attributes Documentation
- method#
The method to be used to evaluate functions of matrices.
- parallel#
The mode of operation in parallel runs.