# MatKAIJSetS
Set the S matrix describing the shift action of the `MATKAIJ` matrix 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatKAIJSetS(Mat A, PetscInt p, PetscInt q, const PetscScalar S[])
```
Logically Collective; the entire S is stored independently on all processes.


## Input Parameters

- ***A -*** the `MATKAIJ` matrix
- ***p -*** the number of rows in S
- ***q -*** the number of columns in S
- ***S -*** the S matrix, in form of a scalar array in column-major format



## Notes
The dimensions p and q must match those of the transformation matrix T associated with the `MATKAIJ` matrix.

The S matrix is copied, so the user can destroy this array.




## See Also
 `MATKAIJ`, `MatKAIJGetS()`, `MatKAIJSetT()`, `MatKAIJSetAIJ()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/kaij/kaij.c.html#MatKAIJSetS">src/mat/impls/kaij/kaij.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/kaij/kaij.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)  
