=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/dp.c,v retrieving revision 1.42 retrieving revision 1.45 diff -u -p -r1.42 -r1.45 --- OpenXM_contrib2/asir2000/builtin/dp.c 2003/10/17 05:16:49 1.42 +++ OpenXM_contrib2/asir2000/builtin/dp.c 2003/12/25 08:46:19 1.45 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/dp.c,v 1.41 2003/10/08 09:38:06 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/dp.c,v 1.44 2003/11/27 07:53:53 noro Exp $ */ #include "ca.h" #include "base.h" @@ -58,6 +58,7 @@ extern struct order_spec dp_current_spec; int do_weyl; +void Pdp_sort(); void Pdp_mul_trunc(),Pdp_quo(); void Pdp_ord(), Pdp_ptod(), Pdp_dtop(); void Pdp_ptozp(), Pdp_ptozp2(), Pdp_red(), Pdp_red2(), Pdp_lcm(), Pdp_redble(); @@ -176,6 +177,7 @@ struct ftab dp_tab[] = { struct ftab dp_supp_tab[] = { /* setting flags */ + {"dp_sort",Pdp_sort,1}, {"dp_ord",Pdp_ord,-1}, {"dp_set_kara",Pdp_set_kara,-1}, {"dp_nelim",Pdp_nelim,-1}, @@ -224,6 +226,13 @@ struct ftab dp_supp_tab[] = { {0,0,0} }; +void Pdp_sort(arg,rp) +NODE arg; +DP *rp; +{ + dp_sort((DP)ARG0(arg),rp); +} + void Pdp_mdtod(arg,rp) NODE arg; DP *rp; @@ -1309,6 +1318,7 @@ Q *rp; break; case 2: DP_Print = 0; DP_PrintShort = 1; + break; default: DP_Print = s; DP_PrintShort = 0; break; @@ -1765,6 +1775,7 @@ VECT *rp; { VECT v; int i,n; + NODE node; if ( !arg ) *rp = current_dl_weight_vector_obj; @@ -1773,8 +1784,17 @@ VECT *rp; current_dl_weight_vector = 0; *rp = 0; } else { - asir_assert(ARG0(arg),O_VECT,"dp_set_weight"); - v = (VECT)ARG0(arg); + if ( OID(ARG0(arg)) != O_VECT && OID(ARG0(arg)) != O_LIST ) + error("dp_set_weight : invalid argument"); + if ( OID(ARG0(arg)) == O_VECT ) + v = (VECT)ARG0(arg); + else { + node = (NODE)BDY((LIST)ARG0(arg)); + n = length(node); + MKVECT(v,n); + for ( i = 0; i < n; i++, node = NEXT(node) ) + BDY(v)[i] = BDY(node); + } current_dl_weight_vector_obj = v; n = v->len; current_dl_weight_vector = (int *)CALLOC(n,sizeof(int));