\section{Matrix  Class Reference}
\label{class_Matrix}\index{Matrix@{Matrix}}
{\tt \#include $<$matrix.h$>$}

\subsection*{Public Methods}
\begin{CompactItemize}
\item 
{\bf Matrix} ()
\item 
{\bf Matrix} (int in\_\-Rows, int in\_\-Cols)
\item 
{\bf Matrix} (const Matrix \&m)
\item 
{\bf $\sim$Matrix} ()
\item 
Matrix\& {\bf operator=} (const Matrix \&m)
\item 
double\& {\bf operator()} (int row, int col)
\item 
const double\& {\bf operator()} (int row, int col) const
\item 
double\& {\bf operator()} (int row)
\item 
const double\& {\bf operator()} (int row) const
\item 
void {\bf set\-Size} (int Rows, int Cols)
\item 
int {\bf get\-Rows} () const
\item 
int {\bf get\-Cols} () const
\item 
void {\bf zero} ()
\item 
void {\bf identity} ()
\item 
void {\bf swap\-Rows} (int row1, int row2)
\item 
void {\bf swap\-Cols} (int col1, int col2)
\item 
Matrix {\bf sub\-Matrix} (int row1, int row2, int col1, int col2) const
\item 
Matrix {\bf sub\-Matrix} (int row, int col) const
\begin{CompactList}\small\item\em excludes row and col only -- the rest is transferred.\item\end{CompactList}\item 
Matrix {\bf transpose} () const
\item 
Matrix {\bf t} () const
\item 
Matrix {\bf operator+} (const Matrix \&m) const
\item 
Matrix {\bf operator-} (const Matrix \&m) const
\item 
Matrix {\bf operator $\ast$} (double d) const
\item 
Matrix {\bf operator $\ast$} (const Matrix \&m) const
\item 
double {\bf det} () const
\begin{CompactList}\small\item\em NOTE: this is an inefficient implementation (Gauss-Jordan would probably be faster).\item\end{CompactList}\item 
double {\bf tr} () const
\item 
double {\bf Sum} () const
\item 
double {\bf Sum\-Absolute\-Value} () const
\item 
void {\bf find\-Eigen\-Vectors} (Matrix \&eigen\-Values, Matrix \&eigen\-Vectors) const
\item 
ostream\& {\bf Pretty\-Print} (ostream \&os)
\begin{CompactList}\small\item\em pretty print normal numbers.\item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
int {\bf rows}
\item 
int {\bf cols}
\item 
double$\ast$ {\bf data}
\end{CompactItemize}


\subsection{Constructor \& Destructor Documentation}
\index{Matrix@{Matrix}!Matrix@{Matrix}}
\index{Matrix@{Matrix}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix::Matrix ()}\label{class_Matrix_a0}




Definition at line 9 of file matrix.C.\footnotesize\begin{verbatim}00009                {
00010   rows = cols = 0;
00011   data = 0;
00012 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!Matrix@{Matrix}}
\index{Matrix@{Matrix}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix::Matrix (int {\em in\_\-Rows}, int {\em in\_\-Cols})}\label{class_Matrix_a1}




Definition at line 14 of file matrix.C.\footnotesize\begin{verbatim}00014                                        {
00015   rows = in_Rows;
00016   cols = in_Cols;
00017   data = new double[rows*cols];
00018 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!Matrix@{Matrix}}
\index{Matrix@{Matrix}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix::Matrix (const Matrix \& {\em m})}\label{class_Matrix_a2}




Definition at line 20 of file matrix.C.\footnotesize\begin{verbatim}00020                               {
00021   rows = m.rows;
00022   cols = m.cols;
00023   data = new double[rows*cols];
00024   for (int i = 0; i < rows*cols; i++)
00025     data[i] = m.data[i];
00026 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!~Matrix@{$\sim$Matrix}}
\index{~Matrix@{$\sim$Matrix}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix::$\sim$Matrix ()}\label{class_Matrix_a3}




Definition at line 28 of file matrix.C.\footnotesize\begin{verbatim}00028                 {
00029   delete[] data;
00030   data = 0;
00031 \end{verbatim}\normalsize 


\subsection{Member Function Documentation}
\index{Matrix@{Matrix}!PrettyPrint@{PrettyPrint}}
\index{PrettyPrint@{PrettyPrint}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ostream \& Matrix::Pretty\-Print (ostream \& {\em os})}\label{class_Matrix_a29}


pretty print normal numbers.



Definition at line 388 of file matrix.C.

Referenced by Envelope\-Constraint::Find\-Model\-Rotation().\footnotesize\begin{verbatim}00388                                          {
00389   for (int row = 1; row <= getRows(); row++) {
00390     os << setprecision(4) << "[ ";
00391     for (int col = 1; col <= getCols(); col++){
00392       if (fabs((*this)(row,col)> 1e-10))
00393         os << setw(8) << ($\ast$this)(row,col) << " ";
00394       else
00395         os << "0.000000 ";
00396     }
00397     os << "]" << endl;
00398   }
00399 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!Sum@{Sum}}
\index{Sum@{Sum}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Matrix::Sum () const}\label{class_Matrix_a26}




Definition at line 159 of file matrix.C.\footnotesize\begin{verbatim}00159                          {
00160 
00161   double rv = 0;
00162   for (int row = 1; row <= rows; row++)
00163     for (int col = 1; col <= cols; col++)
00164       rv += ($\ast$this)(row,col);
00165 
00166   return rv;
00167   
00168 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!SumAbsoluteValue@{SumAbsoluteValue}}
\index{SumAbsoluteValue@{SumAbsoluteValue}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Matrix::Sum\-Absolute\-Value () const}\label{class_Matrix_a27}




Definition at line 170 of file matrix.C.\footnotesize\begin{verbatim}00170                                       {
00171 
00172   double rv = 0;
00173   for (int row = 1; row <= rows; row++)
00174     for (int col = 1; col <= cols; col++)
00175       rv += fabs((*this)(row,col));
00176 
00177   return rv;
00178   
00179 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!det@{det}}
\index{det@{det}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Matrix::det () const}\label{class_Matrix_a24}


NOTE: this is an inefficient implementation (Gauss-Jordan would probably be faster).



Definition at line 332 of file matrix.C.\footnotesize\begin{verbatim}00332                          {  
00333   if (rows != cols) {
00334     DIE("Matrix det() on non-square matrix");
00335   }
00336 
00337   // Anton p.71
00338   if (rows == 1)
00339     return ($\ast$this)(1,1);  
00340   
00341   if (rows == 2)
00342     return ($\ast$this)(1,1)*($\ast$this)(2,2)-($\ast$this)(1,2)*($\ast$this)(2,1);  
00343   
00344   if (rows == 3) {
00345     return \
00346       ($\ast$this)(1,1)*($\ast$this)(2,2)*($\ast$this)(3,3) \
00347       + ($\ast$this)(1,2)*($\ast$this)(2,3)*($\ast$this)(3,1) \
00348       + ($\ast$this)(1,3)*($\ast$this)(2,1)*($\ast$this)(3,2) \
00349       - ($\ast$this)(1,3)*($\ast$this)(2,2)*($\ast$this)(3,1) \
00350       - ($\ast$this)(1,2)*($\ast$this)(2,1)*($\ast$this)(3,3) \
00351       - ($\ast$this)(1,1)*($\ast$this)(2,3)*($\ast$this)(3,2) ;
00352   }
00353 
00354   DIE("Det is not working > 3x3 -- FIX");
00355   double sum = 0;
00356   for (int i = 1; i < cols; i++) {
00357 
00358     if (odd(i))
00359       sum += ($\ast$this)(1,i) * subMatrix(1,i).det();
00360     else
00361       sum -= ($\ast$this)(1,i) * subMatrix(1,i).det();
00362 
00363   }
00364 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!findEigenVectors@{findEigenVectors}}
\index{findEigenVectors@{findEigenVectors}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Matrix::find\-Eigen\-Vectors (Matrix \& {\em eigen\-Values}, Matrix \& {\em eigen\-Vectors}) const}\label{class_Matrix_a28}




Definition at line 230 of file matrix.C.

Referenced by Envelope::Calc\_\-Eigenvectors(), and Envelope\-Constraint::Find\-Model\-Rotation().\footnotesize\begin{verbatim}00230                                                                              {
00231   if (rows != cols) {
00232     DIE("Matrix::findEigenVectors matrix must be square");
00233   }
00234   int i, j, row, col, n = rows, nrot = 0;
00235   Matrix a=*this,b(n,1),z(n,1);
00236   double tresh,theta,tau,t,s,h,g,c;
00237 
00238   eigenValues.setSize(n,1);
00239   eigenVectors.setSize(n,n);
00240   eigenVectors.identity();
00241   // initialize b and d to diagonal
00242   for (i = 1; i <= n; i++) {
00243     b(i,1) = eigenValues(i,1) = a(i,i);
00244     z(i,1) = 0;
00245   }
00246   for (i = 1; i <= 50; i++) {
00247     double sum = 0;
00248     // sum off diagonal elements
00249     for (row = 1; row <= n-1; row++)
00250       for (col = row+1; col <= n; col++)
00251         sum += fabs(a(row,col));
00252     if (sum == 0) {  // normal return (relies on quadratic convergence to machine underflow)
00253       // sort eigenvalues and eigenvectors in descending order
00254       bool keepGoing=true;
00255       while (keepGoing) {
00256         keepGoing = false;
00257         for (row = 1; row <= n-1; row++)
00258           if (eigenValues(row,1) < eigenValues(row+1,1)) {
00259             eigenValues.swapRows(row,row+1);
00260             eigenVectors.swapCols(row,row+1);
00261             keepGoing = true;
00262           }
00263       }
00264       return;
00265     }
00266     if (i < 4)
00267       tresh = 0.2*sum/sq(n);  // first three steps
00268     else
00269       tresh = 0;              // thereafter
00270     for (row = 1; row <= n-1; row++)
00271       for (col = row+1; col <= n; col++) {
00272         g = 100*fabs(a(row,col));
00273         // after 4 sweeps, skip rotation if off-diagonal element is small
00274         if ((i > 4) && (fabs(eigenValues(row,1)+g) == fabs(eigenValues(row,1))) && 
00275                        (fabs(eigenValues(col,1)+g) == fabs(eigenValues(col,1))))
00276           a(row,col) = 0;
00277         else if (fabs(a(row,col)) > tresh) {
00278           h = eigenValues(col,1) - eigenValues(row,1);
00279           if (fabs(h)+g == fabs(h))
00280             t = a(row,col)/h;
00281           else {
00282             theta = 0.5*h/a(row,col);
00283             t = 1.0/(fabs(theta)+sqrt(1.0+sq(theta)));
00284             if (theta < 0.0)  t = -t;
00285           }
00286           c = 1.0/sqrt(1+sq(t));
00287           s = t*c;
00288           tau = s/(1.0+c);
00289           h = t*a(row,col);
00290           z(row,1) -= h;
00291           z(col,1) += h;
00292           eigenValues(row,1) -= h;
00293           eigenValues(col,1) += h;
00294           a(row,col) = 0;
00295           for (j = 1; j <= row-1; j++) {
00296             g = a(j,row);
00297             h = a(j,col);
00298             a(j,row) = g-s*(h+g*tau);
00299             a(j,col) = h+s*(g-h*tau);
00300           }
00301           for (j = row+1; j <= col-1; j++) {
00302             g = a(row,j);
00303             h = a(j,col);
00304             a(row,j) = g-s*(h+g*tau);
00305             a(j,col) = h+s*(g-h*tau);
00306           }
00307           for (j = col+1; j <= n; j++) {
00308             g = a(row,j);
00309             h = a(col,j);
00310             a(row,j) = g-s*(h+g*tau);
00311             a(col,j) = h+s*(g-h*tau);
00312           }
00313           for (j = 1; j <= n; j++) {
00314             g = eigenVectors(j,row);
00315             h = eigenVectors(j,col);
00316             eigenVectors(j,row) = g-s*(h+g*tau);
00317             eigenVectors(j,col) = h+s*(g-h*tau);
00318           }
00319           nrot++;
00320         }
00321       }
00322     for (int row = 1; row <= n; row++) {
00323       b(row,1) += z(row,1);
00324       eigenValues(row,1) = b(row,1);
00325       z(row,1) = 0;
00326     }
00327   }
00328 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!getCols@{getCols}}
\index{getCols@{getCols}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Matrix::get\-Cols () const\hspace{0.3cm}{\tt  [inline]}}\label{class_Matrix_a11}




Definition at line 42 of file matrix.h.

Referenced by Pretty\-Print(), operator $\ast$(), and operator$<$$<$().\footnotesize\begin{verbatim}00042                       { return cols; }
00043 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!getRows@{getRows}}
\index{getRows@{getRows}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Matrix::get\-Rows () const\hspace{0.3cm}{\tt  [inline]}}\label{class_Matrix_a10}




Definition at line 41 of file matrix.h.

Referenced by Pretty\-Print(), operator $\ast$(), and operator$<$$<$().\footnotesize\begin{verbatim}00041                       { return rows; }
00042 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!identity@{identity}}
\index{identity@{identity}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Matrix::identity ()}\label{class_Matrix_a13}




Definition at line 104 of file matrix.C.

Referenced by Envelope\-Constraint::Align\-Princ\-Comp(), and find\-Eigen\-Vectors().\footnotesize\begin{verbatim}00104                       {
00105   if (rows != cols) {
00106     DIE("Matrix must be square to make identity");
00107   }
00108 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator *@{operator $\ast$}}
\index{operator *@{operator $\ast$}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::operator $\ast$ (const Matrix \& {\em m}) const}\label{class_Matrix_a23}




Definition at line 212 of file matrix.C.\footnotesize\begin{verbatim}00212                                               {
00213   if (cols != m.rows) {
00214     DIE("Matrix multiplication left side cols != right side rows");
00215   }
00216   Matrix result(rows,m.cols);
00217   for (int row = 1; row <= rows; row++)
00218     for (int col = 1; col <= m.cols; col++) {
00219       double sum = 0;
00220       for (int i = 1; i <= cols; i++)
00221         sum += ($\ast$this)(row,i) * m(i,col);
00222       result(row,col) = sum;
00223     }
00224 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator *@{operator $\ast$}}
\index{operator *@{operator $\ast$}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::operator $\ast$ (double {\em d}) const}\label{class_Matrix_a22}




Definition at line 182 of file matrix.C.\footnotesize\begin{verbatim}00182                                        {
00183   Matrix result(rows,cols);
00184   for (int row = 1; row <= rows; row++)
00185     for (int col = 1; col <= cols; col++)
00186       result(row,col) = d * ($\ast$this)(row,col);
00187   return result;
00188 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator()@{operator()}}
\index{operator()@{operator()}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const double \& Matrix::operator() (int {\em row}) const}\label{class_Matrix_a8}




Definition at line 75 of file matrix.C.\footnotesize\begin{verbatim}00075                                              {
00076   if (rows == 1 || cols == 1) {
00077     if ((row < 1) || (row > rows)) {
00078       DIE("Matrix access out of bounds");
00079     }
00080     return data[row-1];
00081     
00082   } else {
00083     DIE("Matrix singular access on 2D Matrix");
00084     return data[row-1];
00085   }
00086 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator()@{operator()}}
\index{operator()@{operator()}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double \& Matrix::operator() (int {\em row})}\label{class_Matrix_a7}




Definition at line 60 of file matrix.C.\footnotesize\begin{verbatim}00060                                  {
00061   if (rows == 1 || cols == 1) {
00062     if ((row < 1) || (row > rows)) {
00063       DIE("Matrix access out of bounds");
00064     }
00065     return data[row-1];
00066     
00067   } else {
00068     DIE("Matrix singular access on 2D Matrix");
00069     return data[row-1];
00070   }
00071 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator()@{operator()}}
\index{operator()@{operator()}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const double \& Matrix::operator() (int {\em row}, int {\em col}) const}\label{class_Matrix_a6}




Definition at line 53 of file matrix.C.\footnotesize\begin{verbatim}00053                                                        {
00054   if ((row < 1) || (row > rows) || (col < 1) || (col > cols)) {
00055     DIE("Matrix access out of bounds");
00056   }
00057 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator()@{operator()}}
\index{operator()@{operator()}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double \& Matrix::operator() (int {\em row}, int {\em col})}\label{class_Matrix_a5}




Definition at line 46 of file matrix.C.\footnotesize\begin{verbatim}00046                                            {
00047   if ((row < 1) || (row > rows) || (col < 1) || (col > cols)) {
00048     DIE("Matrix access out of bounds");
00049   }
00050 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator+@{operator+}}
\index{operator+@{operator+}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::operator+ (const Matrix \& {\em m}) const}\label{class_Matrix_a20}




Definition at line 190 of file matrix.C.\footnotesize\begin{verbatim}00190                                               {
00191   if ((cols != m.cols) || (rows != m.rows)) {
00192     DIE("Matrix addition sizes are different");
00193   }
00194 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator-@{operator-}}
\index{operator-@{operator-}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::operator- (const Matrix \& {\em m}) const}\label{class_Matrix_a21}




Definition at line 201 of file matrix.C.\footnotesize\begin{verbatim}00201                                               {
00202   if ((cols != m.cols) || (rows != m.rows)) {
00203     DIE("Matrix subtraction sizes are different");
00204   }
00205 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!operator=@{operator=}}
\index{operator=@{operator=}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix \& Matrix::operator= (const Matrix \& {\em m})}\label{class_Matrix_a4}




Definition at line 33 of file matrix.C.\footnotesize\begin{verbatim}00033                                          {
00034   if (this == &m)  return *this;  // handle self-assignment
00035   if (data)
00036     delete[] data;
00037 
00038   rows = m.rows;
00039   cols = m.cols;
00040   data = new double[rows*cols];
00041   for (int i = 0; i < rows*cols; i++)
00042     data[i] = m.data[i];
00043   return *this;
00044 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!setSize@{setSize}}
\index{setSize@{setSize}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Matrix::set\-Size (int {\em Rows}, int {\em Cols})}\label{class_Matrix_a9}




Definition at line 89 of file matrix.C.

Referenced by find\-Eigen\-Vectors().\footnotesize\begin{verbatim}00089                                        {
00090   if (data)
00091     delete[] data;
00092   rows = Rows;
00093   cols = Cols;
00094   data = new double[rows*cols];  
00095 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!subMatrix@{subMatrix}}
\index{subMatrix@{subMatrix}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::sub\-Matrix (int {\em row}, int {\em col}) const}\label{class_Matrix_a17}


excludes row and col only -- the rest is transferred.



Definition at line 135 of file matrix.C.\footnotesize\begin{verbatim}00135                                                {
00136   Matrix result(rows-1,cols-1);
00137   int row2 = 1, col2 = 1;
00138   int row1 = 1, col1 = 1;
00139   for (row1 = 1; row1 <= rows; row1++) {
00140     col2 = 1;
00141     for (col1 = 1; col1 <= cols; col1++) {
00142       if ((row1 != row) && (col1 != col))
00143         result(row2,col2) = ($\ast$this)(row1,col1);
00144       if (col1 != col)  col2++;
00145     }
00146     if (row1 != row)  row2++;
00147   }
00148 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!subMatrix@{subMatrix}}
\index{subMatrix@{subMatrix}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::sub\-Matrix (int {\em row1}, int {\em row2}, int {\em col1}, int {\em col2}) const}\label{class_Matrix_a16}




Referenced by det().\index{Matrix@{Matrix}!swapCols@{swapCols}}
\index{swapCols@{swapCols}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Matrix::swap\-Cols (int {\em col1}, int {\em col2})}\label{class_Matrix_a15}




Definition at line 121 of file matrix.C.

Referenced by find\-Eigen\-Vectors().\footnotesize\begin{verbatim}00121                                         {
00122   for (int row = 1; row <= rows; row++)
00123     util_swap((*this)(row,col1),($\ast$this)(row,col2));
00124 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!swapRows@{swapRows}}
\index{swapRows@{swapRows}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Matrix::swap\-Rows (int {\em row1}, int {\em row2})}\label{class_Matrix_a14}




Definition at line 116 of file matrix.C.

Referenced by find\-Eigen\-Vectors().\footnotesize\begin{verbatim}00116                                         {
00117   for (int col = 1; col <= cols; col++)
00118     util_swap((*this)(row1,col),($\ast$this)(row2,col));
00119 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!t@{t}}
\index{t@{t}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::t () const\hspace{0.3cm}{\tt  [inline]}}\label{class_Matrix_a19}




Definition at line 81 of file matrix.h.

Referenced by Envelope\-Constraint::Find\-Model\-Rotation().\footnotesize\begin{verbatim}00081                               {return transpose();}
00082 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!tr@{tr}}
\index{tr@{tr}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double Matrix::tr () const}\label{class_Matrix_a25}




Definition at line 368 of file matrix.C.

Referenced by Envelope\-Constraint::Find\-Model\-Rotation().\footnotesize\begin{verbatim}00368                         {
00369 
00370   if (rows == 1)
00371     return ($\ast$this)(1,1);  
00372   
00373   if (rows == 2)
00374     return ($\ast$this)(1,1)+($\ast$this)(2,2);
00375   
00376   if (rows == 3) {
00377     return ($\ast$this)(1,1)+($\ast$this)(2,2)+($\ast$this)(3,3);
00378   }
00379 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!transpose@{transpose}}
\index{transpose@{transpose}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Matrix Matrix::transpose () const}\label{class_Matrix_a18}




Definition at line 151 of file matrix.C.

Referenced by t().\footnotesize\begin{verbatim}00151                                {
00152   Matrix result(cols,rows);
00153   for (int row = 1; row <= rows; row++)
00154     for (int col = 1; col <= cols; col++)
00155       result(col,row) = ($\ast$this)(row,col);
00156   return result;
00157 \end{verbatim}\normalsize 
\index{Matrix@{Matrix}!zero@{zero}}
\index{zero@{zero}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Matrix::zero ()}\label{class_Matrix_a12}




Definition at line 97 of file matrix.C.

Referenced by Envelope::Calc\_\-Eigenvectors(), and Envelope\-Constraint::Find\-Model\-Rotation().\footnotesize\begin{verbatim}00097                   {
00098   for (int row = 1; row <= rows; row++)
00099     for (int col = 1; col <= cols; col++)
00100       //      (*this)(row,col) = 0;
00101       data[(col-1)+(row-1)*cols] = 0;
00102 \end{verbatim}\normalsize 


\subsection{Member Data Documentation}
\index{Matrix@{Matrix}!cols@{cols}}
\index{cols@{cols}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Matrix::cols\hspace{0.3cm}{\tt  [private]}}\label{class_Matrix_o1}




Definition at line 76 of file matrix.h.\index{Matrix@{Matrix}!data@{data}}
\index{data@{data}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double $\ast$ Matrix::data\hspace{0.3cm}{\tt  [private]}}\label{class_Matrix_o2}




Definition at line 77 of file matrix.h.\index{Matrix@{Matrix}!rows@{rows}}
\index{rows@{rows}!Matrix@{Matrix}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Matrix::rows\hspace{0.3cm}{\tt  [private]}}\label{class_Matrix_o0}




Definition at line 75 of file matrix.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
{\bf matrix.h}\item 
{\bf matrix.C}\end{CompactItemize}
