Graphviz  2.41.20171026.1811
Multilevel.h
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifndef MULTILEVEL_H
15 #define MULTILEVEL_H
16 
17 #include "SparseMatrix.h"
18 
19 typedef struct Multilevel_struct *Multilevel;
20 
22  int level;/* 0, 1, ... */
23  int n;
24  SparseMatrix A;/* the weighting matrix */
25  SparseMatrix D;/* the distance matrix. A and D should have same pattern,
26  but different entry values. For spring-electrical method, D = NULL. */
30  Multilevel next;
31  Multilevel prev;
33  int coarsen_scheme_used;/* to get from previous level to here */
34 };
35 
37 
38 enum {MAX_CLUSTER_SIZE = 4};
39 
41 
43 
45  int minsize;
47  int maxlevel;
48  int randomize;
51 };
52 
54 
55 Multilevel_control Multilevel_control_new(int scheme, int mode);
56 
57 void Multilevel_control_delete(Multilevel_control ctrl);
58 
59 void Multilevel_delete(Multilevel grid);
60 
61 Multilevel Multilevel_new(SparseMatrix A, SparseMatrix D, real *node_weights, Multilevel_control ctrl);
62 
63 Multilevel Multilevel_get_coarsest(Multilevel grid);
64 
65 void print_padding(int n);
66 
67 #define Multilevel_is_finest(grid) (!((grid)->prev))
68 #define Multilevel_is_coarsest(grid) (!((grid)->next))
69 
70 void Multilevel_coarsen(SparseMatrix A, SparseMatrix *cA, SparseMatrix D, SparseMatrix *cD, real *node_wgt, real **cnode_wgt,
71  SparseMatrix *P, SparseMatrix *R, Multilevel_control ctrl, int *coarsen_scheme_used);
72 #endif
SparseMatrix P
Definition: Multilevel.h:27
struct Multilevel_struct * Multilevel
Definition: Multilevel.h:19
void Multilevel_coarsen(SparseMatrix A, SparseMatrix *cA, SparseMatrix D, SparseMatrix *cD, real *node_wgt, real **cnode_wgt, SparseMatrix *P, SparseMatrix *R, Multilevel_control ctrl, int *coarsen_scheme_used)
Definition: Multilevel.c:1201
struct Multilevel_control_struct * Multilevel_control
Definition: Multilevel.h:53
Multilevel Multilevel_get_coarsest(Multilevel grid)
Definition: Multilevel.c:1312
Multilevel Multilevel_new(SparseMatrix A0, SparseMatrix D0, real *node_weights, Multilevel_control ctrl)
Definition: Multilevel.c:1294
void Multilevel_control_delete(Multilevel_control ctrl)
Definition: Multilevel.c:44
void print_padding(int n)
Definition: Multilevel.c:1249
Multilevel_control Multilevel_control_new(int scheme, int mode)
Definition: Multilevel.c:22
SparseMatrix A
Definition: Multilevel.h:24
SparseMatrix R
Definition: Multilevel.h:28
Multilevel prev
Definition: Multilevel.h:31
real * node_weights
Definition: Multilevel.h:29
SparseMatrix D
Definition: Multilevel.h:25
Multilevel next
Definition: Multilevel.h:30
void Multilevel_delete(Multilevel grid)
Definition: Multilevel.c:66
#define real
Definition: general.h:34