=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.200 retrieving revision 1.201 diff -u -p -r1.200 -r1.201 --- OpenXM_contrib2/asir2000/engine/nd.c 2012/12/17 07:20:44 1.200 +++ OpenXM_contrib2/asir2000/engine/nd.c 2013/01/30 07:44:48 1.201 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.199 2012/08/27 05:38:00 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.200 2012/12/17 07:20:44 noro Exp $ */ #include "nd.h" @@ -3952,6 +3952,20 @@ void nd_setup_parameters(int nvar,int max) { else if ( max < 65536 ) nd_bpe = 16; else nd_bpe = 32; } + if ( !do_weyl && current_dl_weight_vector ) { + UINT t; + /* t = max(weights) */ + for ( i = 0, t = 0; i < nd_nvar; i++ ) + if ( t < current_dl_weight_vector[i] ) + t = current_dl_weight_vector[i]; + /* i = bitsize of t */ + for ( i = 0; t; t >>=1, i++ ); + /* i += bitsize of nd_nvar */ + for ( t = nd_nvar; t; t >>=1, i++); + /* nd_bpe+i = bitsize of max(weights)*max(exp)*nd_nvar */ + if ( (nd_bpe+i) >= 31 ) + error("nd_setup_parameters : too large weight"); + } nd_epw = (sizeof(UINT)*8)/nd_bpe; elen = nd_nvar/nd_epw+(nd_nvar%nd_epw?1:0); nd_exporigin = nd_get_exporigin(nd_ord);