MatSetValuesBlocked

Inserts or adds a block of values into a matrix.

Synopsis

int MatSetValuesBlocked(Mat mat,int m,int *idxm,int n,int *idxn,Scalar *v,InsertMode addv)
Not Collective

Input Parameters

mat - the matrix
v - a logically two-dimensional array of values
m, idxm - the number of block rows and their global block indices
n, idxn - the number of block columns and their global block indices
addv - either ADD_VALUES or INSERT_VALUES, where ADD_VALUES adds values to any existing entries, and INSERT_VALUES replaces existing entries with new values

Notes

By default the values, v, are row-oriented and unsorted. So the layout ofv is the same as for MatSetValues(). See MatSetOption() for other options.

Calls to MatSetValuesBlocked() with the INSERT_VALUES and ADD_VALUESoptions cannot be mixed without intervening calls to the assemblyroutines.

MatSetValuesBlocked() uses 0-based row and column numbers in Fortranas well as in C.

Each time an entry is set within a sparse matrix via MatSetValues(), internal searching must be done to determine where to place the thedata in the matrix storage space. By instead inserting blocks ofentries via MatSetValuesBlocked(), the overhead of matrix assembly isreduced.

Restrictions

MatSetValuesBlocked() is currently supported only for the block AIJmatrix format (MATSEQBAIJ and MATMPIBAIJ, which are created viaMatCreateSeqBAIJ() and MatCreateMPIBAIJ()).

Keywords

matrix, insert, add, set, values

See Also

MatSetOption(), MatAssemblyBegin(), MatAssemblyEnd(), MatSetValues(), MatSetValuesBlockedLocal()

Location: src/mat/interface/matrix.c
Matrix Index
Table of Contents