29 pcol = sm_col_freelist;
56 #if defined(FAST_AND_LOOSE) && ! defined(COLS)
59 pcol->
last_row->next_row = sm_element_freelist;
60 sm_element_freelist = pcol->first_row;
64 pcol->next_col = sm_col_freelist;
65 sm_col_freelist = pcol;
69 for(p = pcol->first_row; p != 0; p = pnext) {
89 for(p = pcol->first_row; p != 0; p = p->next_row) {
109 sorted_insert(
sm_element, pcol->first_row, pcol->last_row, pcol->length,
110 next_row, prev_row, row_num, row, test);
113 if (element != test) {
132 for(p = pcol->first_row; p != 0 && p->row_num < row; p = p->next_row)
134 if (p != 0 && p->row_num == row) {
135 dll_unlink(p, pcol->first_row, pcol->last_row,
136 next_row, prev_row, pcol->length);
152 for(p = pcol->first_row; p != 0 && p->row_num < row; p = p->next_row)
154 if (p != 0 && p->row_num == row) {
173 if (q2 == 0 || q1->row_num < q2->row_num) {
175 }
else if (q1->row_num == q2->row_num) {
197 if (q1 == 0 || q2 == 0)
return 0;
199 if (q1->row_num < q2->row_num) {
200 if ((q1 = q1->next_row) == 0) {
203 }
else if (q1->row_num > q2->row_num) {
204 if ((q2 = q2->next_row) == 0) {
225 while(q1 != 0 && q2 != 0) {
226 if (q1->row_num != q2->row_num) {
227 return q1->row_num - q2->row_num;
235 }
else if (q2 != 0) {
256 if (q1 == 0 || q2 == 0)
return result;
258 if (q1->row_num < q2->row_num) {
259 if ((q1 = q1->next_row) == 0) {
262 }
else if (q1->row_num > q2->row_num) {
263 if ((q2 = q2->next_row) == 0) {
268 if ((q1 = q1->next_row) == 0) {
271 if ((q2 = q2->next_row) == 0) {
287 for(p = pcol->first_row; p != 0; p = p->next_row) {
288 sum = (sum*17 + p->row_num) % modulus;
301 dll_unlink(p, pcol->first_row, pcol->last_row,
302 next_row, prev_row, pcol->length);
314 for(p = pcol->
first_row; p != 0; p = p->next_row) {
315 (void) fprintf(fp,
" %d", p->row_num);
sm_col * sm_col_and(sm_col *p1, sm_col *p2)
sm_col * sm_col_dup(sm_col *pcol)
#define sm_element_free(e)
int sm_col_compare(sm_col *p1, sm_col *p2)
int sm_col_hash(sm_col *pcol, int modulus)
void sm_col_remove(sm_col *pcol, int row)
#define dll_unlink(p, first, last, next, prev, count)
sm_element * sm_col_find(sm_col *pcol, int row)
#define ABC_NAMESPACE_IMPL_END
int sm_col_contains(sm_col *p1, sm_col *p2)
#define ABC_NAMESPACE_IMPL_START
void sm_col_remove_element(sm_col *pcol, sm_element *p)
int sm_col_intersects(sm_col *p1, sm_col *p2)
typedefABC_NAMESPACE_HEADER_START struct sm_element_struct sm_element
#define sm_element_alloc(newobj)
void sm_col_free(sm_col *pcol)
sm_element * sm_col_insert(sm_col *pcol, int row)
void sm_col_print(FILE *fp, sm_col *pcol)
ABC_NAMESPACE_IMPL_START sm_col * sm_col_alloc()