code: public static double trace( DMatrix1Row a ) {
          int N = Math.min(a.numRows, a.numCols);
          double sum = 0;
          int index = 0;
          for( int i = 0; i < N; i++ ) {
              sum += a.get(index);
              index += 1 + a.numCols;
          }
  
          return sum;
      }
docs: <p>
  This computes the trace of the matrix:<br>
  <br>
  trace = &sum;<sub>i=1:n</sub> { a<sub>ii</sub> }<br>
  where n = min(numRows,numCols)
  </p>
  
  @param a A square matrix.  Not modified.