# MatDiagonalScale#

Scales a matrix on the left and right by diagonal matrices that are stored as vectors. Either of the two scaling matrices can be NULL.

## Synopsis#

#include "petscmat.h"
PetscErrorCode MatDiagonalScale(Mat mat, Vec l, Vec r)


Collective

## Input Parameters#

• mat - the matrix to be scaled

• l - the left scaling vector (or NULL)

• r - the right scaling vector (or NULL)

## Note#

MatDiagonalScale() computes A = LAR, where L = a diagonal matrix (stored as a vector), R = a diagonal matrix (stored as a vector) The L scales the rows of the matrix, the R scales the columns of the matrix.

Mat, MatScale(), MatShift(), MatDiagonalSet()

intermediate

## Location#

src/mat/interface/matrix.c

Edit on GitLab