Skip to main content
`Ctrl`+`K`

# STSetMatMode

Sets a flag to indicate how the transformed matrices are being stored in the spectral transformations.

## Synopsis

    #include "slepcst.h"
    PetscErrorCode STSetMatMode(ST st,STMatMode mode)

Logically Collective

## Input Parameters

- st - the spectral transformation context

- mode - the mode

## Options Database Key

- -st_matmode <mode> - set the mode, one of `copy`, `inplace`, `shell`

## Notes

By default (`ST_MATMODE_COPY`), a copy of matrix \(A\) is made and then this copy is modified explicitly, e.g., \(A \leftarrow A - \sigma B\).

With `ST_MATMODE_INPLACE`, the original matrix \(A\) is modified at `STSetUp()` and changes are reverted at the end of the computations. With respect to the previous one, this mode avoids a copy of matrix \(A\). However, a drawback is that the recovered matrix might be slightly different from the original one (due to roundoff).

With `ST_MATMODE_SHELL`, the solver works with an implicit shell matrix that represents the shifted matrix. This mode is the most efficient in creating the shifted matrix but it places serious limitations to the linear solves performed in each iteration of the eigensolver (typically, only iterative solvers with Jacobi preconditioning can be used).

In the two first modes the efficiency of the computation can be controlled with `STSetMatStructure()`.

## See Also

ST: Spectral Transformation, `STSetMatrices()`, `STSetMatStructure()`, `STGetMatMode()`, `STMatMode`

## Level

intermediate

## Location

src/sys/classes/st/interface/stset.c

## Examples

src/pep/tutorials/ex28.c

Index of all ST routines Table of Contents for all manual pages Index of all manual pages