function a_ge = r83v_to_r8ge ( m, n, a_83v, b_83v, c_83v )

%*****************************************************************************80
%
%% R83V_TO_R8GE copies an R83V matrix to a R8GE matrix.
%
%  Discussion:
%
%    The R83V storage format is used for a tridiagonal matrix.
%    The subdiagonal is in A(min(M-1,N)).
%    The diagonal is in B(min(M,N)).
%    The superdiagonal is in C(min(M,N-1)).
%
%  Example:
%
%    An R83V matrix of order 3x5 would be stored:
%
%      B1  C1  **  **  **
%      A1  B2  C2  **  **
%      **  A2  B3  C3  **
%
%    An R83 matrix of order 5x5 would be stored:
%
%      B1  C1  **  **  **
%      A1  B2  C2  **  **
%      **  A2  B3  C3  **
%      **  **  A3  B4  C4
%      **  **  **  A4  B5
%
%    An R83 matrix of order 5x3 would be stored:
%
%      B1  C1  **
%      A1  B2  C2
%      **  A2  B3
%      **  **  A3
%      **  **  **
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 February 2016
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order of the matrix.
%    N must be at least 2.
%
%    Input, real A_83V(min(M-1,N)), B_83V(min(M,N)), C_83V(min(M,N-1)), 
%    the R83V matrix.
%
%    Output, real A_GE(M,N), the R8GE matrix.
%
  a_ge = zeros ( m, n );

  for k = 1 : min ( m - 1, n )
    a_ge(k+1,k) = a_83v(k);
  end

  for k = 1 : min ( m, n )
    a_ge(k,k) = b_83v(k);
  end

  for k = 1 : min ( m, n - 1 )
    a_ge(k,k+1) = c_83v(k);
  end

  return
end
