function blas1_c_test16 ( )

%*****************************************************************************80
%
%% TEST16 tests SCASUM.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    16 April 2006
%
%  Author:
%
%    John Burkardt
%
  ma = 5;
  na = 4;
  nx = 8;

  a = [ ...
    - 3.0 + 4.0 * i, ...
      2.0 + 0.0 * i, ...
      3.0 - 4.0 * i, ...
      2.0 + 0.0 * i; ...
      2.0 - 1.0 * i, ...
    - 1.0 + 1.0 * i, ...
      0.0 + 5.0 * i, ...
    - 4.0 - 2.0 * i; ...
    - 4.0 + 1.0 * i, ...
    - 4.0 - 3.0 * i, ...
      0.0 - 2.0 * i, ...
      1.0 + 3.0 * i; ...
    - 3.0 + 3.0 * i, ...
    - 3.0 + 3.0 * i, ...
    - 1.0 - 2.0 * i, ...
    - 1.0 + 2.0 * i; ...
      2.0 - 4.0 * i, ...
      0.0 - 1.0 * i, ...
      0.0 - 1.0 * i, ...
    - 2.0 + 4.0 * i ];
  x = [ ...
       2.0 - 1.0 * i, ...
     - 4.0 - 2.0 * i, ...
       3.0 + 1.0 * i, ...
       2.0 + 2.0 * i, ...
     - 1.0 - 1.0 * i, ...
     - 1.0 + 0.0 * i, ...
       0.0 - 3.0 * i, ...
       4.0 + 0.0 * i ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEST16\n' );
  fprintf ( 1, '  SCASUM adds the absolute values of elements\n' );
  fprintf ( 1, '  of a complex vector.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  X =\n' );
  fprintf ( 1, '\n' );
  for j = 1 : nx
    fprintf ( 1, '  %6d  %10f  %10f\n', j, real ( x(j) ), imag ( x(j) ) );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  SCASUM ( NX,   X, 1    ) = %f\n', ...
    scasum ( nx,   x, 1 ) );
  fprintf ( 1, '  SCASUM ( NX/2, X, 2    ) = %f\n', ...
    scasum ( nx/2, x, 2 ) );
  fprintf ( 1, '  SCASUM ( 2,    X, NX/2 ) = %f\n', ...
    scasum ( 2,    x, nx/2 ) );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Demonstrate with a matrix A:\n' );
  fprintf ( 1, '\n' );
  for j = 1 : ma
    for k = 1 : na
      fprintf ( 1, '  %10f  %10f\n', real ( a(j,k) ), imag ( a(j,k) ) );
    end
    fprintf ( 1, '\n' );
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  SCASUM ( MA, A(1:MA,2), 1 )   = %f\n', ...
    scasum ( ma, a(1:ma,2), 1 ) );
  fprintf ( 1, '  SCASUM ( NA, A(2,1:NA), 1 ) = %f\n', ...
    scasum ( na, a(2,1:na), 1 ) );

  return
end
