petsc-3.3-p7 2013-05-11

MatIJBinMap

simultaneously bin and map an array of indices (inidxi) along with index (inidxj) and scalar (inval) weights by pushing the indices along the edges of two pseudographs (see MATIJ, MatIJMap(), MatIJBin()). Each locally-supported index i from inidxi is assigned to the arrays (bins) corresponding to the global indices terminating the A's pseudograph edges that emanate from i. i's location in each bin is occupied by the index terminating the corresponding pseudograph edge that emanate from i in B. Thus, A and B must be compatible in the following sense: they must have the same local suppors and local image sizes. inidxi indices outside the local support are silently ignored -- contribute to no bins. The index (inidxj) and scalar (inval) weights are arranged in bins of their own, exactly mirroring the binning of inidxi.

Synopsis

#undef __FUNCT__  
#define __FUNCT__ "MatIJBinMap"
PetscErrorCode MatIJBinMap(Mat A, Mat B, MatIJIndexType intype, PetscInt insize, const PetscInt *inidxi, const PetscInt *inidxj, const PetscScalar *inval, MatIJIndexType outtype, PetscInt *outsize, PetscInt **outidxi, PetscInt **outidxj, PetscScalar **outval, PetscInt **binsizes) 
Not collective.

Input Parameters

A - binning pseudograph
B - mapping pseudograph
intype - (MATIJ_LOCAL | MATIJ_GLOBAL) meaning of inidxi: local support numbers or global indices
insize - size of the input index and weight arrays
inidxi - array (of size insize) of global indices
inidxj - array (of size insize) of index weights
inval - array (of size insize) of scalar weights
outtype - (MATIJ_LOCAL | MATIJ_GLOBAL) desired meaning of inidxi: local image numbers or global indices

Output Parameters

outsize - size of the array of concatenated bins
outidxi - array (of size outsize) containing the binned images of the indices from inidxi
outidxj - array (of size outsize) containing the binned index weights from inidxj
outval - array (of size outsize) containing the binned scalar weights from inval
binsizes - array (of size n0) of bin sizes

Note

The idea behind MatIJBinMap is that the binning is done by A, while what is actually binned comes from B.- Pseudographs A and B are structurally isomorphic. Moreover, they only differ in the terminating indices: edges i-e->jA and i-eB->jB are in a one-to-one correspondence, if their positions in the ordering of i's images are the same. Each source index i is assigned to every bin jA labeled by each of the indices attached to i in A by some eA, but the binned value is jB -- the index attached to i in B by eB, which corresponds to eA.
Another way of viewing the pseudograph pair A and B is as a single pseudograph (B), whose edges are- colored (by A's terminating indices), and ordered on the color within each originating index's image.

See Also

MATIJ, MatIJBin(), MatIJMap(), MatIJGetSupport(), MatIJGetImage(), MatIJGetRowSizes()

Level:advanced
Location:
src/mat/impls/ij/matij.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages