// Uses realloc to grow a matrix, by Tim Jones @ Drexel University

double **mreal(double **matrix, int r, int c, int count)
{
  
  //Resizes n x m matrix created with mmatrix.c

  //Resizes row only...can modify to resize columns;
  //r is not used, but we keep it here for book keeping
  //and generality for future possible uses.

  int row, col;
  matrix=(double **)realloc((double **)matrix, ((size_t)(count * sizeof(double *))));
  assert(matrix != NULL);
  
  for (row = count-1; row < count; row++) 
     {
       matrix[row] = (double *)malloc((size_t)(c * sizeof(double)));
       assert(matrix[row] != NULL);
      }
  return matrix;
}

