=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.h,v retrieving revision 1.19 retrieving revision 1.31 diff -u -p -r1.19 -r1.31 --- OpenXM_contrib2/asir2000/engine/nd.h 2009/01/04 05:44:51 1.19 +++ OpenXM_contrib2/asir2000/engine/nd.h 2013/12/20 02:02:24 1.31 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.h,v 1.18 2006/12/14 02:49:59 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.h,v 1.30 2013/11/05 11:36:58 ohara Exp $ */ #include "ca.h" #include "parse.h" #include "ox.h" @@ -7,7 +7,7 @@ #include #if defined(__GNUC__) -#define INLINE inline +#define INLINE static inline #elif defined(VISUAL) #define INLINE __inline #else @@ -47,6 +47,7 @@ typedef struct oNDV { typedef union oNDC { int m; Q z; + GZ gz; P p; R r; DAlg a; @@ -116,6 +117,11 @@ typedef struct oIndArray } index; } *IndArray; +typedef struct oNDVI { + NDV p; + int i; +} *NDVI; + extern int (*ndl_compare_function)(UINT *a1,UINT *a2); extern int nd_dcomp; @@ -128,17 +134,21 @@ extern char *Demand; extern VL CO; extern int Top,Reverse,DP_Print,dp_nelim,do_weyl,NoSugar; extern int *current_weyl_weight_vector; +extern int *current_module_weight_vector; /* fundamental macros */ #define TD(d) (d[0]) #define HDL(d) ((d)->body->dl) #define HTD(d) (TD(HDL(d))) +#define HCU(d) ((d)->body->c) #define HCM(d) ((d)->body->c.m) #define HCQ(d) ((d)->body->c.z) +#define HCZ(d) ((d)->body->c.gz) #define HCP(d) ((d)->body->c.p) #define HCA(d) ((d)->body->c.a) #define CM(x) ((x)->c.m) #define CQ(x) ((x)->c.z) +#define CZ(x) ((x)->c.gz) #define CP(x) ((x)->c.p) #define CA(x) ((x)->c.a) #define DL(x) ((x)->dl) @@ -240,26 +250,26 @@ ND_pairs nd_newpairs( NODE g, int t ); ND_pairs nd_minp( ND_pairs d, ND_pairs *prest ); ND_pairs nd_minsugarp( ND_pairs d, ND_pairs *prest ); NODE update_base(NODE nd,int ndp); -ND_pairs update_pairs( ND_pairs d, NODE /* of index */ g, int t); +ND_pairs update_pairs( ND_pairs d, NODE /* of index */ g, int t, int gensyz); ND_pairs equivalent_pairs( ND_pairs d1, ND_pairs *prest ); ND_pairs crit_B( ND_pairs d, int s ); ND_pairs crit_M( ND_pairs d1 ); ND_pairs crit_F( ND_pairs d1 ); int crit_2( int dp1, int dp2 ); -int ndv_newps(int m,NDV a,NDV aq); +int ndv_newps(int m,NDV a,NDV aq,int f4); /* top level functions */ -void nd_gr(LIST f,LIST v,int m,int f4,struct order_spec *ord,LIST *rp); +void nd_gr(LIST f,LIST v,int m,int homo,int retdp,int f4,struct order_spec *ord,LIST *rp); void nd_gr_trace(LIST f,LIST v,int trace,int homo,int f4,struct order_spec *ord,LIST *rp); -NODE nd_f4(int m); -NODE nd_gb(int m,int ishomo,int checkonly); -NODE nd_gb_trace(int m,int ishomo); -NODE nd_f4_trace(int m); +NODE nd_f4(int m,int **indp); +NODE nd_gb(int m,int ishomo,int checkonly,int gensyz,int **indp); +NODE nd_gb_trace(int m,int ishomo,int **indp); +NODE nd_f4_trace(int m,int **indp); /* ndl functions */ int ndl_weight(UINT *d); void ndl_weight_mask(UINT *d); -void ndl_homogenize(UINT *d,UINT *r,int obpe,EPOS oepos,int weight); +void ndl_homogenize(UINT *d,UINT *r,int obpe,EPOS oepos,int ompos,int weight); void ndl_dehomogenize(UINT *p); void ndl_reconstruct(UINT *d,UINT *r,int obpe,EPOS oepos); INLINE int ndl_reducible(UINT *d1,UINT *d2); @@ -282,7 +292,7 @@ int nd_nf(int mod,ND d,ND g,NDV *ps,int full,NDC dn,ND int nd_nf_pbucket(int mod,ND g,NDV *ps,int full,ND *nf); /* finalizers */ -NODE ndv_reducebase(NODE x); +NODE ndv_reducebase(NODE x,int *perm); NODE ndv_reduceall(int m,NODE f); /* allocators */ @@ -302,23 +312,24 @@ void ndp_print(ND_pairs d); /* setup, reconstruct */ void nd_init_ord(struct order_spec *spec); ND_pairs nd_reconstruct(int trace,ND_pairs ndp); -void ndv_setup(int mod,int trace,NODE f,int dont_sort,int dont_removecont); +int ndv_setup(int mod,int trace,NODE f,int dont_sort,int dont_removecont); void nd_setup_parameters(int nvar,int max); BlockMask nd_create_blockmask(struct order_spec *ord); EPOS nd_create_epos(struct order_spec *ord); int nd_get_exporigin(struct order_spec *ord); void ndv_mod(int mod,NDV p); NDV ndv_dup(int mod,NDV p); +NDV ndv_symbolic(int mod,NDV p); ND nd_dup(ND p); /* ND functions */ -int ndv_check_candidate(NODE input,int obpe,int oadv,EPOS oepos,NODE cand); +int ndv_check_membership(int m,NODE input,int obpe,int oadv,EPOS oepos,NODE cand); void nd_mul_c(int mod,ND p,int mul); void nd_mul_c_q(ND p,P mul); void nd_mul_c_p(VL vl,ND p,P mul); ND nd_remove_head(ND p); ND nd_separate_head(ND p,ND *head); -int nd_length(ND p); +INLINE int nd_length(ND p); void nd_append_red(UINT *d,int i); UINT *ndv_compute_bound(NDV p); UINT *nd_compute_bound(ND p); @@ -335,6 +346,8 @@ NODE nd_f4_red_main(int m,ND_pairs sp0,int nsp,UINT *s NM_ind_pair *rvect,int *rhead,IndArray *imat,int nred,ND_pairs *nz); NODE nd_f4_red_q_main(ND_pairs sp0,int nsp,int trace,UINT *s0vect,int col, NM_ind_pair *rvect,int *rhead,IndArray *imat,int nred); +NODE nd_f4_red_gz_main(ND_pairs sp0,int nsp,int trace,UINT *s0vect,int col, + NM_ind_pair *rvect,int *rhead,IndArray *imat,int nred); /* NDV functions */ ND weyl_ndv_mul_nm(int mod,NM m0,NDV p); @@ -346,7 +359,7 @@ ND ndv_mul_nm(int mod,NM m0,NDV p); ND ndv_mul_nmv_trunc(int mod,NMV m0,NDV p,UINT *d); void ndv_realloc(NDV p,int obpe,int oadv,EPOS oepos); NDV ndv_dup_realloc(NDV p,int obpe,int oadv,EPOS oepos); -void ndv_homogenize(NDV p,int obpe,int oadv,EPOS eops); +void ndv_homogenize(NDV p,int obpe,int oadv,EPOS eops,int ompos); void ndv_dehomogenize(NDV p,struct order_spec *spec); void ndv_removecont(int mod,NDV p); void ndv_print(NDV p); @@ -362,7 +375,7 @@ P ndvtop(int mod,VL vl,VL dvl,NDV p); NDV ndtondv(int mod,ND p); ND ndvtond(int mod,NDV p); Q *nm_ind_pair_to_vect(int m,UINT *s0,int n,NM_ind_pair pair); -IndArray nm_ind_pair_to_vect_compress(int m,UINT *s0,int n,NM_ind_pair pair); +IndArray nm_ind_pair_to_vect_compress(int m,UINT *s0,int n,int *s0hash,NM_ind_pair pair); int nd_to_vect(int mod,UINT *s0,int n,ND d,UINT *r); int nd_to_vect_q(UINT *s0,int n,ND d,Q *r); NDV vect_to_ndv_q(Q *vect,int spcol,int col,int *rhead,UINT *s0vect);