Package slepc4py :: Module SLEPc :: Class FN
[hide private]
[frames] | no frames]

Class FN


FN
Nested Classes [hide private]
  CombineType
FN type of combination of child functions
  ParallelType
FN parallel types
  Type
FN type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
Creates the FN object.
 
destroy(self)
Destroys the FN object.
 
duplicate(self, comm=None)
Duplicate the FN object copying all parameters, possibly with a different communicator.
 
evaluateDerivative(self, x)
Computes the value of the derivative f'(x) for a given x.
 
evaluateFunction(self, x)
Computes the value of the function f(x) for a given x.
 
evaluateFunctionMat(self, Mat A, Mat B=None)
Computes the value of the function f(A) for a given matrix A.
 
evaluateFunctionMatVec(self, Mat A, Vec v=None)
Computes the first column of the matrix f(A) for a given matrix A.
 
getCombineChildren(self)
Gets the two child functions that constitute this combined function, and the way they must be combined.
 
getMethod(self)
Gets the method currently used for matrix functions.
 
getOptionsPrefix(self)
Gets the prefix used for searching for all FN options in the database.
 
getParallel(self)
Gets the mode of operation in parallel runs.
 
getPhiIndex(self)
Gets the index of the phi-function.
 
getRationalDenominator(self)
Gets the coefficients of the denominator of the rational function.
 
getRationalNumerator(self)
Gets the coefficients of the numerator of the rational function.
 
getScale(self)
Gets the scaling parameters that define the matematical function.
 
getType(self)
Gets the FN type of this object.
 
setCombineChildren(self, comb, FN f1, FN f2)
Sets the two child functions that constitute this combined function, and the way they must be combined.
 
setFromOptions(self)
Sets FN options from the options database.
 
setMethod(self, meth)
Selects the method to be used to evaluate functions of matrices.
 
setOptionsPrefix(self, prefix)
Sets the prefix used for searching for all FN options in the database.
 
setParallel(self, pmode)
Selects the mode of operation in parallel runs.
 
setPhiIndex(self, k)
Sets the index of the phi-function.
 
setRationalDenominator(self, alpha)
Sets the coefficients of the denominator of the rational function.
 
setRationalNumerator(self, alpha)
Sets the coefficients of the numerator of the rational function.
 
setScale(self, alpha=None, beta=None)
Sets the scaling parameters that define the matematical function.
 
setType(self, fn_type)
Selects the type for the FN object.
 
view(self, Viewer viewer=None)
Prints the FN data structure.

Inherited from petsc4py.PETSc.Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, appendOptionsPrefix, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateGet, stateIncrease, stateSet, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  method
  parallel

Inherited from petsc4py.PETSc.Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, comm=None)

 

Creates the FN object.

Parameters

comm: Comm, optional
MPI communicator; if not provided, it defaults to all processes.

destroy(self)

 
Destroys the FN object.
Overrides: petsc4py.PETSc.Object.destroy

duplicate(self, comm=None)

 

Duplicate the FN object copying all parameters, possibly with a different communicator.

Parameters

comm: Comm, optional
MPI communicator; if not provided, it defaults to the object's communicator.

evaluateDerivative(self, x)

 

Computes the value of the derivative f'(x) for a given x.

Parameters

x: scalar
Value where the derivative must be evaluated.

Returns

y: scalar
The result of f'(x).

evaluateFunction(self, x)

 

Computes the value of the function f(x) for a given x.

Parameters

x: scalar
Value where the function must be evaluated.

Returns

y: scalar
The result of f(x).

evaluateFunctionMat(self, Mat A, Mat B=None)

 

Computes the value of the function f(A) for a given matrix A.

Parameters

A: Mat
Matrix on which the function must be evaluated.
B: Mat, optional
Placeholder for the result.

Returns

B: Mat
The result of f(A).

evaluateFunctionMatVec(self, Mat A, Vec v=None)

 

Computes the first column of the matrix f(A) for a given matrix A.

Parameters

A: Mat
Matrix on which the function must be evaluated.

Returns

v: Vec
The first column of the result f(A).

getCombineChildren(self)

 

Gets the two child functions that constitute this combined function, and the way they must be combined.

Returns

comb: FN.CombineType enumerate
How to combine the functions (addition, multiplication, division, composition).
f1: FN
First function.
f2: FN
Second function.

getMethod(self)

 

Gets the method currently used for matrix functions.

Returns

meth: int
An index identifying the method.

getOptionsPrefix(self)

 

Gets the prefix used for searching for all FN options in the database.

Returns

prefix: string
The prefix string set for this FN object.
Overrides: petsc4py.PETSc.Object.getOptionsPrefix

getParallel(self)

 

Gets the mode of operation in parallel runs.

Returns

pmode: FN.ParallelType enumerate
The parallel mode.

getPhiIndex(self)

 

Gets the index of the phi-function.

Returns

k: int
The index.

getRationalDenominator(self)

 

Gets the coefficients of the denominator of the rational function.

Returns

alpha: array of scalars
Coefficients.

getRationalNumerator(self)

 

Gets the coefficients of the numerator of the rational function.

Returns

alpha: array of scalars
Coefficients.

getScale(self)

 

Gets the scaling parameters that define the matematical function.

Returns

alpha: scalar (possibly complex)
Inner scaling (argument).
beta: scalar (possibly complex)
Outer scaling (result).

getType(self)

 

Gets the FN type of this object.

Returns

type: FN.Type enumerate
The inner product type currently being used.
Overrides: petsc4py.PETSc.Object.getType

setCombineChildren(self, comb, FN f1, FN f2)

 

Sets the two child functions that constitute this combined function, and the way they must be combined.

Parameters

comb: FN.CombineType enumerate
How to combine the functions (addition, multiplication, division, composition).
f1: FN
First function.
f2: FN
Second function.

setFromOptions(self)

 

Sets FN options from the options database.

Notes

To see all options, run your program with the -help option.

Overrides: petsc4py.PETSc.Object.setFromOptions

setMethod(self, meth)

 

Selects the method to be used to evaluate functions of matrices.

Parameters

meth: int
An index identifying the method.

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 of FN.evaluateFunctionMat() is a symmetric/Hermitian matrix, then the computation is done via the eigendecomposition, rather than with the general algorithm.

setOptionsPrefix(self, prefix)

 

Sets the prefix used for searching for all FN options in the database.

Parameters

prefix: string
The prefix string to prepend to all FN 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.

Overrides: petsc4py.PETSc.Object.setOptionsPrefix

setParallel(self, pmode)

 

Selects the mode of operation in parallel runs.

Parameters

pmode: FN.ParallelType enumerate
The parallel mode.

setPhiIndex(self, k)

 

Sets the index of the phi-function.

Parameters

k: int
The index.

setRationalDenominator(self, alpha)

 

Sets the coefficients of the denominator of the rational function.

Parameters

alpha: array of scalars
Coefficients.

setRationalNumerator(self, alpha)

 

Sets the coefficients of the numerator of the rational function.

Parameters

alpha: array of scalars
Coefficients.

setScale(self, alpha=None, beta=None)

 

Sets the scaling parameters that define the matematical function.

Parameters

alpha: scalar (possibly complex), optional
Inner scaling (argument), default is 1.0.
beta: scalar (possibly complex), optional
Outer scaling (result), default is 1.0.

setType(self, fn_type)

 

Selects the type for the FN object.

Parameters

fn_type: FN.Type enumerate
The inner product type to be used.

view(self, Viewer viewer=None)

 

Prints the FN data structure.

Parameters

viewer: Viewer, optional
Visualization context; if not provided, the standard output is used.
Overrides: petsc4py.PETSc.Object.view