lsd_mkb/lsd_mkb_superlu/superlu_threads/colamd.c File Reference

#include <limits.h>
#include <math.h>
#include "colamd.h"
#include <stdio.h>
#include <assert.h>
Include dependency graph for colamd.c:

Classes

struct  Colamd_Col_struct
struct  Colamd_Row_struct

Defines

#define PUBLIC
#define PRIVATE   static
#define DENSE_DEGREE(alpha, n)   ((Int) MAX (16.0, (alpha) * sqrt ((double) (n))))
#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
#define ONES_COMPLEMENT(r)   (-(r)-1)
#define EMPTY   (-1)
#define ALIVE   (0)
#define DEAD   (-1)
#define DEAD_PRINCIPAL   (-1)
#define DEAD_NON_PRINCIPAL   (-2)
#define ROW_IS_DEAD(r)   ROW_IS_MARKED_DEAD (Row[r].shared2.mark)
#define ROW_IS_MARKED_DEAD(row_mark)   (row_mark < ALIVE)
#define ROW_IS_ALIVE(r)   (Row [r].shared2.mark >= ALIVE)
#define COL_IS_DEAD(c)   (Col [c].start < ALIVE)
#define COL_IS_ALIVE(c)   (Col [c].start >= ALIVE)
#define COL_IS_DEAD_PRINCIPAL(c)   (Col [c].start == DEAD_PRINCIPAL)
#define KILL_ROW(r)   { Row [r].shared2.mark = DEAD ; }
#define KILL_PRINCIPAL_COL(c)   { Col [c].start = DEAD_PRINCIPAL ; }
#define KILL_NON_PRINCIPAL_COL(c)   { Col [c].start = DEAD_NON_PRINCIPAL ; }
#define INDEX(i)   (i)
#define DEBUG0(params)   { SUITESPARSE_PRINTF (params) ; }
#define DEBUG1(params)   { if (colamd_debug >= 1) SUITESPARSE_PRINTF (params) ; }
#define DEBUG2(params)   { if (colamd_debug >= 2) SUITESPARSE_PRINTF (params) ; }
#define DEBUG3(params)   { if (colamd_debug >= 3) SUITESPARSE_PRINTF (params) ; }
#define DEBUG4(params)   { if (colamd_debug >= 4) SUITESPARSE_PRINTF (params) ; }
#define ASSERT(expression)   (assert (expression))
#define COLAMD_C(n_col, ok)   ((t_mult (t_add (n_col, 1, ok), sizeof (Colamd_Col), ok) / sizeof (Int)))
#define COLAMD_R(n_row, ok)   ((t_mult (t_add (n_row, 1, ok), sizeof (Colamd_Row), ok) / sizeof (Int)))

Typedefs

typedef struct Colamd_Col_struct Colamd_Col
typedef struct Colamd_Row_struct Colamd_Row

Functions

PRIVATE Int init_rows_cols (Int n_row, Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int A[], Int p[], Int stats[COLAMD_STATS])
PRIVATE void init_scoring (Int n_row, Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int A[], Int head[], double knobs[COLAMD_KNOBS], Int *p_n_row2, Int *p_n_col2, Int *p_max_deg)
PRIVATE Int find_ordering (Int n_row, Int n_col, Int Alen, Colamd_Row Row[], Colamd_Col Col[], Int A[], Int head[], Int n_col2, Int max_deg, Int pfree, Int aggressive)
PRIVATE void order_children (Int n_col, Colamd_Col Col[], Int p[])
PRIVATE void detect_super_cols (Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int A[], Int head[], Int row_start, Int row_length)
PRIVATE Int garbage_collection (Int n_row, Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int A[], Int *pfree)
PRIVATE Int clear_mark (Int tag_mark, Int max_mark, Int n_row, Colamd_Row Row[])
PRIVATE void print_report (char *method, Int stats[COLAMD_STATS])
PRIVATE void colamd_get_debug (char *method)
PRIVATE void debug_deg_lists (Int n_row, Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int head[], Int min_score, Int should, Int max_deg)
PRIVATE void debug_mark (Int n_row, Colamd_Row Row[], Int tag_mark, Int max_mark)
PRIVATE void debug_matrix (Int n_row, Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int A[])
PRIVATE void debug_structures (Int n_row, Int n_col, Colamd_Row Row[], Colamd_Col Col[], Int A[], Int n_col2)
PUBLIC size_t COLAMD_recommended (Int nnz, Int n_row, Int n_col)
PUBLIC void COLAMD_set_defaults (double knobs[COLAMD_KNOBS])
PUBLIC Int SYMAMD_MAIN (Int n, Int A[], Int p[], Int perm[], double knobs[COLAMD_KNOBS], Int stats[COLAMD_STATS], void *(*allocate)(size_t, size_t), void(*release)(void *))
PUBLIC Int COLAMD_MAIN (Int n_row, Int n_col, Int Alen, Int A[], Int p[], double knobs[COLAMD_KNOBS], Int stats[COLAMD_STATS])

Variables

PRIVATE Int colamd_debug = 0

Define Documentation

#define ALIVE   (0)
#define ASSERT ( expression   )     (assert (expression))
#define COL_IS_ALIVE (  )     (Col [c].start >= ALIVE)
#define COL_IS_DEAD (  )     (Col [c].start < ALIVE)
#define COL_IS_DEAD_PRINCIPAL (  )     (Col [c].start == DEAD_PRINCIPAL)
#define COLAMD_C ( n_col,
ok   )     ((t_mult (t_add (n_col, 1, ok), sizeof (Colamd_Col), ok) / sizeof (Int)))
#define COLAMD_R ( n_row,
ok   )     ((t_mult (t_add (n_row, 1, ok), sizeof (Colamd_Row), ok) / sizeof (Int)))
#define DEAD   (-1)
#define DEAD_NON_PRINCIPAL   (-2)
#define DEAD_PRINCIPAL   (-1)
#define DEBUG0 ( params   )     { SUITESPARSE_PRINTF (params) ; }
#define DEBUG1 ( params   )     { if (colamd_debug >= 1) SUITESPARSE_PRINTF (params) ; }
#define DEBUG2 ( params   )     { if (colamd_debug >= 2) SUITESPARSE_PRINTF (params) ; }
#define DEBUG3 ( params   )     { if (colamd_debug >= 3) SUITESPARSE_PRINTF (params) ; }
#define DEBUG4 ( params   )     { if (colamd_debug >= 4) SUITESPARSE_PRINTF (params) ; }
#define DENSE_DEGREE ( alpha,
 )     ((Int) MAX (16.0, (alpha) * sqrt ((double) (n))))
#define EMPTY   (-1)
#define INDEX (  )     (i)
#define KILL_NON_PRINCIPAL_COL (  )     { Col [c].start = DEAD_NON_PRINCIPAL ; }
#define KILL_PRINCIPAL_COL (  )     { Col [c].start = DEAD_PRINCIPAL ; }
#define KILL_ROW (  )     { Row [r].shared2.mark = DEAD ; }
#define MAX ( a,
 )     (((a) > (b)) ? (a) : (b))
#define MIN ( a,
 )     (((a) < (b)) ? (a) : (b))
#define ONES_COMPLEMENT (  )     (-(r)-1)
#define PRIVATE   static
#define PUBLIC
#define ROW_IS_ALIVE (  )     (Row [r].shared2.mark >= ALIVE)
#define ROW_IS_DEAD (  )     ROW_IS_MARKED_DEAD (Row[r].shared2.mark)
#define ROW_IS_MARKED_DEAD ( row_mark   )     (row_mark < ALIVE)

Typedef Documentation

typedef struct Colamd_Col_struct Colamd_Col
typedef struct Colamd_Row_struct Colamd_Row

Function Documentation

PRIVATE Int clear_mark ( Int  tag_mark,
Int  max_mark,
Int  n_row,
Colamd_Row  Row[] 
)
PRIVATE void colamd_get_debug ( char *  method  ) 
PUBLIC Int COLAMD_MAIN ( Int  n_row,
Int  n_col,
Int  Alen,
Int  A[],
Int  p[],
double  knobs[COLAMD_KNOBS],
Int  stats[COLAMD_STATS] 
)

Here is the call graph for this function:

PUBLIC size_t COLAMD_recommended ( Int  nnz,
Int  n_row,
Int  n_col 
)
PUBLIC void COLAMD_set_defaults ( double  knobs[COLAMD_KNOBS]  ) 
PRIVATE void debug_deg_lists ( Int  n_row,
Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  head[],
Int  min_score,
Int  should,
Int  max_deg 
)
PRIVATE void debug_mark ( Int  n_row,
Colamd_Row  Row[],
Int  tag_mark,
Int  max_mark 
)
PRIVATE void debug_matrix ( Int  n_row,
Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[] 
)
PRIVATE void debug_structures ( Int  n_row,
Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[],
Int  n_col2 
)
PRIVATE void detect_super_cols ( Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[],
Int  head[],
Int  row_start,
Int  row_length 
)
PRIVATE Int find_ordering ( Int  n_row,
Int  n_col,
Int  Alen,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[],
Int  head[],
Int  n_col2,
Int  max_deg,
Int  pfree,
Int  aggressive 
)

Here is the call graph for this function:

PRIVATE Int garbage_collection ( Int  n_row,
Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[],
Int *  pfree 
)
PRIVATE Int init_rows_cols ( Int  n_row,
Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[],
Int  p[],
Int  stats[COLAMD_STATS] 
)
PRIVATE void init_scoring ( Int  n_row,
Int  n_col,
Colamd_Row  Row[],
Colamd_Col  Col[],
Int  A[],
Int  head[],
double  knobs[COLAMD_KNOBS],
Int *  p_n_row2,
Int *  p_n_col2,
Int *  p_max_deg 
)

Here is the call graph for this function:

PRIVATE void order_children ( Int  n_col,
Colamd_Col  Col[],
Int  p[] 
)
PRIVATE void print_report ( char *  method,
Int  stats[COLAMD_STATS] 
)
PUBLIC Int SYMAMD_MAIN ( Int  n,
Int  A[],
Int  p[],
Int  perm[],
double  knobs[COLAMD_KNOBS],
Int  stats[COLAMD_STATS],
void *(*)(size_t, size_t)  allocate,
void(*)(void *)  release 
)

Here is the call graph for this function:


Variable Documentation

PRIVATE Int colamd_debug = 0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 3 Jun 2020 for ModFEM by  doxygen 1.6.1