VecSum#

Computes the sum of all the components of a vector.

Synopsis#

#include "petscvec.h" 
PetscErrorCode VecSum(Vec v, PetscScalar *sum)

Collective

Input Parameter#

  • v - the vector

Output Parameter#

  • sum - the result

See Also#

VecMean(), VecNorm()

Level#

beginner

Location#

src/vec/vec/utils/vinv.c

Examples#

src/vec/vec/tutorials/ex13.c.html
src/vec/vec/tutorials/ex18.c.html
src/vec/vec/tutorials/ex18f.F90.html
src/dm/tutorials/ex2.c.html
src/ksp/ksp/tutorials/ex59.c.html
src/ts/tutorials/ex9.c.html
src/ts/tutorials/extchem.c.html
src/tao/unconstrained/tutorials/spectraladjointassimilation.c.html
src/tao/constrained/tutorials/tomographyADMM.c.html
src/tao/pde_constrained/tutorials/elliptic.c.html
src/tao/pde_constrained/tutorials/hyperbolic.c.html

Implementations#

VecSum_SeqKokkos in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx
VecSum_SeqCUDA in src/vec/vec/impls/seq/seqcuda/veccuda2.cu
VecSum_SeqHIP in src/vec/vec/impls/seq/seqhip/vechip2.hip.c


Edit on GitLab

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