# MatEqual

Compares two matrices.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatEqual(Mat A,Mat B,PetscTruth *flg)

Collective on Mat

### Input Parameters

| A | - the first matrix
| B | - the second matrix

### Output Parameter

flg -PETSC_TRUE if the matrices are equal; PETSC_FALSE otherwise.

### C++ variants

| PetscTruth MatEqual(Mat A,Mat B) |  | -> |  | MatEqual(A,B,&t); return t;

Level:intermediate
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/examples/tutorials/ex10.c.html