# MatMultDiagonalBlock
Computes the matrix-vector product, y = Dx. Where D is defined by the inode or block structure of the diagonal 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatMultDiagonalBlock(Mat mat, Vec x, Vec y)
```
Collective


## Input Parameters

- ***mat -*** the matrix
- ***x   -*** the vector to be multiplied



## Output Parameters

- ***y -*** the result





## Note
The vectors `x` and `y` cannot be the same.  I.e., one cannot
call `MatMultDiagonalBlock`(A,y,y).


## See Also
 `Mat`, `MatMult()`, `MatMultTranspose()`, `MatMultAdd()`, `MatMultTransposeAdd()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatMultDiagonalBlock">src/mat/interface/matrix.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mpiaij.c.html#MatMultDiagonalBlock_MPIAIJ">MatMultDiagonalBlock_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sell/mpi/mpisell.c.html#MatMultDiagonalBlock_MPISELL">MatMultDiagonalBlock_MPISELL in src/mat/impls/sell/mpi/mpisell.c</A><BR>


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