# TaoSetInequalityConstraintsRoutine
Sets a function to be used to compute constraints.  Tao only handles constraints under certain conditions, see manual for details 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoSetInequalityConstraintsRoutine(Tao tao, Vec ci, PetscErrorCode (*func)(Tao, Vec, Vec, void *), void *ctx)
```
Logically collective


## Input Parameters

- ***tao -*** the Tao context
- ***ci   -*** A vector that will be used to store inequality constraint evaluation
- ***func -*** the bounds computation routine
- ***ctx -*** [optional] user-defined context for private data for the inequality constraints computation (may be NULL)



## Calling sequence of func
```none
func (Tao tao, Vec x, Vec ci, void *ctx);
```


- ***tao -*** the Tao
- ***x   -*** point to evaluate inequality constraints
- ***ci   -*** vector of inequality constraints evaluated at x
- ***ctx -*** the (optional) user-defined function context




.seealso: `Tao, `TaoSetObjective()`, `TaoSetHessian()`, `TaoSetObjectiveAndGradient()`, `TaoSetVariableBounds()`


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/taosolver_bounds.c.html#TaoSetInequalityConstraintsRoutine">src/tao/interface/taosolver_bounds.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/constrained/tutorials/ex1.c.html">src/tao/constrained/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/constrained/tutorials/maros.c.html">src/tao/constrained/tutorials/maros.c.html</A><BR>


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


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