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

# MatScale

Scales all elements of a matrix by a given number.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode MatScale(Mat mat,PetscScalar a)

Logically Collective on Mat Many br

### Input Parameters

| mat | - the matrix to be scaled Many br
| a | - the scaling value Many br

### Output Parameter

mat -the scaled matrix Many br

Many br

### See Also

MatDiagonalScale()

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/ksp/examples/tutorials/ex56.c.html
src/snes/examples/tutorials/ex70.c.html
src/tao/unconstrained/examples/tutorials/eptorsion2.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