function value = halham_seed_check ( ndim, seed ) %% HALHAM_SEED_SET checks SEED for a Halton or Hammersley sequence. % % Modified: % % 21 September 2004 % % Author: % % John Burkardt % % Parameters: % % Input, integer NDIM, the spatial dimension. % % Input, integer SEED(1:NDIM), the seed of the leaped subsequence. % Each base should be greater than 1. % % Output, logical VALUE, is true if SEED is legal. % if ( any ( seed(1:ndim) < 0 ) ) fprintf ( 1, '\n' ); fprintf ( 1, 'HALHAM_SEED_CHECK - Fatal error!\n' ); fprintf ( 1, ' At least one of the input seeds is < 0!\n' ); value = 0; else value = 1; end