function [ w, x ] = gm_general_rule_set ( rule, m, n, t )

%*****************************************************************************80
%
%% gm_general_rule_set() sets a Grundmann-Moeller rule for a general simplex.
%
%  Discussion:
%
%    The vertices of the simplex are given by the array T.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    02 March 2017
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Axel Grundmann, Michael Moeller,
%    Invariant Integration Formulas for the N-Simplex 
%    by Combinatorial Methods,
%    SIAM Journal on Numerical Analysis,
%    Volume 15, Number 2, April 1978, pages 282-290.
%
%  Input:
%
%    integer RULE, the index of the rule.
%    0 <= RULE.
%
%    integer M, the spatial dimension.
%    1 <= M.
%
%    integer N, the number of points in the rule.
%
%    real T(M,M+1), the vertices of the simplex.
%
%  Output:
%
%    real W(N), the weights.
%
%    real X(M,N), the abscissas.
%

%
%  Get the unit rule.
%
  [ w1, x1 ] = gm_unit_rule_set ( rule, m, n );
%
%  Compute the volume of the unit simplex.
%
  volume1 = simplex_unit_volume ( m );
%
%  Compute the volume of the general simplex.
%
  volume = simplex_general_volume ( m, t );
%
%  Convert the points.
%
  x = simplex_unit_to_general ( m, n, t, x1 );
%
%  Convert the weights.
%
  w = w1 * volume / volume1;

  return
end
