Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
amesos_cholmod_partition.h
Go to the documentation of this file.
1 /* ========================================================================== */
2 /* === Include/cholmod_partition.h ========================================== */
3 /* ========================================================================== */
4 
5 /* -----------------------------------------------------------------------------
6  * CHOLMOD/Include/cholmod_partition.h.
7  * Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis
8  * CHOLMOD/Include/cholmod_partition.h is licensed under Version 2.1 of the GNU
9  * Lesser General Public License. See lesser.txt for a text of the license.
10  * CHOLMOD is also available under other licenses; contact authors for details.
11  * http://www.cise.ufl.edu/research/sparse
12  * -------------------------------------------------------------------------- */
13 
14 /* CHOLMOD Partition module.
15  *
16  * Graph partitioning and graph-partition-based orderings. Includes an
17  * interface to CCOLAMD and CSYMAMD, constrained minimum degree ordering
18  * methods which order a matrix following constraints determined via nested
19  * dissection.
20  *
21  * cholmod_nested_dissection CHOLMOD nested dissection ordering
22  * cholmod_metis METIS nested dissection ordering (METIS_NodeND)
23  * cholmod_ccolamd interface to CCOLAMD ordering
24  * cholmod_csymamd interface to CSYMAMD ordering
25  * cholmod_camd interface to CAMD ordering
26  * cholmod_bisect graph partitioner (currently based on METIS)
27  * cholmod_metis_bisector direct interface to METIS_NodeComputeSeparator
28  *
29  * Requires the Core and Cholesky modules, and three packages: METIS, CAMD,
30  * and CCOLAMD. Optionally used by the Cholesky module.
31  *
32  * Note that METIS does not have a version that uses UF_long integers. If you
33  * try to use cholmod_nested_dissection, cholmod_metis, cholmod_bisect, or
34  * cholmod_metis_bisector on a matrix that is too large, an error code will be
35  * returned. METIS does have an "idxtype", which could be redefined as UF_long,
36  * if you wish to edit METIS or use compile-time flags to redefine idxtype.
37  */
38 
39 #ifndef AMESOS_CHOLMOD_PARTITION_H
40 #define AMESOS_CHOLMOD_PARTITION_H
41 
42 #include "amesos_cholmod_core.h"
43 
44 /* -------------------------------------------------------------------------- */
45 /* cholmod_nested_dissection */
46 /* -------------------------------------------------------------------------- */
47 
48 /* Order A, AA', or A(:,f)*A(:,f)' using CHOLMOD's nested dissection method
49  * (METIS's node bisector applied recursively to compute the separator tree
50  * and constraint sets, followed by CCOLAMD using the constraints). Usually
51  * finds better orderings than METIS_NodeND, but takes longer.
52  */
53 
54 UF_long amesos_cholmod_nested_dissection /* returns # of components */
55 (
56  /* ---- input ---- */
57  cholmod_sparse *A, /* matrix to order */
58  int *fset, /* subset of 0:(A->ncol)-1 */
59  size_t fsize, /* size of fset */
60  /* ---- output --- */
61  int *Perm, /* size A->nrow, output permutation */
62  int *CParent, /* size A->nrow. On output, CParent [c] is the parent
63  * of component c, or EMPTY if c is a root, and where
64  * c is in the range 0 to # of components minus 1 */
65  int *Cmember, /* size A->nrow. Cmember [j] = c if node j of A is
66  * in component c */
67  /* --------------- */
68  cholmod_common *Common
69 ) ;
70 
73 
74 /* -------------------------------------------------------------------------- */
75 /* cholmod_metis */
76 /* -------------------------------------------------------------------------- */
77 
78 /* Order A, AA', or A(:,f)*A(:,f)' using METIS_NodeND. */
79 
81 (
82  /* ---- input ---- */
83  cholmod_sparse *A, /* matrix to order */
84  int *fset, /* subset of 0:(A->ncol)-1 */
85  size_t fsize, /* size of fset */
86  int postorder, /* if TRUE, follow with etree or coletree postorder */
87  /* ---- output --- */
88  int *Perm, /* size A->nrow, output permutation */
89  /* --------------- */
90  cholmod_common *Common
91 ) ;
92 
93 int amesos_cholmod_l_metis (cholmod_sparse *, UF_long *, size_t, int, UF_long *,
94  cholmod_common *) ;
95 
96 /* -------------------------------------------------------------------------- */
97 /* cholmod_ccolamd */
98 /* -------------------------------------------------------------------------- */
99 
100 /* Order AA' or A(:,f)*A(:,f)' using CCOLAMD. */
101 
103 (
104  /* ---- input ---- */
105  cholmod_sparse *A, /* matrix to order */
106  int *fset, /* subset of 0:(A->ncol)-1 */
107  size_t fsize, /* size of fset */
108  int *Cmember, /* size A->nrow. Cmember [i] = c if row i is in the
109  * constraint set c. c must be >= 0. The # of
110  * constraint sets is max (Cmember) + 1. If Cmember is
111  * NULL, then it is interpretted as Cmember [i] = 0 for
112  * all i */
113  /* ---- output --- */
114  int *Perm, /* size A->nrow, output permutation */
115  /* --------------- */
116  cholmod_common *Common
117 ) ;
118 
120  UF_long *, cholmod_common *) ;
121 
122 /* -------------------------------------------------------------------------- */
123 /* cholmod_csymamd */
124 /* -------------------------------------------------------------------------- */
125 
126 /* Order A using CSYMAMD. */
127 
129 (
130  /* ---- input ---- */
131  cholmod_sparse *A, /* matrix to order */
132  /* ---- output --- */
133  int *Cmember, /* size nrow. see cholmod_ccolamd above */
134  int *Perm, /* size A->nrow, output permutation */
135  /* --------------- */
136  cholmod_common *Common
137 ) ;
138 
140  cholmod_common *) ;
141 
142 /* -------------------------------------------------------------------------- */
143 /* cholmod_camd */
144 /* -------------------------------------------------------------------------- */
145 
146 /* Order A using CAMD. */
147 
149 (
150  /* ---- input ---- */
151  cholmod_sparse *A, /* matrix to order */
152  int *fset, /* subset of 0:(A->ncol)-1 */
153  size_t fsize, /* size of fset */
154  /* ---- output --- */
155  int *Cmember, /* size nrow. see cholmod_ccolamd above */
156  int *Perm, /* size A->nrow, output permutation */
157  /* --------------- */
158  cholmod_common *Common
159 ) ;
160 
162  cholmod_common *) ;
163 
164 /* -------------------------------------------------------------------------- */
165 /* cholmod_bisect */
166 /* -------------------------------------------------------------------------- */
167 
168 /* Finds a node bisector of A, A*A', A(:,f)*A(:,f)'. */
169 
170 UF_long amesos_cholmod_bisect /* returns # of nodes in separator */
171 (
172  /* ---- input ---- */
173  cholmod_sparse *A, /* matrix to bisect */
174  int *fset, /* subset of 0:(A->ncol)-1 */
175  size_t fsize, /* size of fset */
176  int compress, /* if TRUE, compress the graph first */
177  /* ---- output --- */
178  int *Partition, /* size A->nrow. Node i is in the left graph if
179  * Partition [i] = 0, the right graph if 1, and in the
180  * separator if 2. */
181  /* --------------- */
182  cholmod_common *Common
183 ) ;
184 
186  cholmod_common *) ;
187 
188 /* -------------------------------------------------------------------------- */
189 /* cholmod_metis_bisector */
190 /* -------------------------------------------------------------------------- */
191 
192 /* Find a set of nodes that bisects the graph of A or AA' (direct interface
193  * to METIS_NodeComputeSeparator). */
194 
195 UF_long amesos_cholmod_metis_bisector /* returns separator size */
196 (
197  /* ---- input ---- */
198  cholmod_sparse *A, /* matrix to bisect */
199  int *Anw, /* size A->nrow, node weights */
200  int *Aew, /* size nz, edge weights */
201  /* ---- output --- */
202  int *Partition, /* size A->nrow. see cholmod_bisect above. */
203  /* --------------- */
204  cholmod_common *Common
205 ) ;
206 
208  UF_long *, cholmod_common *) ;
209 
210 /* -------------------------------------------------------------------------- */
211 /* cholmod_collapse_septree */
212 /* -------------------------------------------------------------------------- */
213 
214 /* Collapse nodes in a separator tree. */
215 
217 (
218  /* ---- input ---- */
219  size_t n, /* # of nodes in the graph */
220  size_t ncomponents, /* # of nodes in the separator tree (must be <= n) */
221  double nd_oksep, /* collapse if #sep >= nd_oksep * #nodes in subtree */
222  size_t nd_small, /* collapse if #nodes in subtree < nd_small */
223  /* ---- in/out --- */
224  int *CParent, /* size ncomponents; from cholmod_nested_dissection */
225  int *Cmember, /* size n; from cholmod_nested_dissection */
226  /* --------------- */
227  cholmod_common *Common
228 ) ;
229 
230 UF_long amesos_cholmod_l_collapse_septree (size_t, size_t, double, size_t, UF_long *,
231  UF_long *, cholmod_common *) ;
232 
233 #endif
UF_long amesos_cholmod_l_metis_bisector(cholmod_sparse *, UF_long *, UF_long *, UF_long *, cholmod_common *)
int amesos_cholmod_camd(cholmod_sparse *A, int *fset, size_t fsize, int *Cmember, int *Perm, cholmod_common *Common)
int amesos_cholmod_l_metis(cholmod_sparse *, UF_long *, size_t, int, UF_long *, cholmod_common *)
int amesos_cholmod_ccolamd(cholmod_sparse *A, int *fset, size_t fsize, int *Cmember, int *Perm, cholmod_common *Common)
int amesos_cholmod_l_ccolamd(cholmod_sparse *, UF_long *, size_t, UF_long *, UF_long *, cholmod_common *)
UF_long amesos_cholmod_l_collapse_septree(size_t, size_t, double, size_t, UF_long *, UF_long *, cholmod_common *)
UF_long amesos_cholmod_metis_bisector(cholmod_sparse *A, int *Anw, int *Aew, int *Partition, cholmod_common *Common)
UF_long amesos_cholmod_l_nested_dissection(cholmod_sparse *, UF_long *, size_t, UF_long *, UF_long *, UF_long *, cholmod_common *)
UF_long amesos_cholmod_l_bisect(cholmod_sparse *, UF_long *, size_t, int, UF_long *, cholmod_common *)
int amesos_cholmod_l_camd(cholmod_sparse *, UF_long *, size_t, UF_long *, UF_long *, cholmod_common *)
UF_long amesos_cholmod_nested_dissection(cholmod_sparse *A, int *fset, size_t fsize, int *Perm, int *CParent, int *Cmember, cholmod_common *Common)
UF_long amesos_cholmod_collapse_septree(size_t n, size_t ncomponents, double nd_oksep, size_t nd_small, int *CParent, int *Cmember, cholmod_common *Common)
int amesos_cholmod_l_csymamd(cholmod_sparse *, UF_long *, UF_long *, cholmod_common *)
int amesos_cholmod_csymamd(cholmod_sparse *A, int *Cmember, int *Perm, cholmod_common *Common)
UF_long amesos_cholmod_bisect(cholmod_sparse *A, int *fset, size_t fsize, int compress, int *Partition, cholmod_common *Common)
int amesos_cholmod_metis(cholmod_sparse *A, int *fset, size_t fsize, int postorder, int *Perm, cholmod_common *Common)
#define UF_long