function partial_digest_recur_test01 ( ) %*****************************************************************************80 % %% PARTIAL_DIGEST_RECUR_TEST01 tests PARTIAL_DIGEST_RECUR. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 10 January 2018 % % Author: % % John Burkardt % n = 5; nn2 = ( n * ( n - 1 ) ) / 2; % % Set the distance array. % dist = [ 2; 2; 3; 3; 4; 5; 6; 7; 8; 10 ]; fprintf ( 1, '\n' ); fprintf ( 1, 'PARTIAL_DIGEST_RECUR_TEST01\n' ); fprintf ( 1, ' PARTIAL_DIGEST_RECUR generates solutions to the partial\n' ); fprintf ( 1, ' digest problem, using recursion.\n' ); fprintf ( 1, '\n' ); fprintf ( 1, ' The number of objects to place is N = %d\n', n ); fprintf ( 1, '\n' ); fprintf ( 1, ' The original placement was 0,3,6,8,10.\n' ); fprintf ( 1, ' These placements generate the following distances:\n' ); i4vec_print ( nn2, dist, ' Distance array:' ); fprintf ( 1, '\n' ); fprintf ( 1, ' PARTIAL_DIGEST_RECUR may recover the original placements\n' ); fprintf ( 1, ' from the pairwise distances. It may also find other\n' ); fprintf ( 1, ' placements that have the same distance array.\n' ); partial_digest_recur ( n, dist ) return end