PETSc version 3.17.5
MatSetPreallocationCOO
set preallocation for matrices using a coordinate format of the entries with global indices
Synopsis
#include "petscmat.h"
PetscErrorCode MatSetPreallocationCOO(Mat A,PetscCount ncoo,const PetscInt coo_i[],const PetscInt coo_j[])
Collective on Mat
Input Parameters
| A | - matrix being preallocated
|
| ncoo | - number of entries
|
| coo_i | - row indices
|
| coo_j | - column indices
|
Notes
Entries can be repeated, see MatSetValuesCOO(). Entries with negative row or column indices are allowed
but will be ignored. The corresponding entries in MatSetValuesCOO() will be ignored too. Remote entries
are allowed and will be properly added or inserted to the matrix, unless the matrix option MAT_IGNORE_OFF_PROC_ENTRIES
is set, in which case remote entries are ignored, or MAT_NO_OFF_PROC_ENTRIES is set, in which case an error will be generated.
The arrays coo_i and coo_j may be freed immediately after calling this function.
See Also
MatSetValuesCOO(), MatSeqAIJSetPreallocation(), MatMPIAIJSetPreallocation(), MatSeqBAIJSetPreallocation(), MatMPIBAIJSetPreallocation(), MatSeqSBAIJSetPreallocation(), MatMPISBAIJSetPreallocation(), MatSetPreallocationCOOLocal(), DMSetMatrixPreallocateSkip()
Level
beginner
Location
src/mat/utils/gcreate.c
Examples
src/mat/tutorials/ex18.c.html
Implementations
MatSetPreallocationCOO_MPIAIJKokkos in src/mat/impls/aij/mpi/kokkos/mpiaijkok.kokkos.cxx
MatSetPreallocationCOO_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatSetPreallocationCOO_MPIAIJCUSPARSE in src/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.cu
MatSetPreallocationCOO_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatSetPreallocationCOO_SeqAIJKokkos in src/mat/impls/aij/seq/kokkos/aijkok.kokkos.cxx
MatSetPreallocationCOO_SeqAIJCUSPARSE in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatSetPreallocationCOO_HYPRE in src/mat/impls/hypre/mhypre.c
MatSetPreallocationCOO_IS in src/mat/impls/is/matis.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages