petsc-3.15.0 2021-03-30
Report Typos and Errors

# MatSetValuesCOO

set values at once in a matrix preallocated using MatSetPreallocationCOO()

### Synopsis

    #include "petscmat.h"
    PetscErrorCode MatSetValuesCOO(Mat A, const PetscScalar coo_v[], InsertMode imode)

Collective on Mat

### Input Arguments

| A | - matrix being preallocated
| coo_v | - the matrix values (can be NULL)
| imode | - the insert mode

Notes: The values must follow the order of the indices prescribed with MatSetPreallocationCOO(). When repeated entries are specified in the COO indices the coo_v values are first properly summed. The imode flag indicates if coo_v must be added to the current values of the matrix (ADD_VALUES) or overwritten (INSERT_VALUES). Currently optimized for cuSPARSE matrices only. Passing coo_v == NULL is equivalent to passing an array of zeros.

### See Also

MatSetPreallocationCOO(), InsertMode, INSERT_VALUES, ADD_VALUES

### Level

beginner

### Location

src/mat/utils/gcreate.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages