Go to the documentation of this file.
26 int sigrval=0, renumber=0, ptype;
95 int sigrval=0, renumber=0, ptype;
137 nptr =
ismalloc(*
nn+1, 0,
"METIS_PartMeshDual: nptr");
138 nind =
imalloc(
eptr[*ne],
"METIS_PartMeshDual: nind");
140 for (
i=0;
i<*ne;
i++) {
146 for (
i=0;
i<*ne;
i++) {
148 nind[nptr[
eind[
j]]++] =
i;
183 idx_t nnbrs, *pwgts, *nbrdom, *nbrwgt, *nbrmrk;
186 pwgts =
ismalloc(
nparts, 0,
"InduceRowPartFromColumnPart: pwgts");
187 nbrdom =
ismalloc(
nparts, 0,
"InduceRowPartFromColumnPart: nbrdom");
188 nbrwgt =
ismalloc(
nparts, 0,
"InduceRowPartFromColumnPart: nbrwgt");
189 nbrmrk =
ismalloc(
nparts, -1,
"InduceRowPartFromColumnPart: nbrmrk");
191 iset(nrows, -1, rpart);
194 itpwgts =
imalloc(
nparts,
"InduceRowPartFromColumnPart: itpwgts");
205 for (
i=0;
i<nrows;
i++) {
206 if (rowptr[
i+1]-rowptr[
i] == 0) {
211 me = cpart[rowind[rowptr[
i]]];
212 for (
j=rowptr[
i]+1;
j<rowptr[
i+1];
j++) {
213 if (cpart[rowind[
j]] != me)
216 if (
j == rowptr[
i+1]) {
224 for (
i=0;
i<nrows;
i++) {
225 if (rpart[
i] == -1) {
226 for (nnbrs=0,
j=rowptr[
i];
j<rowptr[
i+1];
j++) {
227 me = cpart[rowind[
j]];
228 if (nbrmrk[me] == -1) {
231 nbrmrk[me] = nnbrs++;
234 nbrwgt[nbrmrk[me]]++;
240 rpart[
i] = nbrdom[
iargmax(nnbrs, nbrwgt)];
243 if (pwgts[rpart[
i]] > itpwgts[rpart[
i]]) {
244 for (
j=0;
j<nnbrs;
j++) {
245 if (pwgts[nbrdom[
j]] < itpwgts[nbrdom[
j]] ||
246 pwgts[nbrdom[
j]]-itpwgts[nbrdom[
j]] < pwgts[rpart[
i]]-itpwgts[rpart[
i]]) {
247 rpart[
i] = nbrdom[
j];
255 for (
j=0;
j<nnbrs;
j++)
256 nbrmrk[nbrdom[
j]] = -1;
260 gk_free((
void **)&pwgts, &nbrdom, &nbrwgt, &nbrmrk, &itpwgts,
LTERM);
#define ChangeMesh2FNumbering2
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t * objval
void gk_free(void **ptr1,...)
idx_t idx_t idx_t idx_t idx_t * vsize
int METIS_PartGraphRecursive(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part)
Recursive partitioning routine.
idx_t idx_t idx_t idx_t idx_t idx_t idx_t real_t * tpwgts
idx_t idx_t idx_t * adjncy
int METIS_PartMeshNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *vwgt, idx_t *vsize, idx_t *nparts, real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart)
idx_t idx_t idx_t idx_t * ncommon
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t idx_t idx_t * npart
int METIS_PartGraphKway(idx_t *nvtxs, idx_t *ncon, idx_t *xadj, idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt, idx_t *nparts, real_t *tpwgts, real_t *ubvec, idx_t *options, idx_t *objval, idx_t *part)
#define GETOPTION(options, idx, defval)
void InduceRowPartFromColumnPart(idx_t nrows, idx_t *rowptr, idx_t *rowind, idx_t *rpart, idx_t *cpart, idx_t nparts, real_t *tpwgts)
idx_t idx_t idx_t idx_t idx_t idx_t idx_t * nparts
int METIS_Free(void *ptr)
int METIS_MeshToDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *ncommon, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
idx_t idx_t idx_t idx_t * vwgt
#define ASSERT(expression)
#define SHIFTCSR(i, n, a)
idx_t idx_t idx_t idx_t idx_t idx_t real_t idx_t idx_t idx_t * epart
#define ChangeMesh2CNumbering
int METIS_MeshToNodal(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *numflag, idx_t **r_xadj, idx_t **r_adjncy)
void gk_malloc_cleanup(int showstats)
int METIS_PartMeshDual(idx_t *ne, idx_t *nn, idx_t *eptr, idx_t *eind, idx_t *vwgt, idx_t *vsize, idx_t *ncommon, idx_t *nparts, real_t *tpwgts, idx_t *options, idx_t *objval, idx_t *epart, idx_t *npart)
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:47