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

# VecScale

Scales a vector.

### Synopsis

    #include "petscvec.h"
    PetscErrorCode  VecScale(Vec x, PetscScalar alpha)

Not collective on Vec Many br

### Input Parameters

| x | - the vector Many br
| alpha | - the scalar Many br

### Output Parameter

x -the scaled vector Many br

### Note

For a vector with n components, VecScale() computes Many br

         x[i] = alpha * x[i], for i=1,...,n.

Many br

Level:intermediate
Location:src/vec/vec/interface/rvector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/vec/vec/examples/tutorials/ex1.c.html
src/vec/vec/examples/tutorials/ex1f.F.html
src/vec/vec/examples/tutorials/ex1f90.F.html
src/vec/vec/examples/tutorials/ex20f90.F90.html
src/dm/examples/tutorials/ex1.c.html
src/dm/examples/tutorials/ex7.c.html
src/dm/examples/tutorials/ex9.c.html
src/ksp/ksp/examples/tutorials/ex28.c.html
src/ksp/ksp/examples/tutorials/ex31.c.html
src/ksp/ksp/examples/tutorials/ex49.c.html
src/snes/examples/tutorials/ex15.c.html