Skip to main content
Ctrl+K
PETSc v3.24.5-709-g3c514f4e89b documentation - Home
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • VecAbs

VecAbs#

Replaces every element in a vector with its absolute value.

Synopsis#

#include "petscvec.h" 
PetscErrorCode VecAbs(Vec v)

Logically Collective

Input Parameter#

  • v - the vector

See Also#

Vec, VecExp(), VecSqrtAbs(), VecReciprocal(), VecLog(), VecPointwiseSign()

Level#

intermediate

Location#

src/vec/vec/utils/vinv.c

Examples#

src/tao/unconstrained/tutorials/elastic_net_regularization.c
src/tao/tutorials/ex4.c

Implementations#

VecAbs_SeqKokkos() in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx


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

On this page
  • Synopsis
  • Input Parameter
  • See Also
  • Level
  • Location
  • Examples
  • Implementations
Edit on GitLab
Show Source

© Copyright 1991-2026, UChicago Argonne, LLC and the PETSc Development Team.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.15.1.

Last updated on 2026-03-29T03:44:50-0500 (v3.24.5-709-g3c514f4e89b).