29 prow = sm_row_freelist;
56 #if defined(FAST_AND_LOOSE) && ! defined(COLS)
59 prow->
last_col->next_col = sm_element_freelist;
60 sm_element_freelist = prow->first_col;
64 prow->next_row = sm_row_freelist;
65 sm_row_freelist = prow;
69 for(p = prow->first_col; p != 0; p = pnext) {
89 for(p = prow->first_col; p != 0; p = p->next_col) {
109 sorted_insert(
sm_element, prow->first_col, prow->last_col, prow->length,
110 next_col, prev_col, col_num, col, test);
113 if (element != test) {
132 for(p = prow->first_col; p != 0 && p->col_num < col; p = p->next_col)
134 if (p != 0 && p->col_num == col) {
135 dll_unlink(p, prow->first_col, prow->last_col,
136 next_col, prev_col, prow->length);
152 for(p = prow->first_col; p != 0 && p->col_num < col; p = p->next_col)
154 if (p != 0 && p->col_num == col) {
173 if (q2 == 0 || q1->col_num < q2->col_num) {
175 }
else if (q1->col_num == q2->col_num) {
197 if (q1 == 0 || q2 == 0)
return 0;
199 if (q1->col_num < q2->col_num) {
200 if ((q1 = q1->next_col) == 0) {
203 }
else if (q1->col_num > q2->col_num) {
204 if ((q2 = q2->next_col) == 0) {
225 while(q1 != 0 && q2 != 0) {
226 if (q1->col_num != q2->col_num) {
227 return q1->col_num - q2->col_num;
235 }
else if (q2 != 0) {
256 if (q1 == 0 || q2 == 0)
return result;
258 if (q1->col_num < q2->col_num) {
259 if ((q1 = q1->next_col) == 0) {
262 }
else if (q1->col_num > q2->col_num) {
263 if ((q2 = q2->next_col) == 0) {
268 if ((q1 = q1->next_col) == 0) {
271 if ((q2 = q2->next_col) == 0) {
287 for(p = prow->first_col; p != 0; p = p->next_col) {
288 sum = (sum*17 + p->col_num) % modulus;
301 dll_unlink(p, prow->first_col, prow->last_col,
302 next_col, prev_col, prow->length);
314 for(p = prow->
first_col; p != 0; p = p->next_col) {
315 (void) fprintf(fp,
" %d", p->col_num);
void sm_row_remove_element(sm_row *prow, sm_element *p)
#define sm_element_free(e)
sm_element * sm_row_insert(sm_row *prow, int col)
int sm_row_contains(sm_row *p1, sm_row *p2)
int sm_row_compare(sm_row *p1, sm_row *p2)
sm_row * sm_row_dup(sm_row *prow)
#define dll_unlink(p, first, last, next, prev, count)
#define ABC_NAMESPACE_IMPL_END
sm_element * sm_row_find(sm_row *prow, int col)
#define ABC_NAMESPACE_IMPL_START
void sm_row_print(FILE *fp, sm_row *prow)
typedefABC_NAMESPACE_HEADER_START struct sm_element_struct sm_element
int sm_row_hash(sm_row *prow, int modulus)
#define sm_element_alloc(newobj)
ABC_NAMESPACE_IMPL_START sm_row * sm_row_alloc()
void sm_row_free(sm_row *prow)
void sm_row_remove(sm_row *prow, int col)
sm_row * sm_row_and(sm_row *p1, sm_row *p2)
int sm_row_intersects(sm_row *p1, sm_row *p2)