Skip to main content
Ctrl+K
PETSc v3.25.5-1025-gbb5710db44c9 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
  • MatDenseGetColumnVec

MatDenseGetColumnVec#

Gives read-write access to a column of a MATDENSE matrix, represented as a Vec.

Synopsis#

#include "petscmat.h" 
PetscErrorCode MatDenseGetColumnVec(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. Users need to call MatDenseRestoreColumnVec() when the vector is no longer needed.

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

See Also#

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

Level#

intermediate

Location#

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

Examples#

src/mat/tests/ex318.c
src/mat/tests/ex70.c
src/ml/da/tutorials/ex1.c
src/ml/da/tutorials/ex2.c
src/ml/da/tutorials/ex3.c
src/ml/da/tutorials/ex4.c
src/ksp/ksp/tests/ex90.c
src/vec/vec/tests/ex16k.kokkos.cxx

Implementations#

MatDenseGetColumnVec_MPIDense() in src/mat/impls/dense/mpi/mpidense.c
MatDenseGetColumnVec_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-09-23T03:43:50-0500 (v3.25.5-1025-gbb5710db44c9).