MatPartitioningSetVertexWeights — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# MatPartitioningSetVertexWeights

Sets the weights for vertices for a partitioning.

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatPartitioningSetVertexWeights(MatPartitioning part, const PetscInt weights[])

Logically Collective

## Input Parameters

- part - the partitioning context

- weights - the weights, on each process this array must have the same size as the number of local rows times the value passed with `MatPartitioningSetNumberVertexWeights()` or 1 if that is not provided

## Notes

The array weights is freed by PETSc so the user should not free the array. In C/C++ the array must be obtained with a call to `PetscMalloc()`, not malloc().

The weights may not be used by some partitioners

## Fortran Note

The array `weights` is copied during this function call.

## See Also

Matrices, `Mat`, `MatPartitioning`, `MatPartitioningCreate()`, `MatPartitioningSetType()`, `MatPartitioningSetPartitionWeights()`, `MatPartitioningSetNumberVertexWeights()`

## Level

beginner

## Location

src/mat/graphops/partition/partition.c

## Examples

src/mat/tutorials/ex15.c

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