previous up next contents
Previous: A.2 Reading data files Up: A. Some computing tools Next: A.4 Using collected data   Contents

A.3 Encoding / decoding

The following Listings are describing several utilities for coding/decoding. Indeed, it is useful to leave coexist:

  1. Plain text (txt), to communicate with the experimentalists and with the recipients of the study
  2. Split Euclidean code (itm), where the value of each factor is described by a number between 0 and $ siza\left(i\right)-1$
  3. Unique global Euclidean code (number), where each experience is coded by a unique number between 0 and $ Omega-1$
  4. Suitable code for matrix computations (code)
Each transcoding routine takes one or several experiments (= lines) as input and returns the same number of lines as output.

LISTING 5 describes txt2itm and itm2txt, i.e. transcoding between the human readable description and the split Euclidean code. From all the transcoding routines, txt2itm is the only one that checks if its input is correct, in order to detect human typing errors (computers never fail, aren't they ?).


\begin{algorithm}
% latex2html id marker 1480
[H]
\begin{algorithmic}[1]
\par
\F...
...gorithmic}
\par
\caption{Conversions txt2itm and itm2txt
}
\par
\end{algorithm}

LISTING 6 describes itm2num and num2itm, i.e. transcoding between the two Euclidean codes. By the way, one can see why it is essential to start these codes from 0 and not from $ 1$.


\begin{algorithm}
% latex2html id marker 1505
[H]
\begin{algorithmic}[1]
\par
\F...
...gorithmic}
\par
\caption{Conversions itm2num and num2itm
}
\par
\end{algorithm}

LISTING 7 shows how to convert several lines of split Euclidean code into matrix code and conversely (itm2cod and cod2itm). Now, a command like :
ma=itm2cod(txt2itm(datas(2:$,:)))
can be used to combine these routines and produce the computable matrix ma from the human readable description datas of the design. It should be noted that the number of lines of matrix ma is exactly the number of tests of the design, while matrix datas contains also a title line, and a column of results.


\begin{algorithm}
% latex2html id marker 1537
[H]
\begin{algorithmic}[1]
\par
\F...
...lgorithmic}
\par
\caption{Conversion itm2cod and cod2itm
}
\par
\end{algorithm}

Finally, LISTING 8 provides a way to map a design of experiments in order to examine how the different factors are dispatched. Being tailored to compare different designs, this algorithm must receive the given design as parameter.


\begin{algorithm}
% latex2html id marker 1560
[H]
\begin{algorithmic}[1]
\par
\F...
...gorithmic}
\par
\caption{Cartesian map of a given design
}
\par
\end{algorithm}


previous up next contents
Previous: A.2 Reading data files Up: A. Some computing tools Next: A.4 Using collected data   Contents


douillet@ensait.fr
2008-03-14