function legendre_combo_norm ( c )

%*****************************************************************************80
%
%% legendre_combo_norm computes the norm of a Legendre combination.
%
%  Input:
%
%    real c(d+1): the coefficients of a combination of Legendre polynomials.
%
  c = c(:);

  d = length ( c ) - 1;
%
%  V = value of c0 * p0 + c1 * p1 + ... + cd * pd.
%
  v = legendre_combo_value ( c, x );
%
%  Q = integral v^2.
%
  q = integral ( @(x) ( legendre_combo_value ( c, x ) ).^2, -1.0, +1.0 );
%
%  Norm = sqrt ( integral v^2 ).
%
  vnorm = sqrt ( q );
  fprintf ( 1, '  ||v||          = %g\n', vnorm );
%
%  Compare with norm of c*pn:
%
  pn = zeros ( d, 1 );
  for i = 0 : d
    pn(i+1) = sqrt ( integral ( @(x) ( legendre_value(i,x)).^2, -1.0, +1.0 ) );
  end

  cnorm = sqrt ( sum ( ( c .* pn ).^2 ) );

  fprintf ( 1, '  sqrt(sum(c^2)) = %g\n', cnorm );

  return
end

