Skip to main content
Ctrl+K
PETSc v3.26.1-379-g3b44b8f42464d 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
  • VecSqrtAbs

VecSqrtAbs#

Replaces each component of a vector by the square root of its magnitude.

Synopsis#

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

Not Collective

Input Parameter#

  • v - The vector

Note#

The actual function is sqrt(|x_i|)

See Also#

Vec, VecLog(), VecExp(), VecReciprocal(), VecAbs()

Level#

beginner

Location#

src/vec/vec/utils/vinv.c

Examples#

src/vec/vec/tests/ex63.c
src/vec/vec/tests/ex69.c
src/ksp/pc/tutorials/ex4.c
src/tao/constrained/tutorials/tomographyADMM.c
src/tao/tutorials/ex4.c

Implementations#

VecSqrtAbs_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
  • Note
  • 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-11-12T03:41:41-0600 (v3.26.1-379-g3b44b8f42464d).