function c = correlation_cosine_damped ( n, rho, rho0, omega )

%*****************************************************************************80
%
%% correlation_cosine_damped() evaluates the damped cosine correlation function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 November 2012
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Petter Abrahamsen,
%    A Review of Gaussian Random Fields and Correlation Functions,
%    Norwegian Computing Center, 1997.
%
%  Input:
%
%    integer N, the number of arguments.
%
%    real RHO(N), the arguments.
%
%    real RHO0, the correlation length.
%
%    real OMEGA, an angular scale factor, which defaults to 1.
%
%  Output:
%
%    real C(N), the correlations.
%
  if ( nargin < 4 )
    omega = 1.0;
  end

  rhohat = rho / rho0;

  c = exp ( - rhohat ) * cos ( omega * rhohat );

  return
end


  
