# VecMin

Determines the minimum vector component and its location.

### Synopsis

    #include "petscvec.h"
    PetscErrorCode PETSCVEC_DLLEXPORT VecMin(Vec x,PetscInt *p,PetscReal *val)

Collective on Vec

### Input Parameters

x -the vector

### Output Parameter

| val | - the minimum component
| p | - the location of val

### C++ variants

| VecMin(Vec x,PetscReal *r) |  | -> |  | VecMin(x,PETSC_NULL,r)

### Notes

Returns the value PETSC_MAX and p = -1 if the vector is of length 0.

### See Also

VecMax()

Level:intermediate
Location:src/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/snes/examples/tutorials/ex26.c.html