MatGetRowSumAbs — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# MatGetRowSumAbs

Gets the sum value (in absolute value) of each row of the matrix

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatGetRowSumAbs(Mat mat, Vec v)

Logically Collective

## Input Parameter

- mat - the matrix

## Output Parameter

- v - the vector for storing the sum

This code is only implemented for a couple of matrix formats.

## See Also

Matrices, `Mat`, `MatGetDiagonal()`, `MatCreateSubMatrices()`, `MatCreateSubMatrix()`, `MatGetRowMax()`, `MatGetRowMin()`, `MatGetRowMinAbs()`

## Level

intermediate

## Location

src/mat/interface/matrix.c

## Examples

src/ksp/ksp/tutorials/ex72.c

## Implementations

MatGetRowSumAbs_MPIAIJ() in src/mat/impls/aij/mpi/mpiaij.c
MatGetRowSumAbs_SeqAIJ() in src/mat/impls/aij/seq/aij.c
MatGetRowSumAbs_SeqBAIJ() in src/mat/impls/baij/seq/baij.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages