VecMean — PETSc 3.25.2 documentation

Skip to main content
`Ctrl`+`K`

# VecMean

Computes the arithmetic mean of all the components of a vector.

## Synopsis

    #include "petscvec.h"
    PetscErrorCode VecMean(Vec v, PetscScalar *mean)

Collective

## Input Parameter

- v - the vector

## Output Parameter

- mean - the result

## See Also

`Vec`, `VecSum()`, `VecNorm()`

## Level

beginner

## Location

src/vec/vec/utils/vinv.c

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