:orphan: # MatDenseGetArrayWriteAndMemType gives write-only access to the array where the data for a `MATDENSE` matrix is stored ## Synopsis ``` #include "petscmat.h" PetscErrorCode MatDenseGetArrayWriteAndMemType(Mat A, PetscScalar **array, PetscMemType *mtype) ``` Logically Collective ## Input Parameter - ***mat -*** a dense matrix ## Output Parameters - ***array -*** pointer to the data - ***mtype -*** memory type of the returned pointer ## Notes If the matrix is of a device type such as `MATDENSECUDA`, `MATDENSEHIP`, etc., an array on device is always returned and is guaranteed to contain the matrix's latest data. ## See Also [](ch_matrices), `Mat`, `MATDENSE`, `MatDenseRestoreArrayWriteAndMemType()`, `MatDenseGetArrayReadAndMemType()`, `MatDenseGetArrayRead()`, `MatDenseRestoreArrayRead()`, `MatDenseGetArrayWrite()`, `MatDenseRestoreArrayWrite()`, `MatSeqAIJGetCSRAndMemType()` ## Level intermediate ## Location 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)