# MatSeqDenseSetPreallocation
Sets the array used for storing the matrix elements of a `MATSEQDENSE` matrix 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatSeqDenseSetPreallocation(Mat B, PetscScalar data[])
```
Collective


## Input Parameters

- ***B -*** the matrix
- ***data -*** the array (or NULL)



## Note
The data input variable is intended primarily for Fortran programmers
who wish to allocate their own matrix memory space.  Most users should
need not call this routine.




## See Also
 `MATSEQDENSE`, `MatCreate()`, `MatCreateDense()`, `MatSetValues()`, `MatDenseSetLDA()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/dense.c.html#MatSeqDenseSetPreallocation">src/mat/impls/dense/seq/dense.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex2.c.html">src/mat/tutorials/ex2.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/dense.c.html#MatSeqDenseSetPreallocation_SeqDense">MatSeqDenseSetPreallocation_SeqDense in src/mat/impls/dense/seq/dense.c</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
