version 1.5, 2003/07/24 03:45:41 |
version 1.6, 2003/07/25 04:19:54 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.4 2003/07/23 14:24:14 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.5 2003/07/24 03:45:41 noro Exp $ */ |
|
|
#include "ca.h" |
#include "ca.h" |
#include "inline.h" |
#include "inline.h" |
|
|
#define USE_NDV 0 |
#define USE_NDV 1 |
|
|
#if defined(__GNUC__) |
#if defined(__GNUC__) |
#define INLINE inline |
#define INLINE inline |
|
|
extern int Top,Reverse; |
extern int Top,Reverse; |
int nd_psn,nd_pslen; |
int nd_psn,nd_pslen; |
int nd_found,nd_create,nd_notfirst; |
int nd_found,nd_create,nd_notfirst; |
|
int *nd_psl; |
|
|
void GC_gcollect(); |
void GC_gcollect(); |
NODE append_one(NODE,int); |
NODE append_one(NODE,int); |
Line 112 void _ND_alloc(); |
|
Line 113 void _ND_alloc(); |
|
int ndl_td(unsigned int *d); |
int ndl_td(unsigned int *d); |
ND nd_add(ND p1,ND p2); |
ND nd_add(ND p1,ND p2); |
ND nd_mul_nm(ND p,NM m0); |
ND nd_mul_nm(ND p,NM m0); |
|
ND nd_mul_ind_nm(int index,NM m0); |
ND nd_mul_term(ND p,int td,unsigned int *d); |
ND nd_mul_term(ND p,int td,unsigned int *d); |
int nd_sp(ND_pairs p,ND *nf); |
int nd_sp(ND_pairs p,ND *nf); |
int nd_find_reducer(ND g,ND *red); |
int nd_find_reducer(ND g); |
int nd_nf(ND g,int full,ND *nf); |
int nd_nf(ND g,int full,ND *nf); |
ND nd_reduce(ND p1,ND p2); |
ND nd_reduce(ND p1,ND p2); |
ND nd_reduce_special(ND p1,ND p2); |
ND nd_reduce_special(ND p1,ND p2); |
Line 132 unsigned int *dp_compute_bound(DP p); |
|
Line 134 unsigned int *dp_compute_bound(DP p); |
|
ND_pairs nd_reconstruct(ND_pairs); |
ND_pairs nd_reconstruct(ND_pairs); |
void nd_setup_parameters(); |
void nd_setup_parameters(); |
ND nd_dup(ND p,int obpe); |
ND nd_dup(ND p,int obpe); |
|
ND nd_copy(ND p); |
void ndl_dup(int obpe,unsigned int *d,unsigned int *r); |
void ndl_dup(int obpe,unsigned int *d,unsigned int *r); |
|
|
#if USE_NDV |
#if USE_NDV |
|
|
NDV ndv_red; |
NDV ndv_red; |
|
|
ND ndv_add(ND p1,NDV p2); |
ND ndv_add(ND p1,NDV p2); |
int ndv_find_reducer(ND g,NDV red); |
|
NDV ndtondv(ND p); |
NDV ndtondv(ND p); |
void ndv_mul_nm(NDV pv,NM m,NDV r); |
void ndv_mul_nm(NDV pv,NM m,NDV r); |
#endif |
#endif |
Line 371 INLINE int ndl_equal(unsigned int *d1,unsigned int *d2 |
|
Line 373 INLINE int ndl_equal(unsigned int *d1,unsigned int *d2 |
|
return 1; |
return 1; |
} |
} |
|
|
|
INLINE void ndl_copy(unsigned int *d1,unsigned int *d2) |
|
{ |
|
int i; |
|
|
|
switch ( nd_wpd ) { |
|
case 1: |
|
d2[0] = d1[0]; |
|
break; |
|
case 2: |
|
d2[0] = d1[0]; |
|
d2[1] = d1[1]; |
|
break; |
|
default: |
|
for ( i = 0; i < nd_wpd; i++ ) |
|
d2[i] = d1[i]; |
|
break; |
|
} |
|
} |
|
|
INLINE void ndl_add(unsigned int *d1,unsigned int *d2,unsigned int *d) |
INLINE void ndl_add(unsigned int *d1,unsigned int *d2,unsigned int *d) |
{ |
{ |
int i; |
int i; |
|
|
for ( i = 0; i < nd_wpd; i++ ) { |
switch ( nd_wpd ) { |
d[i] = d1[i]+d2[i]; |
case 1: |
|
d[0] = d1[0]+d2[0]; |
|
break; |
|
case 2: |
|
d[0] = d1[0]+d2[0]; |
|
d[1] = d1[1]+d2[1]; |
|
break; |
|
default: |
|
for ( i = 0; i < nd_wpd; i++ ) |
|
d[i] = d1[i]+d2[i]; |
|
break; |
} |
} |
} |
} |
|
|
|
INLINE void ndl_add2(unsigned int *d1,unsigned int *d2) |
|
{ |
|
int i; |
|
|
|
switch ( nd_wpd ) { |
|
case 1: |
|
d2[0] += d1[0]; |
|
break; |
|
case 2: |
|
d2[0] += d1[0]; |
|
d2[1] += d1[1]; |
|
break; |
|
default: |
|
for ( i = 0; i < nd_wpd; i++ ) |
|
d2[i] += d1[i]; |
|
break; |
|
} |
|
} |
|
|
void ndl_sub(unsigned int *d1,unsigned int *d2,unsigned int *d) |
void ndl_sub(unsigned int *d1,unsigned int *d2,unsigned int *d) |
{ |
{ |
int i; |
int i; |
Line 750 int nd_sp(ND_pairs p,ND *rp) |
|
Line 800 int nd_sp(ND_pairs p,ND *rp) |
|
return 1; |
return 1; |
} |
} |
|
|
int ndl_hash_value(int td,unsigned int *d) |
INLINE int ndl_hash_value(int td,unsigned int *d) |
{ |
{ |
int i; |
int i; |
int r; |
int r; |
Line 761 int ndl_hash_value(int td,unsigned int *d) |
|
Line 811 int ndl_hash_value(int td,unsigned int *d) |
|
return r; |
return r; |
} |
} |
|
|
int nd_find_reducer(ND g, ND *rp) |
INLINE int nd_find_reducer(ND g) |
{ |
{ |
NM m; |
NM m; |
ND r,p; |
ND p; |
int i,c1,c2,c; |
int d,k,i; |
int d,k,append,index; |
|
NM t; |
|
|
|
d = ndl_hash_value(HTD(g),HDL(g)); |
d = ndl_hash_value(HTD(g),HDL(g)); |
for ( m = nd_red[d], k = 0; m; m = NEXT(m), k++ ) { |
for ( m = nd_red[d], k = 0; m; m = NEXT(m), k++ ) { |
if ( HTD(g) == m->td && ndl_equal(HDL(g),m->dl) ) { |
if ( HTD(g) == m->td && ndl_equal(HDL(g),m->dl) ) { |
if ( k > 0 ) nd_notfirst++; |
if ( k > 0 ) nd_notfirst++; |
index = m->c; |
|
append = 0; |
|
nd_found++; |
nd_found++; |
goto found; |
return m->c; |
} |
} |
} |
} |
|
|
for ( i = 0; i < nd_psn; i++ ) { |
for ( i = 0; i < nd_psn; i++ ) { |
p = nd_ps[i]; |
p = nd_ps[i]; |
if ( HTD(g) >= HTD(p) && ndl_reducible(HDL(g),HDL(p)) ) { |
if ( HTD(g) >= HTD(p) && ndl_reducible(HDL(g),HDL(p)) ) { |
index = i; |
|
append = 1; |
|
nd_create++; |
nd_create++; |
goto found; |
nd_append_red(HDL(g),HTD(g),i); |
|
return i; |
} |
} |
} |
} |
return 0; |
return -1; |
|
|
found: |
|
NEWNM(m); |
|
p = nd_ps[index]; |
|
ndl_sub(HDL(g),HDL(p),m->dl); |
|
|
|
if ( ndl_check_bound2(index,m->dl) ) { |
|
FREENM(m); |
|
return -1; |
|
} |
|
|
|
c1 = invm(HC(p),nd_mod); |
|
c2 = nd_mod-HC(g); |
|
DMAR(c1,c2,0,nd_mod,c); |
|
C(m) = c; |
|
m->td = HTD(g)-HTD(p); |
|
NEXT(m) = 0; |
|
*rp = r = nd_mul_nm(p,m); |
|
FREENM(m); |
|
|
|
if ( append ) nd_append_red(HDL(g),HTD(g),i); |
|
return 1; |
|
} |
} |
|
|
ND nd_find_monic_reducer(ND g) |
ND nd_find_monic_reducer(ND g) |
Line 921 ND nd_mul_nm(ND p,NM m0) |
|
Line 944 ND nd_mul_nm(ND p,NM m0) |
|
} |
} |
} |
} |
|
|
|
ND nd_mul_ind_nm(int index,NM m0) |
|
{ |
|
register int c1,c2,c; |
|
register NM m,new,prev; |
|
NM mr0; |
|
unsigned int *d; |
|
int n,td,i,len,d0,d1; |
|
ND p,r; |
|
|
|
p = nd_ps[index]; |
|
len = nd_psl[index]; |
|
n = NV(p); m = BDY(p); |
|
d = m0->dl; td = m0->td; c = C(m0); |
|
|
|
NEWNM(mr0); |
|
c1 = C(m); DMAR(c1,c,0,nd_mod,c2); C(mr0) = c2; |
|
mr0->td = m->td+td; ndl_add(m->dl,d,mr0->dl); |
|
prev = mr0; m = NEXT(m); |
|
len--; |
|
|
|
switch ( nd_wpd ) { |
|
case 1: |
|
d0 = d[0]; |
|
while ( len-- ) { |
|
c1 = C(m); DMAR(c1,c,0,nd_mod,c2); |
|
NEWNM(new); C(new) = c2; |
|
new->td = m->td+td; new->dl[0] = m->dl[0]+d0; |
|
m = NEXT(m); NEXT(prev) = new; prev = new; |
|
} |
|
break; |
|
case 2: |
|
d0 = d[0]; d1 = d[1]; |
|
while ( len-- ) { |
|
c1 = C(m); DMAR(c1,c,0,nd_mod,c2); |
|
NEWNM(new); C(new) = c2; |
|
new->td = m->td+td; |
|
new->dl[0] = m->dl[0]+d0; |
|
new->dl[1] = m->dl[1]+d1; |
|
m = NEXT(m); NEXT(prev) = new; prev = new; |
|
} |
|
break; |
|
default: |
|
while ( len-- ) { |
|
c1 = C(m); DMAR(c1,c,0,nd_mod,c2); |
|
NEWNM(new); C(new) = c2; |
|
new->td = m->td+td; ndl_add(m->dl,d,new->dl); |
|
m = NEXT(m); NEXT(prev) = new; prev = new; |
|
} |
|
break; |
|
} |
|
|
|
NEXT(prev) = 0; |
|
MKND(NV(p),mr0,r); |
|
r->sugar = p->sugar + td; |
|
return r; |
|
} |
|
|
ND nd_mul_term(ND p,int td,unsigned int *d) |
ND nd_mul_term(ND p,int td,unsigned int *d) |
{ |
{ |
NM m,mr,mr0; |
NM m,mr,mr0; |
Line 950 int nd_nf(ND g,int full,ND *rp) |
|
Line 1030 int nd_nf(ND g,int full,ND *rp) |
|
{ |
{ |
ND p,d; |
ND p,d; |
NM m,mrd,tail; |
NM m,mrd,tail; |
int n,sugar,psugar,stat; |
struct oNM mul; |
|
int n,sugar,psugar,stat,index; |
|
int c,c1,c2; |
#if USE_NDV |
#if USE_NDV |
NDV red; |
NDV red; |
#else |
#else |
Line 964 int nd_nf(ND g,int full,ND *rp) |
|
Line 1046 int nd_nf(ND g,int full,ND *rp) |
|
sugar = g->sugar; |
sugar = g->sugar; |
n = NV(g); |
n = NV(g); |
for ( d = 0; g; ) { |
for ( d = 0; g; ) { |
/* stat=1 : found, stat=0 : not found, stat=-1 : overflow */ |
index = nd_find_reducer(g); |
|
if ( index >= 0 ) { |
|
p = nd_ps[index]; |
|
ndl_sub(HDL(g),HDL(p),mul.dl); |
|
mul.td = HTD(g)-HTD(p); |
|
if ( ndl_check_bound2(index,mul.dl) ) { |
|
nd_free(g); nd_free(d); |
|
return 0; |
|
} |
|
c1 = invm(HC(p),nd_mod); c2 = nd_mod-HC(g); |
|
DMAR(c1,c2,0,nd_mod,c); mul.c = c; |
#if USE_NDV |
#if USE_NDV |
stat = ndv_find_reducer(g,ndv_red); |
ndv_mul_nm(nd_psv[index],&mul,ndv_red); |
#else |
|
stat = nd_find_reducer(g,&red); |
|
#endif |
|
if ( stat == 1 ) { |
|
#if USE_NDV |
|
g = ndv_add(g,ndv_red); |
g = ndv_add(g,ndv_red); |
sugar = MAX(sugar,ndv_red->sugar); |
sugar = MAX(sugar,ndv_red->sugar); |
#else |
#else |
|
red = nd_mul_ind_nm(index,&mul); |
g = nd_add(g,red); |
g = nd_add(g,red); |
sugar = MAX(sugar,red->sugar); |
sugar = MAX(sugar,red->sugar); |
#endif |
#endif |
} else if ( stat == -1 ) { |
|
nd_free(g); |
|
nd_free(d); |
|
return 0; |
|
} else if ( !full ) { |
} else if ( !full ) { |
*rp = g; |
*rp = g; |
return 1; |
return 1; |
Line 1457 ND_pairs nd_minp( ND_pairs d, ND_pairs *prest ) |
|
Line 1541 ND_pairs nd_minp( ND_pairs d, ND_pairs *prest ) |
|
lcm = m->lcm; |
lcm = m->lcm; |
s = m->sugar; |
s = m->sugar; |
td = m->td; |
td = m->td; |
len = nd_length(nd_ps[m->i1])+nd_length(nd_ps[m->i2]); |
len = nd_psl[m->i1]+nd_psl[m->i2]; |
for ( ml = 0, l = m; p; p = NEXT(l = p) ) { |
for ( ml = 0, l = m; p; p = NEXT(l = p) ) { |
if (p->sugar < s) |
if (p->sugar < s) |
goto find; |
goto find; |
Line 1469 ND_pairs nd_minp( ND_pairs d, ND_pairs *prest ) |
|
Line 1553 ND_pairs nd_minp( ND_pairs d, ND_pairs *prest ) |
|
if ( c < 0 ) |
if ( c < 0 ) |
goto find; |
goto find; |
else if ( c == 0 ) { |
else if ( c == 0 ) { |
tlen = nd_length(nd_ps[p->i1])+nd_length(nd_ps[p->i2]); |
tlen = nd_psl[p->i1]+nd_psl[p->i2]; |
if ( tlen < len ) |
if ( tlen < len ) |
goto find; |
goto find; |
} |
} |
Line 1500 int nd_newps(ND a) |
|
Line 1584 int nd_newps(ND a) |
|
if ( nd_psn == nd_pslen ) { |
if ( nd_psn == nd_pslen ) { |
nd_pslen *= 2; |
nd_pslen *= 2; |
nd_ps = (ND *)REALLOC((char *)nd_ps,nd_pslen*sizeof(ND)); |
nd_ps = (ND *)REALLOC((char *)nd_ps,nd_pslen*sizeof(ND)); |
|
nd_psl = (int *)REALLOC((char *)nd_psl,nd_pslen*sizeof(int)); |
#if USE_NDV |
#if USE_NDV |
nd_psv = (NDV *)REALLOC((char *)nd_psv,nd_pslen*sizeof(NDV)); |
nd_psv = (NDV *)REALLOC((char *)nd_psv,nd_pslen*sizeof(NDV)); |
#endif |
#endif |
Line 1508 int nd_newps(ND a) |
|
Line 1593 int nd_newps(ND a) |
|
} |
} |
nd_monic(a); |
nd_monic(a); |
nd_ps[nd_psn] = a; |
nd_ps[nd_psn] = a; |
|
nd_psl[nd_psn] = nd_length(a); |
nd_bound[nd_psn] = nd_compute_bound(a); |
nd_bound[nd_psn] = nd_compute_bound(a); |
#if USE_NDV |
#if USE_NDV |
len = nd_psv[nd_psn]->len; |
|
nd_psv[nd_psn] = ndtondv(a); |
nd_psv[nd_psn] = ndtondv(a); |
|
len = nd_psv[nd_psn]->len; |
if ( len > nmv_len ) { |
if ( len > nmv_len ) { |
nmv_len = 2*len; |
nmv_len = 2*len; |
BDY(ndv_red) = (NMV)REALLOC(BDY(ndv_red),nmv_len*nmv_adv); |
BDY(ndv_red) = (NMV)REALLOC(BDY(ndv_red),nmv_len*nmv_adv); |
Line 1538 NODE nd_setup(NODE f) |
|
Line 1624 NODE nd_setup(NODE f) |
|
#endif |
#endif |
nd_psn = length(f); nd_pslen = 2*nd_psn; |
nd_psn = length(f); nd_pslen = 2*nd_psn; |
nd_ps = (ND *)MALLOC(nd_pslen*sizeof(ND)); |
nd_ps = (ND *)MALLOC(nd_pslen*sizeof(ND)); |
|
nd_psl = (int *)MALLOC(nd_pslen*sizeof(int)); |
#if USE_NDV |
#if USE_NDV |
nd_psv = (NDV *)MALLOC(nd_pslen*sizeof(NDV)); |
nd_psv = (NDV *)MALLOC(nd_pslen*sizeof(NDV)); |
#endif |
#endif |
Line 1567 NODE nd_setup(NODE f) |
|
Line 1654 NODE nd_setup(NODE f) |
|
for ( i = 0; i < nd_psn; i++, f = NEXT(f) ) { |
for ( i = 0; i < nd_psn; i++, f = NEXT(f) ) { |
nd_ps[i] = dptond((DP)BDY(f)); |
nd_ps[i] = dptond((DP)BDY(f)); |
nd_monic(nd_ps[i]); |
nd_monic(nd_ps[i]); |
|
nd_psl[i] = nd_length(nd_ps[i]); |
#if USE_NDV |
#if USE_NDV |
nd_psv[i] = ndtondv(nd_ps[i]); |
nd_psv[i] = ndtondv(nd_ps[i]); |
len = MAX(len,nd_psv[i]->len); |
len = MAX(len,nd_psv[i]->len); |
Line 1878 void nd_setup_parameters() { |
|
Line 1966 void nd_setup_parameters() { |
|
ND_pairs nd_reconstruct(ND_pairs d) |
ND_pairs nd_reconstruct(ND_pairs d) |
{ |
{ |
int i,obpe; |
int i,obpe; |
NM prev_nm_free_list; |
NM prev_nm_free_list,mr0,mr,m; |
ND_pairs s0,s,t,prev_ndp_free_list; |
ND_pairs s0,s,t,prev_ndp_free_list; |
|
|
obpe = nd_bpe; |
obpe = nd_bpe; |
Line 1915 ND_pairs nd_reconstruct(ND_pairs d) |
|
Line 2003 ND_pairs nd_reconstruct(ND_pairs d) |
|
s->sugar = t->sugar; |
s->sugar = t->sugar; |
ndl_dup(obpe,t->lcm,s->lcm); |
ndl_dup(obpe,t->lcm,s->lcm); |
} |
} |
|
for ( i = 0; i < REDTAB_LEN; i++ ) { |
|
for ( mr0 = 0, m = nd_red[i]; m; m = NEXT(m) ) { |
|
NEXTNM(mr0,mr); |
|
mr->c = m->c; |
|
mr->td = m->td; |
|
ndl_dup(obpe,m->dl,mr->dl); |
|
} |
|
if ( mr0 ) NEXT(mr) = 0; |
|
nd_red[i] = mr0; |
|
} |
if ( s0 ) NEXT(s) = 0; |
if ( s0 ) NEXT(s) = 0; |
prev_nm_free_list = 0; |
prev_nm_free_list = 0; |
prev_ndp_free_list = 0; |
prev_ndp_free_list = 0; |
Line 1970 ND nd_dup(ND p,int obpe) |
|
Line 2068 ND nd_dup(ND p,int obpe) |
|
} |
} |
} |
} |
|
|
|
ND nd_copy(ND p) |
|
{ |
|
NM m,mr,mr0; |
|
int c,n,s; |
|
ND r; |
|
|
|
if ( !p ) |
|
return 0; |
|
else { |
|
s = sizeof(struct oNM)+(nd_wpd-1)*sizeof(unsigned int); |
|
for ( mr0 = 0, m = BDY(p); m; m = NEXT(m) ) { |
|
NEXTNM(mr0,mr); |
|
C(mr) = C(m); |
|
mr->td = m->td; |
|
ndl_copy(m->dl,mr->dl); |
|
} |
|
NEXT(mr) = 0; |
|
MKND(NV(p),mr0,r); |
|
r->sugar = p->sugar; |
|
return r; |
|
} |
|
} |
|
|
#if USE_NDV |
#if USE_NDV |
void ndv_mul_nm(NDV p,NM m0,NDV r) |
void ndv_mul_nm(NDV p,NM m0,NDV r) |
{ |
{ |
Line 1997 void ndv_mul_nm(NDV p,NM m0,NDV r) |
|
Line 2118 void ndv_mul_nm(NDV p,NM m0,NDV r) |
|
} |
} |
} |
} |
|
|
int ndv_find_reducer(ND g, NDV red) |
|
{ |
|
NM m; |
|
ND r,p; |
|
int i,c1,c2,c; |
|
int d,k,append,index; |
|
NM t; |
|
NDV pv; |
|
|
|
d = ndl_hash_value(HTD(g),HDL(g)); |
|
for ( m = nd_red[d], k = 0; m; m = NEXT(m), k++ ) { |
|
if ( HTD(g) == m->td && ndl_equal(HDL(g),m->dl) ) { |
|
if ( k > 0 ) nd_notfirst++; |
|
index = m->c; |
|
append = 0; |
|
nd_found++; |
|
goto found; |
|
} |
|
} |
|
|
|
for ( i = 0; i < nd_psn; i++ ) { |
|
p = nd_ps[i]; |
|
if ( HTD(g) >= HTD(p) && ndl_reducible(HDL(g),HDL(p)) ) { |
|
index = i; |
|
append = 1; |
|
nd_create++; |
|
goto found; |
|
} |
|
} |
|
return 0; |
|
|
|
found: |
|
NEWNM(m); |
|
p = nd_ps[index]; |
|
pv = nd_psv[index]; |
|
ndl_sub(HDL(g),HDL(p),m->dl); |
|
|
|
if ( ndl_check_bound2(index,m->dl) ) { |
|
FREENM(m); |
|
return -1; |
|
} |
|
|
|
c1 = invm(HC(p),nd_mod); |
|
c2 = nd_mod-HC(g); |
|
DMAR(c1,c2,0,nd_mod,c); |
|
C(m) = c; |
|
m->td = HTD(g)-HTD(p); |
|
NEXT(m) = 0; |
|
ndv_mul_nm(pv,m,red); |
|
FREENM(m); |
|
|
|
if ( append ) nd_append_red(HDL(g),HTD(g),i); |
|
return 1; |
|
} |
|
|
|
ND ndv_add(ND p1,NDV p2) |
ND ndv_add(ND p1,NDV p2) |
{ |
{ |
int c,c1,c2,t,td,td2,mul,len,i; |
int c,c1,c2,t,td,td2,mul,len,i; |
Line 2069 ND ndv_add(ND p1,NDV p2) |
|
Line 2135 ND ndv_add(ND p1,NDV p2) |
|
td2 = new->td = m2->td; |
td2 = new->td = m2->td; |
if ( !cur ) { |
if ( !cur ) { |
C(new) = C(m2); |
C(new) = C(m2); |
bcopy(m2->dl,new->dl,nd_wpd*sizeof(unsigned int)); |
ndl_copy(m2->dl,new->dl); |
if ( !prev ) { |
if ( !prev ) { |
prev = new; |
prev = new; |
NEXT(prev) = 0; |
NEXT(prev) = 0; |
Line 2112 ND ndv_add(ND p1,NDV p2) |
|
Line 2178 ND ndv_add(ND p1,NDV p2) |
|
cur = NEXT(cur); |
cur = NEXT(cur); |
break; |
break; |
case -1: |
case -1: |
|
ndl_copy(m2->dl,new->dl); |
if ( !prev ) { |
if ( !prev ) { |
/* cur = head */ |
/* cur = head */ |
prev = new; |
prev = new; |
bcopy(m2->dl,new->dl,nd_wpd*sizeof(unsigned int)); |
|
C(prev) = C(m2); |
C(prev) = C(m2); |
NEXT(prev) = head; |
NEXT(prev) = head; |
head = prev; |
head = prev; |
} else { |
} else { |
C(new) = C(m2); |
C(new) = C(m2); |
bcopy(m2->dl,new->dl,nd_wpd*sizeof(unsigned int)); |
|
NEXT(prev) = new; |
NEXT(prev) = new; |
NEXT(new) = cur; |
NEXT(new) = cur; |
prev = new; |
prev = new; |