SSJ
V. labo.

umontreal.iro.lecuyer.util
Class TableFormat

java.lang.Object
  extended by umontreal.iro.lecuyer.util.TableFormat

public class TableFormat
extends Object

TableFormat

This class provides methods to format arrays and matrices into Strings in different styles. This could be useful for printing arrays and subarrays, or for putting them in files for further treatment by other softwares such as Mathematica, Matlab, etc.


Field Summary
static int MATHEMATICA
          .
static int MATLAB
          .
static int PLAIN
          .
 
Method Summary
static String format(double[][] Mat, int i1, int i2, int j1, int j2, int w, int p, int style, String Name)
          .
static String format(double[] V, int n1, int n2, int k, int p1, int p2, int p3)
          .
static String format(int[][] Mat, int i1, int i2, int j1, int j2, int w, int p, int style, String Name)
          Deprecated. 
static String format(int[][] Mat, int i1, int i2, int j1, int j2, int w, int style, String Name)
          .
static String format(int[] V, int n1, int n2, int k, int p)
          .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAIN

public static final int PLAIN
. \begin{tabb}Plain text matrix printing style
 \end{tabb}

See Also:
Constant Field Values

MATHEMATICA

public static final int MATHEMATICA
. \begin{tabb}Mathematica matrix printing style
 \end{tabb}

See Also:
Constant Field Values

MATLAB

public static final int MATLAB
. \begin{tabb}Matlab matrix printing style
 \end{tabb}

See Also:
Constant Field Values
Method Detail

format

public static String format(int[] V,
                            int n1,
                            int n2,
                            int k,
                            int p)
. \begin{tabb}Formats a \class{String} containing the elements \texttt{n1}
 to \te...
 ...ment, i.e., each line \texttt{i} will have the form \texttt{i V[i]}.
 \end{tabb}
Varray to be formated n1index of the first element being formated n2index of the last element being formated knumber of elements per line pnumber of positions per element formated string repreenting the elements


format

public static String format(double[] V,
                            int n1,
                            int n2,
                            int k,
                            int p1,
                            int p2,
                            int p3)
. \begin{tabb}Similar to the previous method, but for an array of \texttt{double}'...
 ...ter the decimal point, and at least \texttt{p3}
 significant digits.
 \end{tabb}
Varray to be formated n1index of the first element being formated n2index of the last element being formated knumber of elements per line p1number of positions per element p2number of digits after the decimal point p3number of significant digits formated string repreenting the elements


format

@Deprecated
public static String format(int[][] Mat,
                                       int i1,
                                       int i2,
                                       int j1,
                                       int j2,
                                       int w,
                                       int p,
                                       int style,
                                       String Name)
Deprecated. 


format

public static String format(double[][] Mat,
                            int i1,
                            int i2,
                            int j1,
                            int j2,
                            int w,
                            int p,
                            int style,
                            String Name)
. \begin{tabb}Formats the submatrix with lines
 \texttt{i1} $\le i \le $\ \texttt{...
 ...le is named \texttt{poil},
 it will be read using \texttt{<< poil;}.
 \end{tabb}
Matmatrix to be formated i1index of the first row being formated i2index of the last row being formated j1index of the first column being formated j2index of the last column being formated wnumber of positions for each element pnumber of digits after the decimal point of the elements styleformating style of the submatrix, being one of MATHEMATICA, MATLAB, or PLAIN Namedescriptive name of the submatrix formated string representing the submatrix


format

public static String format(int[][] Mat,
                            int i1,
                            int i2,
                            int j1,
                            int j2,
                            int w,
                            int style,
                            String Name)
. \begin{tabb}Similar to the previous method, but for a matrix of \texttt{int}'s.
 \end{tabb}
Matmatrix to be formated i1index of the first row being formated i2index of the last row being formated j1index of the first column being formated j2index of the last column being formated wnumber of positions for each element styleformating style of the submatrix, being one of MATHEMATICA, MATLAB, or PLAIN Namedescriptive name of the submatrix formated string representing the submatrix


SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.