Blender  V2.59
Classes | Defines | Typedefs | Functions
colamd.c File Reference
#include <limits.h>
#include "colamd.h"
#include <assert.h>

Go to the source code of this file.

Classes

struct  ColInfo_struct
struct  RowInfo_struct

Defines

#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
#define ONES_COMPLEMENT(r)   (-(r)-1)
#define TRUE   (1)
#define FALSE   (0)
#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 PUBLIC
#define PRIVATE   static
#define DEBUG0(params)   ;
#define DEBUG1(params)   ;
#define DEBUG2(params)   ;
#define DEBUG3(params)   ;
#define DEBUG4(params)   ;

Typedefs

typedef struct ColInfo_struct ColInfo
typedef struct RowInfo_struct RowInfo

Functions

PRIVATE int init_rows_cols (int n_row, int n_col, RowInfo Row[], ColInfo Col[], int A[], int p[])
PRIVATE void init_scoring (int n_row, int n_col, RowInfo Row[], ColInfo 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, RowInfo Row[], ColInfo Col[], int A[], int head[], int n_col2, int max_deg, int pfree)
PRIVATE void order_children (int n_col, ColInfo Col[], int p[])
PRIVATE void detect_super_cols (ColInfo Col[], int A[], int head[], int row_start, int row_length)
PRIVATE int garbage_collection (int n_row, int n_col, RowInfo Row[], ColInfo Col[], int A[], int *pfree)
PRIVATE int clear_mark (int n_row, RowInfo Row[])
PUBLIC int colamd_recommended (int nnz, int n_row, int n_col)
PUBLIC void colamd_set_defaults (double knobs[COLAMD_KNOBS])
PUBLIC int colamd (int n_row, int n_col, int Alen, int A[], int p[], double knobs[COLAMD_KNOBS])

Detailed Description

Definition in file colamd.c.


Define Documentation

#define ALIVE   (0)

Definition at line 356 of file colamd.c.

#define COL_IS_ALIVE (   c)    (Col [c].start >= ALIVE)

Definition at line 368 of file colamd.c.

Referenced by detect_super_cols(), find_ordering(), garbage_collection(), and init_scoring().

#define COL_IS_DEAD (   c)    (Col [c].start < ALIVE)

Definition at line 367 of file colamd.c.

Referenced by detect_super_cols(), find_ordering(), init_scoring(), and order_children().

#define COL_IS_DEAD_PRINCIPAL (   c)    (Col [c].start == DEAD_PRINCIPAL)

Definition at line 369 of file colamd.c.

Referenced by order_children().

#define DEAD   (-1)

Definition at line 357 of file colamd.c.

#define DEAD_NON_PRINCIPAL   (-2)

Definition at line 361 of file colamd.c.

#define DEAD_PRINCIPAL   (-1)

Definition at line 360 of file colamd.c.

#define DEBUG0 (   params)    ;
#define DEBUG1 (   params)    ;

Definition at line 525 of file colamd.c.

Referenced by find_ordering().

#define DEBUG2 (   params)    ;

Definition at line 526 of file colamd.c.

Referenced by find_ordering().

#define DEBUG3 (   params)    ;

Definition at line 527 of file colamd.c.

Referenced by find_ordering().

#define DEBUG4 (   params)    ;

Definition at line 528 of file colamd.c.

Referenced by find_ordering(), and init_scoring().

#define EMPTY   (-1)
#define FALSE   (0)

Definition at line 352 of file colamd.c.

Referenced by colamd(), and init_rows_cols().

#define KILL_NON_PRINCIPAL_COL (   c)    { Col [c].start = DEAD_NON_PRINCIPAL ; }

Definition at line 372 of file colamd.c.

Referenced by detect_super_cols().

#define KILL_PRINCIPAL_COL (   c)    { Col [c].start = DEAD_PRINCIPAL ; }

Definition at line 371 of file colamd.c.

Referenced by find_ordering(), and init_scoring().

#define KILL_ROW (   r)    { Row [r].shared2.mark = DEAD ; }

Definition at line 370 of file colamd.c.

Referenced by find_ordering(), garbage_collection(), and init_scoring().

#define MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 346 of file colamd.c.

#define MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 347 of file colamd.c.

#define ONES_COMPLEMENT (   r)    (-(r)-1)

Definition at line 349 of file colamd.c.

Referenced by garbage_collection().

#define PRIVATE   static

Definition at line 376 of file colamd.c.

#define PUBLIC

Definition at line 375 of file colamd.c.

#define ROW_IS_ALIVE (   r)    (Row [r].shared2.mark >= ALIVE)

Definition at line 366 of file colamd.c.

Referenced by clear_mark(), detect_super_cols(), find_ordering(), and garbage_collection().

#define ROW_IS_DEAD (   r)    ROW_IS_MARKED_DEAD (Row[r].shared2.mark)

Definition at line 364 of file colamd.c.

Referenced by find_ordering(), and init_scoring().

#define ROW_IS_MARKED_DEAD (   row_mark)    (row_mark < ALIVE)

Definition at line 365 of file colamd.c.

Referenced by find_ordering().

#define TRUE   (1)

Definition at line 351 of file colamd.c.

Referenced by colamd(), and init_rows_cols().


Typedef Documentation

typedef struct ColInfo_struct ColInfo
typedef struct RowInfo_struct RowInfo

Function Documentation

PRIVATE int clear_mark ( int  n_row,
RowInfo  Row[] 
)

Definition at line 2280 of file colamd.c.

References DEBUG0, and ROW_IS_ALIVE.

Referenced by find_ordering().

PUBLIC int colamd ( int  n_row,
int  n_col,
int  Alen,
int  A[],
int  p[],
double  knobs[COLAMD_KNOBS] 
)
PUBLIC int colamd_recommended ( int  nnz,
int  n_row,
int  n_col 
)

Definition at line 551 of file colamd.c.

References COLAMD_STATS, and DEBUG0.

Referenced by get_colamd().

PUBLIC void colamd_set_defaults ( double  knobs[COLAMD_KNOBS])

Definition at line 606 of file colamd.c.

References COLAMD_DENSE_COL, COLAMD_DENSE_ROW, COLAMD_KNOBS, and i.

Referenced by colamd(), and get_colamd().

PRIVATE void detect_super_cols ( ColInfo  Col[],
int  A[],
int  head[],
int  row_start,
int  row_length 
)

Definition at line 1992 of file colamd.c.

References assert, COL_IS_ALIVE, COL_IS_DEAD, EMPTY, hash, i, KILL_NON_PRINCIPAL_COL, length(), and ROW_IS_ALIVE.

Referenced by find_ordering().

PRIVATE int find_ordering ( int  n_row,
int  n_col,
int  Alen,
RowInfo  Row[],
ColInfo  Col[],
int  A[],
int  head[],
int  n_col2,
int  max_deg,
int  pfree 
)
PRIVATE int garbage_collection ( int  n_row,
int  n_col,
RowInfo  Row[],
ColInfo  Col[],
int  A[],
int *  pfree 
)

Definition at line 2148 of file colamd.c.

References assert, COL_IS_ALIVE, DEBUG0, KILL_ROW, length(), ONES_COMPLEMENT, and ROW_IS_ALIVE.

Referenced by find_ordering().

PRIVATE int init_rows_cols ( int  n_row,
int  n_col,
RowInfo  Row[],
ColInfo  Col[],
int  A[],
int  p[] 
)

Definition at line 845 of file colamd.c.

References assert, DEBUG0, EMPTY, FALSE, and TRUE.

Referenced by colamd().

PRIVATE void init_scoring ( int  n_row,
int  n_col,
RowInfo  Row[],
ColInfo  Col[],
int  A[],
int  head[],
double  knobs[COLAMD_KNOBS],
int *  p_n_row2,
int *  p_n_col2,
int *  p_max_deg 
)
PRIVATE void order_children ( int  n_col,
ColInfo  Col[],
int  p[] 
)