// ----------------------------------------------------------------------------------------
  public double[] getAllMatrixData() {
    if (matrix == null) {
      System.out.println("The R goose has not received a matrix broadcast.");
      return new double[0];
    }

    int rowCount = matrix.getRowCount();
    int columnCount = matrix.getColumnCount();
    int total = rowCount * columnCount;
    double result[] = new double[total];

    for (int r = 0; r < rowCount; r++) {
      double[] rowValues = matrix.get(r);
      int toPosition = r * columnCount;
      System.arraycopy(rowValues, 0, result, toPosition, columnCount);
    } // for r

    return result;
  } // getAllMatrixData
 // ----------------------------------------------------------------------------------------
 public int getMatrixRowCount() {
   if (matrix == null) return 0;
   else return matrix.getRowCount();
 }