# SNESQNSetType
Sets the quasi-Newton variant to be used in `SNESQN`. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESQNSetType(SNES snes, SNESQNType qtype)
```
Logically Collective on snes


## Input Parameters

- ***snes -*** the iterative context
- ***qtype -*** variant type



## Options Database Key

- ***-snes_qn_type <lbfgs,broyden,badbroyden> -*** quasi-Newton type





## `SNESQNType`s

- ***`SNES_QN_LBFGS` -*** LBFGS variant
- ***`SNES_QN_BROYDEN` -*** Broyden variant
- ***`SNES_QN_BADBROYDEN` -*** Bad Broyden variant



## See Also
 `SNESQN`, `SNES_QN_LBFGS`, `SNES_QN_BROYDEN`, `SNES_QN_BADBROYDEN`, `SNESQNType`, `TAOLMVM`, `TAOBLMVM`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/qn/qn.c.html#SNESQNSetType">src/snes/impls/qn/qn.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/impls/qn/qn.c.html#SNESQNSetType_QN">SNESQNSetType_QN in src/snes/impls/qn/qn.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/impls/qn/qn.c)


[Index of all SNES routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
