Lines Matching refs:Col
126 #define COL_IS_DEAD(c) (Col [c].start < ALIVE)
127 #define COL_IS_ALIVE(c) (Col [c].start >= ALIVE)
128 #define COL_IS_DEAD_PRINCIPAL(c) (Col [c].start == DEAD_PRINCIPAL)
130 #define KILL_PRINCIPAL_COL(c) { Col [c].start = DEAD_PRINCIPAL ; }
131 #define KILL_NON_PRINCIPAL_COL(c) { Col [c].start = DEAD_NON_PRINCIPAL ; }
147 /* col, if the column is alive */
153 Index score ; /* the score used to maintain heap, if col is alive */
154 Index order ; /* pivot ordering of this column, if col is dead */
158 Index headhash ; /* head of a hash bucket, if col is at the head of */
160 Index hash ; /* hash value, if col is not in a degree list */
161 Index prev ; /* previous column in degree list, if col is in a */
166 Index degree_next ; /* next column, if col is in a degree list */
167 Index hash_next ; /* next column, if col is in a hash list */
175 Index start ; /* index for A of first col in this row */
199 required for the Col and Row arrays, respectively, which are internal to
218 static Index init_rows_cols (Index n_row, Index n_col, Colamd_Row<Index> Row [], colamd_col<Index> col [], Index A [], Index p [], Index stats[COLAMD_STATS] );
221 static void init_scoring (Index n_row, Index n_col, Colamd_Row<Index> Row [], colamd_col<Index> Col [], Index A [], Index head [], double knobs[COLAMD_KNOBS], Index *p_n_row2, Index *p_n_col2, Index *p_max_deg);
224 static Index find_ordering (Index n_row, Index n_col, Index Alen, Colamd_Row<Index> Row [], colamd_col<Index> Col [], Index A [], Index head [], Index n_col2, Index max_deg, Index pfree);
227 static void order_children (Index n_col, colamd_col<Index> Col [], Index p []);
230 static void detect_super_cols (colamd_col<Index> Col [], Index A [], Index head [], Index row_start, Index row_length ) ;
233 static Index garbage_collection (Index n_row, Index n_col, Colamd_Row<Index> Row [], colamd_col<Index> Col [], Index A [], Index *pfree) ;
336 Index Col_size ; /* size of Col [], in integers */
339 colamd_col<Index> *Col ; /* pointer into A of Col [0..n_col] array */
417 /* === Allocate the Row and Col arrays from array A ===================== */
434 Col = (colamd_col<Index> *) &A [Alen] ;
439 if (!Eigen::internal::init_rows_cols (n_row, n_col, Row, Col, A, p, stats))
448 Eigen::internal::init_scoring (n_row, n_col, Row, Col, A, p, knobs,
453 ngarbage = Eigen::internal::find_ordering (n_row, n_col, Alen, Row, Col, A, p,
458 Eigen::internal::order_children (n_col, Col, p) ;
482 matrix. Also, row and column attributes are stored in the Col and Row
496 colamd_col<Index> Col [], /* of size n_col+1 */
504 Index col ; /* a column index */
514 for (col = 0 ; col < n_col ; col++)
516 Col [col].start = p [col] ;
517 Col [col].length = p [col+1] - p [col] ;
519 if (Col [col].length < 0)
523 stats [COLAMD_INFO1] = col ;
524 stats [COLAMD_INFO2] = Col [col].length ;
525 COLAMD_DEBUG0 (("colamd: col %d length %d < 0\n", col, Col [col].length)) ;
529 Col [col].shared1.thickness = 1 ;
530 Col [col].shared2.score = 0 ;
531 Col [col].shared3.prev = COLAMD_EMPTY ;
532 Col [col].shared4.degree_next = COLAMD_EMPTY ;
547 for (col = 0 ; col < n_col ; col++)
551 cp = &A [p [col]] ;
552 cp_end = &A [p [col+1]] ;
562 stats [COLAMD_INFO1] = col ;
565 COLAMD_DEBUG0 (("colamd: row %d col %d out of bounds\n", row, col)) ;
569 if (row <= last_row || Row [row].shared2.mark == col)
571 /* row index are unsorted or repeated (or both), thus col */
574 stats [COLAMD_INFO1] = col ;
577 COLAMD_DEBUG1 (("colamd: row %d col %d unsorted/duplicate\n",row,col));
580 if (Row [row].shared2.mark != col)
588 Col [col].length-- ;
592 Row [row].shared2.mark = col ;
617 for (col = 0 ; col < n_col ; col++)
619 cp = &A [p [col]] ;
620 cp_end = &A [p [col+1]] ;
624 if (Row [row].shared2.mark != col)
626 A [(Row [row].shared1.p)++] = col ;
627 Row [row].shared2.mark = col ;
635 for (col = 0 ; col < n_col ; col++)
637 cp = &A [p [col]] ;
638 cp_end = &A [p [col+1]] ;
641 A [(Row [*cp++].shared1.p)++] = col ;
661 /* === Compute col pointers ========================================= */
663 /* col form of the matrix starts at A [0]. */
664 /* Note, we may have a gap between the col form and the row */
667 Col [0].start = 0 ;
668 p [0] = Col [0].start ;
669 for (col = 1 ; col < n_col ; col++)
673 Col [col].start = Col [col-1].start + Col [col-1].length ;
674 p [col] = Col [col].start ;
677 /* === Re-create col form =========================================== */
712 colamd_col<Index> Col [], /* of size n_col+1 */
755 deg = Col [c].length ;
759 Col [c].shared2.order = --n_col2 ;
775 deg = Col [c].length ;
779 Col [c].shared2.order = --n_col2 ;
781 cp = &A [Col [c].start] ;
782 cp_end = cp + Col [c].length ;
828 cp = &A [Col [c].start] ;
830 cp_end = cp + Col [c].length ;
848 col_length = (Index) (new_cp - &A [Col [c].start]) ;
851 /* a newly-made null column (all rows in this col are "dense" */
854 Col [c].shared2.order = --n_col2 ;
862 Col [c].length = col_length ;
863 Col [c].shared2.score = score ;
891 c, Col [c].shared2.score, min_score, n_col)) ;
895 score = Col [c].shared2.score ;
905 Col [c].shared3.prev = COLAMD_EMPTY ;
906 Col [c].shared4.degree_next = next_col ;
912 Col [next_col].shared3.prev = c ;
950 colamd_col<Index> Col [], /* of size n_col+1 */
975 Index col ; /* a column index */
987 Index pivot_col_thickness ; /* number of columns represented by pivot col */
1020 next_col = Col [pivot_col].shared4.degree_next ;
1024 Col [next_col].shared3.prev = COLAMD_EMPTY ;
1028 COLAMD_DEBUG3 (("Pivot col: %d\n", pivot_col)) ;
1031 pivot_col_score = Col [pivot_col].shared2.score ;
1034 Col [pivot_col].shared2.order = k ;
1037 pivot_col_thickness = Col [pivot_col].shared1.thickness ;
1046 pfree = Eigen::internal::garbage_collection (n_row, n_col, Row, Col, A, &A [pfree]) ;
1065 Col [pivot_col].shared1.thickness = -pivot_col_thickness ;
1068 cp = &A [Col [pivot_col].start] ;
1069 cp_end = cp + Col [pivot_col].length ;
1074 COLAMD_DEBUG4 (("Pivot col pattern %d %d\n", ROW_IS_ALIVE (row), row)) ;
1085 col = *rp++ ;
1087 col_thickness = Col [col].shared1.thickness ;
1088 if (col_thickness > 0 && COL_IS_ALIVE (col))
1091 Col [col].shared1.thickness = -col_thickness ;
1094 A [pfree++] = col ;
1101 Col [pivot_col].shared1.thickness = pivot_col_thickness ;
1108 cp = &A [Col [pivot_col].start] ;
1109 cp_end = cp + Col [pivot_col].length ;
1114 COLAMD_DEBUG3 (("Kill row in pivot col: %d\n", row)) ;
1123 /* pick the "pivot" row arbitrarily (first row in col) */
1124 pivot_row = A [Col [pivot_col].start] ;
1133 COLAMD_ASSERT (Col [pivot_col].length > 0 || pivot_row_length == 0) ;
1166 col = *rp++ ;
1167 COLAMD_ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ;
1168 COLAMD_DEBUG3 (("Col: %d\n", col)) ;
1171 col_thickness = -Col [col].shared1.thickness ;
1173 Col [col].shared1.thickness = col_thickness ;
1177 cur_score = Col [col].shared2.score ;
1178 prev_col = Col [col].shared3.prev ;
1179 next_col = Col [col].shared4.degree_next ;
1189 Col [prev_col].shared4.degree_next = next_col ;
1193 Col [next_col].shared3.prev = prev_col ;
1198 cp = &A [Col [col].start] ;
1199 cp_end = cp + Col [col].length ;
1246 col = *rp++ ;
1247 COLAMD_ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ;
1250 cp = &A [Col [col].start] ;
1253 cp_end = cp + Col [col].length ;
1255 COLAMD_DEBUG4 (("Adding set diffs for Col: %d.\n", col)) ;
1280 Col [col].length = (Index) (new_cp - &A [Col [col].start]) ;
1284 if (Col [col].length == 0)
1286 COLAMD_DEBUG4 (("further mass elimination. Col: %d\n", col)) ;
1288 KILL_PRINCIPAL_COL (col) ;
1289 pivot_row_degree -= Col [col].shared1.thickness ;
1292 Col [col].shared2.order = k ;
1294 k += Col [col].shared1.thickness ;
1300 COLAMD_DEBUG4 (("Preparing supercol detection for Col: %d.\n", col)) ;
1303 Col [col].shared2.score = cur_score ;
1316 first_col = Col [head_column].shared3.headhash ;
1317 Col [head_column].shared3.headhash = col ;
1323 head [hash] = - (col + 2) ;
1325 Col [col].shared4.hash_next = first_col ;
1327 /* save hash function in Col [col].shared3.hash */
1328 Col [col].shared3.hash = (Index) hash ;
1329 COLAMD_ASSERT (COL_IS_ALIVE (col)) ;
1339 Eigen::internal::detect_super_cols (Col, A, head, pivot_row_start, pivot_row_length) ;
1365 col = *rp++ ;
1367 if (COL_IS_DEAD (col))
1371 *new_rp++ = col ;
1373 A [Col [col].start + (Col [col].length++)] = pivot_row ;
1378 cur_score = Col [col].shared2.score + pivot_row_degree ;
1383 max_score = n_col - k - Col [col].shared1.thickness ;
1386 cur_score -= Col [col].shared1.thickness ;
1393 Col [col].shared2.score = cur_score ;
1403 Col [col].shared4.degree_next = next_col ;
1404 Col [col].shared3.prev = COLAMD_EMPTY ;
1407 Col [next_col].shared3.prev = col ;
1409 head [cur_score] = col ;
1421 /* during super-col detection and mass elimination */
1458 colamd_col<Index> Col [], /* of size n_col+1 */
1475 if (!COL_IS_DEAD_PRINCIPAL (i) && Col [i].shared2.order == COLAMD_EMPTY)
1481 parent = Col [parent].shared1.parent ;
1488 order = Col [parent].shared2.order ;
1492 COLAMD_ASSERT (Col [c].shared2.order == COLAMD_EMPTY) ;
1495 Col [c].shared2.order = order++ ;
1497 Col [c].shared1.parent = parent ;
1500 c = Col [c].shared1.parent ;
1505 } while (Col [c].shared2.order == COLAMD_EMPTY) ;
1508 Col [parent].shared2.order = order ;
1516 p [Col [c].shared2.order] = c ;
1537 Col [head [h]].headhash gives the first column in hash bucket h.
1543 For a column c in a hash bucket, Col [c].shared3.prev is NOT a "previous
1544 column" pointer. Col [c].shared3.hash is used instead as the hash number
1545 for that column. The value of Col [c].shared4.hash_next is the next column
1558 colamd_col<Index> Col [], /* of size n_col+1 */
1577 Index col ; /* a column index in the row to check */
1587 col = *rp++ ;
1588 if (COL_IS_DEAD (col))
1594 hash = Col [col].shared3.hash ;
1602 first_col = Col [head_column].shared3.headhash ;
1612 super_c = Col [super_c].shared4.hash_next)
1615 COLAMD_ASSERT (Col [super_c].shared3.hash == hash) ;
1616 length = Col [super_c].length ;
1623 for (c = Col [super_c].shared4.hash_next ;
1624 c != COLAMD_EMPTY ; c = Col [c].shared4.hash_next)
1628 COLAMD_ASSERT (Col [c].shared3.hash == hash) ;
1631 if (Col [c].length != length ||
1632 Col [c].shared2.score != Col [super_c].shared2.score)
1639 cp1 = &A [Col [super_c].start] ;
1640 cp2 = &A [Col [c].start] ;
1664 COLAMD_ASSERT (Col [c].shared2.score == Col [super_c].shared2.score) ;
1666 Col [super_c].shared1.thickness += Col [c].shared1.thickness ;
1667 Col [c].shared1.parent = super_c ;
1670 Col [c].shared2.order = COLAMD_EMPTY ;
1672 Col [prev_c].shared4.hash_next = Col [c].shared4.hash_next ;
1681 Col [head_column].shared3.headhash = COLAMD_EMPTY ;
1712 colamd_col<Index> Col [], /* column info */
1733 psrc = &A [Col [c].start] ;
1737 Col [c].start = (Index) (pdest - &A [0]) ;
1738 length = Col [c].length ;
1747 Col [c].length = (Index) (pdest - &A [Col [c].start]) ;