Skip to main content
`Ctrl`+`K`

# MFNSetTolerances

Sets the tolerance and maximum iteration count used by the `MFN` convergence tests.

## Synopsis

    #include "slepcmfn.h"
    PetscErrorCode MFNSetTolerances(MFN mfn,PetscReal tol,PetscInt maxits)

Logically Collective

## Input Parameters

- mfn - the matrix function solver context

- tol - the convergence tolerance

- maxits - maximum number of iterations to use

## Options Database Keys

- -mfn_tol <tol> - sets the convergence tolerance

- -mfn_max_it <maxits> - sets the maximum number of iterations allowed

## Notes

Use `PETSC_CURRENT` to retain the current value of any of the parameters. Use `PETSC_DETERMINE` for either argument to assign a default value computed internally (may be different in each solver). For `maxits` use `PETSC_UNLIMITED` to indicate there is no upper bound on this value.

## See Also

MFN: Matrix Function, `MFNGetTolerances()`

## Level

intermediate

## Location

src/mfn/interface/mfnopts.c

## Examples

src/mfn/tutorials/ex23f.F90
src/mfn/tutorials/ex23.c

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