:orphan: # 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 - ***mat -*** 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 [](ch_matrices), `Mat`, `MATDENSE`, `MATDENSECUDA`, `MATDENSEHIP`, `MatDenseGetColumnVec()`, `MatDenseGetColumnVecWrite()`, `MatDenseRestoreColumnVec()`, `MatDenseRestoreColumnVecRead()`, `MatDenseRestoreColumnVecWrite()` ## Level intermediate ## Location src/mat/impls/dense/seq/dense.c ## Implementations MatDenseGetColumnVecRead_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatDenseGetColumnVecRead_SeqDense in src/mat/impls/dense/seq/dense.c
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/dense/seq/dense.c) [Index of all Mat routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)