function Age = st_to_ge ( nst, ist, jst, Ast )

%*****************************************************************************80
%
%% st_to_ge() converts ST matrix data to GE format.
%
%  Discussion:
%
%    In the ST format, we allow the possibility that the same matrix
%    entry (I,J) has been listed several times.  The GE format sums those
%    values.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    16 March 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer NST, the number of ST elements.
%
%    integer IST(NST), JST(NST), the ST rows and columns.
%
%    real Ast(NST), the ST values.
%
%  Output:
%
%    real Age(M,N), the CCS values.
%
  m = max ( ist );
  n = max ( jst );
  Age = zeros ( m, n );

  for kst = 1 : nst

    i = ist(kst);
    j = jst(kst);
    Age(i,j) = Age(i,j) + Ast(kst);

  end

  return
end
