findex                 package:deal                 R Documentation

_T_r_a_n_s_l_a_t_i_o_n _b_e_t_w_e_e_n _i_n_d_i_c_e_s _i_n _a _m_u_l_t_i_w_a_y _a_r_r_a_y

_D_e_s_c_r_i_p_t_i_o_n:

     Translate back and forth between indices in multiway arrays

_U_s_a_g_e:

     findex (i, dim, config=TRUE)

_A_r_g_u_m_e_n_t_s:

       i: either a matrix (if `config' is `TRUE') of configurations or
          a vector (if `config' is `FALSE') of indices.

     dim: a vector of integers giving the dimension of the multiway
          array.

  config: a logical. If `TRUE', `i' is interpreted as a matrix of
          configurations. If `FALSE', `i' is interpreted as a matrix of
          indices in the unfolded multiway array with dimension `dim'.

_D_e_t_a_i_l_s:

     This function is intended for internal use.

     If `config' is `TRUE', then `i' is interpreted as a matrix with
     one row per wanted entry. The columns are the configurations of
     each of the discrete variables (in the proper order). Returned is
     a vector of length the number of rows of `i'. The entries
     correspond to each row and is the corresponding number if the
     array were 'folded' out.

     If `config' is `FALSE', then `i' is a vector of indices in the
     unfolded  array. We want the corresponding configurations of the
     discrete variables output is a matrix with one row per
     configuration.

     Thus, `findex(config=TRUE)' and `findex(config=FALSE)' are each
     others inverse functions.

_A_u_t_h_o_r(_s):

     Susanne Gammelgaard Bttcher alma@math.auc.dk, 
     Claus Dethlefsen dethlef@math.auc.dk.

_R_e_f_e_r_e_n_c_e_s:

     Further information about deal can be found at:
     <URL: http://www.math.auc.dk/novo/deal>.

_E_x_a_m_p_l_e_s:

       dims <- c(3,2,4)
       findex(findex(1:4,dims,config=FALSE),dims)

