Skip to main content
`Ctrl`+`K`

# VecBoundGradientProjection

Projects vector according to this definition. If XL[i] < X[i] < XU[i], then GP[i] = G[i]; If X[i] <= XL[i], then GP[i] = min(G[i],0); If X[i] >= XU[i], then GP[i] = max(G[i],0);

## Synopsis

    #include "petscvec.h"
    PetscErrorCode VecBoundGradientProjection(Vec G, Vec X, Vec XL, Vec XU, Vec GP)

## Input Parameters

- G - current gradient vector

- X - current solution vector with XL[i] <= X[i] <= XU[i]

- XL - lower bounds

- XU - upper bounds

## Output Parameter

- GP - gradient projection vector

## Note

`GP` may be the same vector as `G`

For complex numbers only the real part is used in the bounds.

## See Also

`Vec`

## Level

advanced

## Location

src/vec/vec/utils/projection.c

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