Skip to main content
Ctrl+K
PETSc v3.26.0-166-g33866e03b893 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
  • MatDenseGetC...

MatDenseGetColumnVecRead#

Gives read-only access to a column of a dense matrix, represented as a Vec.

Synopsis#

#include "petscmat.h" 
PetscErrorCode MatDenseGetColumnVecRead(Mat A, PetscInt col, Vec *v)

Collective

Input Parameters#

  • A - the Mat object

  • col - the column index

Output Parameter#

  • v - the vector

Notes#

The vector is owned by PETSc and users cannot modify it.

Users need to call MatDenseRestoreColumnVecRead() when the vector is no longer needed.

Use MatDenseGetColumnVec() to obtain read-write access or MatDenseGetColumnVecWrite() for write-only access.

See Also#

Matrices, Mat, MATDENSE, MATDENSECUDA, MATDENSEHIP, MatDenseGetColumnVec(), MatDenseGetColumnVecWrite(), MatDenseRestoreColumnVec(), MatDenseRestoreColumnVecRead(), MatDenseRestoreColumnVecWrite()

Level#

intermediate

Location#

src/mat/impls/dense/seq/dense.c

Examples#

src/mat/tests/ex237.c
src/mat/tests/ex241.c
src/mat/tests/ex268.c
src/mat/tests/ex318.c
src/mat/tests/ex70.c
src/ksp/ksp/tests/ex90.c
src/ksp/pc/tests/ex16.c
src/snes/tests/ex8.c

Implementations#

MatDenseGetColumnVecRead_MPIDense() in src/mat/impls/dense/mpi/mpidense.c
MatDenseGetColumnVecRead_SeqDense() in src/mat/impls/dense/seq/dense.c


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

On this page
  • Synopsis
  • Input Parameters
  • Output Parameter
  • Notes
  • 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-10-19T03:43:11-0500 (v3.26.0-166-g33866e03b893).