slepc4py.SLEPc.LME#

class slepc4py.SLEPc.LME#

Bases: Object

LME.

Enumerations

ConvergedReason

LME convergence reasons.

ProblemType

LME problem type.

Type

LME type.

Methods Summary

appendOptionsPrefix([prefix])

Append to the prefix used for searching in the database.

cancelMonitor()

Clear all monitors for an LME object.

computeError()

Compute the error associated with the last equation solved.

create([comm])

Create the LME object.

destroy()

Destroy the LME object.

getBV()

Get the basis vector object associated to the LME object.

getCoefficients()

Get the coefficient matrices of the matrix equation.

getConvergedReason()

Get the reason why the solve() iteration was stopped.

getDimensions()

Get the dimension of the subspace used by the solver.

getErrorEstimate()

Get the error estimate obtained during solve.

getErrorIfNotConverged()

Get if solve() generates an error if the solver does not converge.

getIterationNumber()

Get the current iteration number.

getMonitor()

Get the list of monitor functions.

getOptionsPrefix()

Get the prefix used for searching for all LME options in the database.

getProblemType()

Get the LME problem type of this object.

getRHS()

Get the right-hand side of the matrix equation.

getSolution()

Get the solution of the matrix equation.

getTolerances()

Get the tolerance and maximum iteration count.

getType()

Get the LME type of this object.

reset()

Reset the LME object.

setBV(bv)

Set a basis vector object to the LME object.

setCoefficients(A[, B, D, E])

Set the coefficient matrices.

setDimensions(ncv)

Set the dimension of the subspace to be used by the solver.

setErrorIfNotConverged([flg])

Set solve() to generate an error if the solver has not converged.

setFromOptions()

Set LME options from the options database.

setMonitor(monitor[, args, kargs])

Append a monitor function to the list of monitors.

setOptionsPrefix([prefix])

Set the prefix used for searching for all LME options in the database.

setProblemType(lme_problem_type)

Set the LME problem type of this object.

setRHS(C)

Set the right-hand side of the matrix equation.

setSolution(X)

Set the placeholder for the solution of the matrix equation.

setTolerances([tol, max_it])

Set the tolerance and maximum iteration count.

setType(lme_type)

Set the particular solver to be used in the LME object.

setUp()

Set up all the internal necessary data structures.

solve()

Solve the linear matrix equation.

view([viewer])

Print the LME data structure.

Attributes Summary

bv

The basis vectors (BV) object associated to the LME object.

fn

The math function (FN) object associated to the LME object.

max_it

The maximum iteration count used by the LME convergence tests.

tol

The tolerance value used by the LME convergence tests.

Methods Documentation

appendOptionsPrefix(prefix=None)#

Append to the prefix used for searching in the database.

Logically collective.

Append to the prefix used for searching for all LME options in the database.

Parameters:

prefix (str | None) – The prefix string to prepend to all LME option requests.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:350 <slepc4py/SLEPc/LME.pyx#L350>`

cancelMonitor()#

Clear all monitors for an LME object.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:508 <slepc4py/SLEPc/LME.pyx#L508>`

Return type:

None

computeError()#

Compute the error associated with the last equation solved.

Collective.

Computes the error (based on the residual norm) associated with the last equation solved.

Returns:

The error

Return type:

float

:sources:`Source code at slepc4py/SLEPc/LME.pyx:302 <slepc4py/SLEPc/LME.pyx#L302>`

create(comm=None)#

Create the LME object.

Collective.

Parameters:

comm (Comm | None) – MPI communicator. If not provided, it defaults to all processes.

Return type:

Self

:sources:`Source code at slepc4py/SLEPc/LME.pyx:91 <slepc4py/SLEPc/LME.pyx#L91>`

destroy()#

Destroy the LME object.

Collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:73 <slepc4py/SLEPc/LME.pyx#L73>`

Return type:

Self

getBV()#

Get the basis vector object associated to the LME object.

Not collective.

Returns:

The basis vectors context.

Return type:

BV

:sources:`Source code at slepc4py/SLEPc/LME.pyx:452 <slepc4py/SLEPc/LME.pyx#L452>`

getCoefficients()#

Get the coefficient matrices of the matrix equation.

Collective.

Returns:

  • A – First coefficient matrix

  • B – Second coefficient matrix, if available

  • D – Third coefficient matrix, if available

  • E – Fourth coefficient matrix, if available

Return type:

tuple[Mat, Mat | None, Mat | None, Mat | None]

:sources:`Source code at slepc4py/SLEPc/LME.pyx:193 <slepc4py/SLEPc/LME.pyx#L193>`

getConvergedReason()#

Get the reason why the solve() iteration was stopped.

Not collective.

Returns:

Negative value indicates diverged, positive value converged.

Return type:

ConvergedReason

:sources:`Source code at slepc4py/SLEPc/LME.pyx:552 <slepc4py/SLEPc/LME.pyx#L552>`

getDimensions()#

Get the dimension of the subspace used by the solver.

Not collective.

Returns:

Maximum dimension of the subspace to be used by the solver.

Return type:

int

:sources:`Source code at slepc4py/SLEPc/LME.pyx:423 <slepc4py/SLEPc/LME.pyx#L423>`

getErrorEstimate()#

Get the error estimate obtained during solve.

Not collective.

Returns:

The error estimate

Return type:

float

:sources:`Source code at slepc4py/SLEPc/LME.pyx:287 <slepc4py/SLEPc/LME.pyx#L287>`

getErrorIfNotConverged()#

Get if solve() generates an error if the solver does not converge.

Not collective.

Get a flag indicating whether solve() will generate an error if the solver does not converge.

Returns:

True indicates you want the error generated.

Return type:

bool

:sources:`Source code at slepc4py/SLEPc/LME.pyx:581 <slepc4py/SLEPc/LME.pyx#L581>`

getIterationNumber()#

Get the current iteration number.

Not collective.

If the call to solve() is complete, then it returns the number of iterations carried out by the solution method.

Returns:

Iteration number.

Return type:

int

:sources:`Source code at slepc4py/SLEPc/LME.pyx:534 <slepc4py/SLEPc/LME.pyx#L534>`

getMonitor()#

Get the list of monitor functions.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:502 <slepc4py/SLEPc/LME.pyx#L502>`

Return type:

LMEMonitorFunction

getOptionsPrefix()#

Get the prefix used for searching for all LME options in the database.

Not collective.

Returns:

The prefix string set for this LME object.

Return type:

str

:sources:`Source code at slepc4py/SLEPc/LME.pyx:320 <slepc4py/SLEPc/LME.pyx#L320>`

getProblemType()#

Get the LME problem type of this object.

Not collective.

Returns:

The problem type currently being used.

Return type:

ProblemType

:sources:`Source code at slepc4py/SLEPc/LME.pyx:152 <slepc4py/SLEPc/LME.pyx#L152>`

getRHS()#

Get the right-hand side of the matrix equation.

Collective.

Returns:

The low-rank matrix

Return type:

C

:sources:`Source code at slepc4py/SLEPc/LME.pyx:239 <slepc4py/SLEPc/LME.pyx#L239>`

getSolution()#

Get the solution of the matrix equation.

Collective.

Returns:

The low-rank matrix

Return type:

X

:sources:`Source code at slepc4py/SLEPc/LME.pyx:271 <slepc4py/SLEPc/LME.pyx#L271>`

getTolerances()#

Get the tolerance and maximum iteration count.

Not collective.

Get the tolerance and maximum iteration count used by the default LME convergence tests.

Returns:

  • tol (float) – The convergence tolerance.

  • max_it (int) – The maximum number of iterations

Return type:

tuple[float, int]

:sources:`Source code at slepc4py/SLEPc/LME.pyx:380 <slepc4py/SLEPc/LME.pyx#L380>`

getType()#

Get the LME type of this object.

Not collective.

Returns:

The solver currently being used.

Return type:

str

:sources:`Source code at slepc4py/SLEPc/LME.pyx:123 <slepc4py/SLEPc/LME.pyx#L123>`

reset()#

Reset the LME object.

Collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:83 <slepc4py/SLEPc/LME.pyx#L83>`

Return type:

None

setBV(bv)#

Set a basis vector object to the LME object.

Collective.

Parameters:

bv (BV) – The basis vectors context.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:468 <slepc4py/SLEPc/LME.pyx#L468>`

setCoefficients(A, B=None, D=None, E=None)#

Set the coefficient matrices.

Collective.

Set the coefficient matrices that define the linear matrix equation to be solved.

Parameters:
  • A (Mat) – First coefficient matrix

  • B (Mat | None) – Second coefficient matrix, optional

  • D (Mat | None) – Third coefficient matrix, optional

  • E (Mat | None) – Fourth coefficient matrix, optional

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:167 <slepc4py/SLEPc/LME.pyx#L167>`

setDimensions(ncv)#

Set the dimension of the subspace to be used by the solver.

Logically collective.

Parameters:

ncv (int) – Maximum dimension of the subspace to be used by the solver.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:438 <slepc4py/SLEPc/LME.pyx#L438>`

setErrorIfNotConverged(flg=True)#

Set solve() to generate an error if the solver has not converged.

Logically collective.

Parameters:

flg (bool) – True indicates you want the error generated.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:567 <slepc4py/SLEPc/LME.pyx#L567>`

setFromOptions()#

Set LME options from the options database.

Collective.

Sets LME options from the options database. This routine must be called before setUp() if the user is to be allowed to set the solver type.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:368 <slepc4py/SLEPc/LME.pyx#L368>`

Return type:

None

setMonitor(monitor, args=None, kargs=None)#

Append a monitor function to the list of monitors.

Logically collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:481 <slepc4py/SLEPc/LME.pyx#L481>`

Parameters:
Return type:

None

setOptionsPrefix(prefix=None)#

Set the prefix used for searching for all LME options in the database.

Logically collective.

Parameters:

prefix (str | None) – The prefix string to prepend to all LME option requests.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:335 <slepc4py/SLEPc/LME.pyx#L335>`

setProblemType(lme_problem_type)#

Set the LME problem type of this object.

Logically collective.

Parameters:

lme_problem_type (ProblemType | str) – The problem type to be used.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:138 <slepc4py/SLEPc/LME.pyx#L138>`

setRHS(C)#

Set the right-hand side of the matrix equation.

Collective.

Set the right-hand side of the matrix equation, as a low-rank matrix.

Parameters:

C (Mat) – The right-hand side matrix

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:223 <slepc4py/SLEPc/LME.pyx#L223>`

setSolution(X)#

Set the placeholder for the solution of the matrix equation.

Collective.

Set the placeholder for the solution of the matrix equation, as a low-rank matrix.

Parameters:

X (Mat) – The solution matrix

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:255 <slepc4py/SLEPc/LME.pyx#L255>`

setTolerances(tol=None, max_it=None)#

Set the tolerance and maximum iteration count.

Logically collective.

Set the tolerance and maximum iteration count used by the default LME convergence tests.

Parameters:
  • tol (float | None) – The convergence tolerance.

  • max_it (int | None) – The maximum number of iterations

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:401 <slepc4py/SLEPc/LME.pyx#L401>`

setType(lme_type)#

Set the particular solver to be used in the LME object.

Logically collective.

Parameters:

lme_type (Type | str) – The solver to be used.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:108 <slepc4py/SLEPc/LME.pyx#L108>`

setUp()#

Set up all the internal necessary data structures.

Collective.

Set up all the internal data structures necessary for the execution of the eigensolver.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:515 <slepc4py/SLEPc/LME.pyx#L515>`

Return type:

None

solve()#

Solve the linear matrix equation.

Collective.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:526 <slepc4py/SLEPc/LME.pyx#L526>`

Return type:

None

view(viewer=None)#

Print the LME data structure.

Collective.

Parameters:

viewer (Viewer | None) – Visualization context; if not provided, the standard output is used.

Return type:

None

:sources:`Source code at slepc4py/SLEPc/LME.pyx:58 <slepc4py/SLEPc/LME.pyx#L58>`

Attributes Documentation

bv#

The basis vectors (BV) object associated to the LME object.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:622 <slepc4py/SLEPc/LME.pyx#L622>`

fn#

The math function (FN) object associated to the LME object.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:615 <slepc4py/SLEPc/LME.pyx#L615>`

max_it#

The maximum iteration count used by the LME convergence tests.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:608 <slepc4py/SLEPc/LME.pyx#L608>`

tol#

The tolerance value used by the LME convergence tests.

:sources:`Source code at slepc4py/SLEPc/LME.pyx:601 <slepc4py/SLEPc/LME.pyx#L601>`