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

# MatSetValue

Set a single entry into a matrix. Not collective Many br

### Synopsis

    #include <petscmat.h>
    PetscErrorCode MatSetValue(Mat m,PetscInt row,PetscInt col,PetscScalar value,InsertMode mode)

### Input Parameters

| m | - the matrix Many br
| row | - the row location of the entry Many br
| col | - the column location of the entry Many br
| value | - the value to insert Many br
| mode | - either INSERT_VALUES or ADD_VALUES Many br

### Notes

For efficiency one should use MatSetValues() and set several or many Many brvalues simultaneously if possible. Many br

Many br

### See Also

MatSetValues(), MatSetValueLocal()

Level:beginner
Location:src/mat/../../include/petscmat.h
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex58.c.html
src/ksp/ksp/examples/tutorials/ex44f.F90.html
src/snes/examples/tutorials/ex48.c.html
src/snes/examples/tutorials/ex47cu.cu.html
src/ts/examples/tutorials/ex10.c.html
src/ts/examples/tutorials/ex24.c.html