search for: stateidx

Displaying 2 results from an estimated 2 matches for "stateidx".

Did you mean: state_idx
2003 Sep 11
2
FAST_IPSEC doesn't seem to honor net.key.prefered_oldsa=0
...ATE_MATURE, SADB_SASTATE_DYING, + }; + static u_int saorder_state_alive[] = { /* except DEAD */ SADB_SASTATE_MATURE, SADB_SASTATE_DYING, SADB_SASTATE_LARVAL *************** *** 816,821 **** --- 825,832 ---- struct secashead *sah; struct secasvar *sav; u_int stateidx, state; + const u_int *saorder_state_valid; + int arraysize; LIST_FOREACH(sah, &sahtree, chain) { if (sah->state == SADB_SASTATE_DEAD) *************** *** 828,836 **** found: /* search valid state */ for (stateidx = 0; !...
2009 May 07
2
for loop vectorization
...help with making this for loop more efficient? The code is trying to make a Q matrix for a multidimensional state space with specific conditions. thanks Mira tmp = 0:(maxvals[1]) for(i in 2:nchars) { tmp <- outer(tmp, 0:(maxvals[i]), FUN="paste", sep=".") } states = tmp stateidx = array(1:length(states), dim=dim(states)) transition <- matrix(data=0, nrow=length(states), ncol=length(states)) findstatedim <- function(x) which(stateidx==x, arr.ind = TRUE) manhattandistance <- function(x,y) sum(abs(findstatedim(x)-findstatedim(y))) for(i in 1:length(states)) {...