Graphviz
2.41.20171026.1811
Main Page
Data Structures
Files
File List
Globals
lib
sfdpgen
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
21
struct
Multilevel_struct
{
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. */
27
SparseMatrix
P
;
28
SparseMatrix
R
;
29
real
*
node_weights
;
30
Multilevel
next
;
31
Multilevel
prev
;
32
int
delete_top_level_A
;
33
int
coarsen_scheme_used
;
/* to get from previous level to here */
34
};
35
36
enum
{
MAX_IND_VTX_SET_U
= -100,
MAX_IND_VTX_SET_F
= -1,
MAX_IND_VTX_SET_C
= 0};
37
38
enum
{
MAX_CLUSTER_SIZE
= 4};
39
40
enum
{
EDGE_BASED_STA
,
COARSEN_INDEPENDENT_EDGE_SET
,
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE
,
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_LEAVES_FIRST
,
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_SUPERNODES_FIRST
,
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_DEGREE_SCALED
,
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_CLUSTER_PERNODE_LEAVES_FIRST
,
EDGE_BASED_STO
,
VERTEX_BASED_STA
,
COARSEN_INDEPENDENT_VERTEX_SET
,
COARSEN_INDEPENDENT_VERTEX_SET_RS
,
VERTEX_BASED_STO
,
COARSEN_HYBRID
};
41
42
enum
{
COARSEN_MODE_GENTLE
,
COARSEN_MODE_FORCEFUL
};
43
44
struct
Multilevel_control_struct
{
45
int
minsize
;
46
real
min_coarsen_factor
;
47
int
maxlevel
;
48
int
randomize
;
49
int
coarsen_scheme
;
50
int
coarsen_mode
;
51
};
52
53
typedef
struct
Multilevel_control_struct
*
Multilevel_control
;
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
Multilevel_struct::P
SparseMatrix P
Definition:
Multilevel.h:27
Multilevel_control_struct::coarsen_mode
int coarsen_mode
Definition:
Multilevel.h:50
Multilevel
struct Multilevel_struct * Multilevel
Definition:
Multilevel.h:19
COARSEN_INDEPENDENT_VERTEX_SET
Definition:
Multilevel.h:40
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_LEAVES_FIRST
Definition:
Multilevel.h:40
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_SUPERNODES_FIRST
Definition:
Multilevel.h:40
Multilevel_coarsen
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
VERTEX_BASED_STO
Definition:
Multilevel.h:40
Multilevel_struct::level
int level
Definition:
Multilevel.h:22
COARSEN_MODE_GENTLE
Definition:
Multilevel.h:42
Multilevel_control
struct Multilevel_control_struct * Multilevel_control
Definition:
Multilevel.h:53
Multilevel_get_coarsest
Multilevel Multilevel_get_coarsest(Multilevel grid)
Definition:
Multilevel.c:1312
Multilevel_struct::n
int n
Definition:
Multilevel.h:23
Multilevel_struct::delete_top_level_A
int delete_top_level_A
Definition:
Multilevel.h:32
Multilevel_control_struct
Definition:
Multilevel.h:44
Multilevel_control_struct::randomize
int randomize
Definition:
Multilevel.h:48
Multilevel_struct
Definition:
Multilevel.h:21
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE_DEGREE_SCALED
Definition:
Multilevel.h:40
MAX_IND_VTX_SET_C
Definition:
Multilevel.h:36
EDGE_BASED_STO
Definition:
Multilevel.h:40
Multilevel_control_struct::coarsen_scheme
int coarsen_scheme
Definition:
Multilevel.h:49
Multilevel_new
Multilevel Multilevel_new(SparseMatrix A0, SparseMatrix D0, real *node_weights, Multilevel_control ctrl)
Definition:
Multilevel.c:1294
SparseMatrix.h
Multilevel_control_struct::minsize
int minsize
Definition:
Multilevel.h:45
Multilevel_control_delete
void Multilevel_control_delete(Multilevel_control ctrl)
Definition:
Multilevel.c:44
COARSEN_INDEPENDENT_VERTEX_SET_RS
Definition:
Multilevel.h:40
print_padding
void print_padding(int n)
Definition:
Multilevel.c:1249
COARSEN_MODE_FORCEFUL
Definition:
Multilevel.h:42
MAX_IND_VTX_SET_F
Definition:
Multilevel.h:36
MAX_IND_VTX_SET_U
Definition:
Multilevel.h:36
MAX_CLUSTER_SIZE
Definition:
Multilevel.h:38
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_EDGE_PERNODE
Definition:
Multilevel.h:40
Multilevel_control_new
Multilevel_control Multilevel_control_new(int scheme, int mode)
Definition:
Multilevel.c:22
EDGE_BASED_STA
Definition:
Multilevel.h:40
Multilevel_control_struct::maxlevel
int maxlevel
Definition:
Multilevel.h:47
Multilevel_struct::coarsen_scheme_used
int coarsen_scheme_used
Definition:
Multilevel.h:33
COARSEN_INDEPENDENT_EDGE_SET_HEAVEST_CLUSTER_PERNODE_LEAVES_FIRST
Definition:
Multilevel.h:40
SparseMatrix_struct
Definition:
SparseMatrix.h:26
Multilevel_struct::A
SparseMatrix A
Definition:
Multilevel.h:24
Multilevel_control_struct::min_coarsen_factor
real min_coarsen_factor
Definition:
Multilevel.h:46
VERTEX_BASED_STA
Definition:
Multilevel.h:40
Multilevel_struct::R
SparseMatrix R
Definition:
Multilevel.h:28
COARSEN_HYBRID
Definition:
Multilevel.h:40
Multilevel_struct::prev
Multilevel prev
Definition:
Multilevel.h:31
COARSEN_INDEPENDENT_EDGE_SET
Definition:
Multilevel.h:40
Multilevel_struct::node_weights
real * node_weights
Definition:
Multilevel.h:29
Multilevel_struct::D
SparseMatrix D
Definition:
Multilevel.h:25
Multilevel_struct::next
Multilevel next
Definition:
Multilevel.h:30
Multilevel_delete
void Multilevel_delete(Multilevel grid)
Definition:
Multilevel.c:66
real
#define real
Definition:
general.h:34
Generated by
1.8.5