petsc-3.7.1 2016-05-15
Report Typos and Errors

# 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 on Mat Many br

### Input Parameters

| mat | - the matrix to be scaled Many br
| l | - the left scaling vector (or NULL) Many br
| r | - the right scaling vector (or NULL) Many br

### Notes

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

Many br

### See Also

MatScale()

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/snes/examples/tutorials/ex70.c.html
src/tao/pde_constrained/examples/tutorials/elliptic.c.html
src/tao/pde_constrained/examples/tutorials/parabolic.c.html
src/tao/pde_constrained/examples/tutorials/hyperbolic.c.html