void pack_table() { register int i; register int place; register int state; base = NEW2(nvectors, Yshort); pos = NEW2(nentries, Yshort); maxtable = 1000; table = NEW2(maxtable, Yshort); check = NEW2(maxtable, Yshort); lowzero = 0; high = 0; for (i = 0; i < maxtable; i++) check[i] = -1; for (i = 0; i < nentries; i++) { state = matching_vector(i); if (state < 0) place = pack_vector(i); else place = base[state]; pos[i] = place; base[order[i]] = place; } for (i = 0; i < nvectors; i++) { if (froms[i]) FREE(froms[i]); if (tos[i]) FREE(tos[i]); } FREE(froms); FREE(tos); FREE(tally); FREE(width); FREE(pos); }
static void pack_table(void) { int i; Value_t place; int state; base = NEW2(nvectors, Value_t); pos = NEW2(nentries, Value_t); maxtable = 1000; table = NEW2(maxtable, Value_t); check = NEW2(maxtable, Value_t); lowzero = 0; high = 0; for (i = 0; i < maxtable; i++) check[i] = -1; for (i = 0; i < nentries; i++) { state = matching_vector(i); if (state < 0) place = (Value_t) pack_vector(i); else place = base[state]; pos[i] = place; base[order[i]] = place; } for (i = 0; i < nvectors; i++) { if (froms[i]) FREE(froms[i]); if (tos[i]) FREE(tos[i]); } FREE(froms); FREE(tos); FREE(pos); }
inline static void pack( json::value& jsv, const T& v ) { jsv = json::array(); pack_sequence pack_vector( (json::array&)jsv ); boost::fusion::for_each( v, pack_vector ); }