00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CCOLAMD_H
00018 #define CCOLAMD_H
00019
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00025
00026 #include <stdlib.h>
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #define CCOLAMD_DATE "Nov 1, 2007"
00047 #define CCOLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
00048 #define CCOLAMD_MAIN_VERSION 2
00049 #define CCOLAMD_SUB_VERSION 7
00050 #define CCOLAMD_SUBSUB_VERSION 1
00051 #define CCOLAMD_VERSION \
00052 CCOLAMD_VERSION_CODE(CCOLAMD_MAIN_VERSION,CCOLAMD_SUB_VERSION)
00053
00054
00055
00056
00057
00058
00059 #define CCOLAMD_KNOBS 20
00060
00061
00062 #define CCOLAMD_STATS 20
00063
00064
00065 #define CCOLAMD_DENSE_ROW 0
00066
00067
00068 #define CCOLAMD_DENSE_COL 1
00069
00070
00071 #define CCOLAMD_AGGRESSIVE 2
00072
00073
00074 #define CCOLAMD_LU 3
00075
00076
00077 #define CCOLAMD_DEFRAG_COUNT 2
00078
00079
00080 #define CCOLAMD_STATUS 3
00081
00082
00083 #define CCOLAMD_INFO1 4
00084 #define CCOLAMD_INFO2 5
00085 #define CCOLAMD_INFO3 6
00086
00087
00088 #define CCOLAMD_EMPTY_ROW 7
00089
00090 #define CCOLAMD_EMPTY_COL 8
00091
00092 #define CCOLAMD_NEWLY_EMPTY_ROW 9
00093
00094 #define CCOLAMD_NEWLY_EMPTY_COL 10
00095
00096
00097 #define CCOLAMD_OK (0)
00098 #define CCOLAMD_OK_BUT_JUMBLED (1)
00099 #define CCOLAMD_ERROR_A_not_present (-1)
00100 #define CCOLAMD_ERROR_p_not_present (-2)
00101 #define CCOLAMD_ERROR_nrow_negative (-3)
00102 #define CCOLAMD_ERROR_ncol_negative (-4)
00103 #define CCOLAMD_ERROR_nnz_negative (-5)
00104 #define CCOLAMD_ERROR_p0_nonzero (-6)
00105 #define CCOLAMD_ERROR_A_too_small (-7)
00106 #define CCOLAMD_ERROR_col_length_negative (-8)
00107 #define CCOLAMD_ERROR_row_index_out_of_bounds (-9)
00108 #define CCOLAMD_ERROR_out_of_memory (-10)
00109 #define CCOLAMD_ERROR_invalid_cmember (-11)
00110 #define CCOLAMD_ERROR_internal_error (-999)
00111
00112
00113
00114
00115
00116
00117 #include "UFconfig.h"
00118
00119 size_t ccolamd_recommended
00120
00121 (
00122 int nnz,
00123 int n_row,
00124 int n_col
00125 ) ;
00126
00127 size_t ccolamd_l_recommended
00128
00129 (
00130 UF_long nnz,
00131 UF_long n_row,
00132 UF_long n_col
00133 ) ;
00134
00135 void ccolamd_set_defaults
00136 (
00137 double knobs [CCOLAMD_KNOBS]
00138 ) ;
00139
00140 void ccolamd_l_set_defaults
00141 (
00142 double knobs [CCOLAMD_KNOBS]
00143 ) ;
00144
00145 int ccolamd
00146 (
00147 int n_row,
00148 int n_col,
00149 int Alen,
00150 int A [ ],
00151 int p [ ],
00152 double knobs [CCOLAMD_KNOBS],
00153 int stats [CCOLAMD_STATS],
00154 int cmember [ ]
00155 ) ;
00156
00157 UF_long ccolamd_l
00158 (
00159 UF_long n_row,
00160 UF_long n_col,
00161 UF_long Alen,
00162 UF_long A [ ],
00163 UF_long p [ ],
00164 double knobs [CCOLAMD_KNOBS],
00165 UF_long stats [CCOLAMD_STATS],
00166 UF_long cmember [ ]
00167 ) ;
00168
00169 int csymamd
00170 (
00171 int n,
00172 int A [ ],
00173 int p [ ],
00174 int perm [ ],
00175 double knobs [CCOLAMD_KNOBS],
00176 int stats [CCOLAMD_STATS],
00177 void * (*allocate) (size_t, size_t),
00178
00179 void (*release) (void *),
00180
00181 int cmember [ ],
00182 int stype
00183 ) ;
00184
00185 UF_long csymamd_l
00186 (
00187 UF_long n,
00188 UF_long A [ ],
00189 UF_long p [ ],
00190 UF_long perm [ ],
00191 double knobs [CCOLAMD_KNOBS],
00192 UF_long stats [CCOLAMD_STATS],
00193 void * (*allocate) (size_t, size_t),
00194 void (*release) (void *),
00195 UF_long cmember [ ],
00196 UF_long stype
00197 ) ;
00198
00199 void ccolamd_report
00200 (
00201 int stats [CCOLAMD_STATS]
00202 ) ;
00203
00204 void ccolamd_l_report
00205 (
00206 UF_long stats [CCOLAMD_STATS]
00207 ) ;
00208
00209 void csymamd_report
00210 (
00211 int stats [CCOLAMD_STATS]
00212 ) ;
00213
00214 void csymamd_l_report
00215 (
00216 UF_long stats [CCOLAMD_STATS]
00217 ) ;
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 int ccolamd2
00230 (
00231 int n_row,
00232 int n_col,
00233 int Alen,
00234 int A [ ],
00235 int p [ ],
00236 double knobs [CCOLAMD_KNOBS],
00237 int stats [CCOLAMD_STATS],
00238
00239 int Front_npivcol [ ],
00240 int Front_nrows [ ],
00241 int Front_ncols [ ],
00242 int Front_parent [ ],
00243 int Front_cols [ ],
00244 int *p_nfr,
00245 int InFront [ ],
00246 int cmember [ ]
00247 ) ;
00248
00249 UF_long ccolamd2_l
00250 (
00251 UF_long n_row,
00252 UF_long n_col,
00253 UF_long Alen,
00254 UF_long A [ ],
00255 UF_long p [ ],
00256 double knobs [CCOLAMD_KNOBS],
00257 UF_long stats [CCOLAMD_STATS],
00258 UF_long Front_npivcol [ ],
00259 UF_long Front_nrows [ ],
00260 UF_long Front_ncols [ ],
00261 UF_long Front_parent [ ],
00262 UF_long Front_cols [ ],
00263 UF_long *p_nfr,
00264 UF_long InFront [ ],
00265 UF_long cmember [ ]
00266 ) ;
00267
00268 void ccolamd_apply_order
00269 (
00270 int Front [ ],
00271 const int Order [ ],
00272 int Temp [ ],
00273 int nn,
00274 int nfr
00275 ) ;
00276
00277 void ccolamd_l_apply_order
00278 (
00279 UF_long Front [ ],
00280 const UF_long Order [ ],
00281 UF_long Temp [ ],
00282 UF_long nn,
00283 UF_long nfr
00284 ) ;
00285
00286
00287 void ccolamd_fsize
00288 (
00289 int nn,
00290 int MaxFsize [ ],
00291 int Fnrows [ ],
00292 int Fncols [ ],
00293 int Parent [ ],
00294 int Npiv [ ]
00295 ) ;
00296
00297 void ccolamd_l_fsize
00298 (
00299 UF_long nn,
00300 UF_long MaxFsize [ ],
00301 UF_long Fnrows [ ],
00302 UF_long Fncols [ ],
00303 UF_long Parent [ ],
00304 UF_long Npiv [ ]
00305 ) ;
00306
00307 void ccolamd_postorder
00308 (
00309 int nn,
00310 int Parent [ ],
00311 int Npiv [ ],
00312 int Fsize [ ],
00313 int Order [ ],
00314 int Child [ ],
00315 int Sibling [ ],
00316 int Stack [ ],
00317 int Front_cols [ ],
00318 int cmember [ ]
00319 ) ;
00320
00321 void ccolamd_l_postorder
00322 (
00323 UF_long nn,
00324 UF_long Parent [ ],
00325 UF_long Npiv [ ],
00326 UF_long Fsize [ ],
00327 UF_long Order [ ],
00328 UF_long Child [ ],
00329 UF_long Sibling [ ],
00330 UF_long Stack [ ],
00331 UF_long Front_cols [ ],
00332 UF_long cmember [ ]
00333 ) ;
00334
00335 int ccolamd_post_tree
00336 (
00337 int root,
00338 int k,
00339 int Child [ ],
00340 const int Sibling [ ],
00341 int Order [ ],
00342 int Stack [ ]
00343 ) ;
00344
00345 UF_long ccolamd_l_post_tree
00346 (
00347 UF_long root,
00348 UF_long k,
00349 UF_long Child [ ],
00350 const UF_long Sibling [ ],
00351 UF_long Order [ ],
00352 UF_long Stack [ ]
00353 ) ;
00354
00355 #ifndef EXTERN
00356 #define EXTERN extern
00357 #endif
00358
00359 EXTERN int (*ccolamd_printf) (const char *, ...) ;
00360
00361 #ifdef __cplusplus
00362 }
00363 #endif
00364
00365 #endif