# VecStepMax
Returns the largest value so that x[i] + step*DX[i] >= 0 for all i 
## Synopsis
```
#include "petscvec.h"  
PetscErrorCode VecStepMax(Vec X, Vec DX, PetscReal *step)
```
Collective on Vec


## Input Parameters

- ***X  -*** vector with no negative entries
- ***DX  -*** a step direction, can have negative, positive or zero entries



## Output Parameter

- ***step -*** largest value such that x[i] + step*DX[i] >= 0 for all i



## Notes
For complex numbers only compares the real part



## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/projection.c.html#VecStepMax">src/vec/vec/utils/projection.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/utils/projection.c)


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