PETSc version 3.15.4
Fix/Edit manual page


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


#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






MatSetValuesCOO_MPIAIJCUSPARSE in src/mat/impls/aij/mpi/mpicusparse/
MatSetValuesCOO_SeqAIJCUSPARSE in src/mat/impls/aij/seq/seqcusparse/

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages