:orphan:
# SNESLineSearchSetVIFunctions
Sets VI-specific functions for line search computation. 
## Synopsis
```
#include "petscsnes.h" 
PetscErrorCode SNESLineSearchSetVIFunctions(SNESLineSearch linesearch, SNESLineSearchVIProjectFunc projectfunc, SNESLineSearchVINormFunc normfunc)
```
Logically Collective


## Input Parameters

- ***snes -*** nonlinear context obtained from `SNESCreate()`
- ***projectfunc -*** function for projecting the function to the bounds
- ***normfunc -*** function for computing the norm of an active set



## Calling sequence of `projectfunc`
```none
   PetscErrorCode projectfunc(SNES snes, Vec X)
```


- ***snes -*** nonlinear context
- ***X -*** current solution, store the projected solution here



## Calling sequence of `normfunc`
```none
   PetscErrorCode normfunc(SNES snes, Vec X, Vec F, PetscScalar *fnorm)
```


- ***snes -*** nonlinear context
- ***X -*** current solution
- ***F -*** current residual
- ***fnorm -*** VI-specific norm of the function





## Note
The VI solvers require projection of the solution to the feasible set.  `projectfunc` should implement this.

The VI solvers require special evaluation of the function norm such that the norm is only calculated
on the inactive set.  This should be implemented by `normfunc`.


## See Also
 `SNESLineSearch`, `SNESLineSearchGetVIFunctions()`, `SNESLineSearchSetPostCheck()`, `SNESLineSearchSetPreCheck()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/linesearch/interface/linesearch.c.html#SNESLineSearchSetVIFunctions">src/snes/linesearch/interface/linesearch.c</A>


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


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