Thu Apr 23 14:22:31 2015

SIMPLEX_GRID_TEST
  Python version:
  Test the SIMPLEX_GRID library.

COMP_NEXT_GRLEX_TEST
  A COMP is a composition of an integer N into K parts.
  Each part is nonnegative.  The order matters.
  COMP_NEXT_GRLEX determines the next COMP in
  graded lexicographic (grlex) order.

  Rank:     NC       COMP
  ----:     --   ------------
     1:       0 =   0 +   0 +   0
  ----:     --   ------------
     2:       1 =   0 +   0 +   1
     3:       1 =   0 +   1 +   0
     4:       1 =   1 +   0 +   0
  ----:     --   ------------
     5:       2 =   0 +   0 +   2
     6:       2 =   0 +   1 +   1
     7:       2 =   0 +   2 +   0
     8:       2 =   1 +   0 +   1
     9:       2 =   1 +   1 +   0
    10:       2 =   2 +   0 +   0
  ----:     --   ------------
    11:       3 =   0 +   0 +   3
    12:       3 =   0 +   1 +   2
    13:       3 =   0 +   2 +   1
    14:       3 =   0 +   3 +   0
    15:       3 =   1 +   0 +   2
    16:       3 =   1 +   1 +   1
    17:       3 =   1 +   2 +   0
    18:       3 =   2 +   0 +   1
    19:       3 =   2 +   1 +   0
    20:       3 =   3 +   0 +   0
  ----:     --   ------------
    21:       4 =   0 +   0 +   4
    22:       4 =   0 +   1 +   3
    23:       4 =   0 +   2 +   2
    24:       4 =   0 +   3 +   1
    25:       4 =   0 +   4 +   0
    26:       4 =   1 +   0 +   3
    27:       4 =   1 +   1 +   2
    28:       4 =   1 +   2 +   1
    29:       4 =   1 +   3 +   0
    30:       4 =   2 +   0 +   2
    31:       4 =   2 +   1 +   1
    32:       4 =   2 +   2 +   0
    33:       4 =   3 +   0 +   1
    34:       4 =   3 +   1 +   0
    35:       4 =   4 +   0 +   0
  ----:     --   ------------
    36:       5 =   0 +   0 +   5
    37:       5 =   0 +   1 +   4
    38:       5 =   0 +   2 +   3
    39:       5 =   0 +   3 +   2
    40:       5 =   0 +   4 +   1
    41:       5 =   0 +   5 +   0
    42:       5 =   1 +   0 +   4
    43:       5 =   1 +   1 +   3
    44:       5 =   1 +   2 +   2
    45:       5 =   1 +   3 +   1
    46:       5 =   1 +   4 +   0
    47:       5 =   2 +   0 +   3
    48:       5 =   2 +   1 +   2
    49:       5 =   2 +   2 +   1
    50:       5 =   2 +   3 +   0
    51:       5 =   3 +   0 +   2
    52:       5 =   3 +   1 +   1
    53:       5 =   3 +   2 +   0
    54:       5 =   4 +   0 +   1
    55:       5 =   4 +   1 +   0
    56:       5 =   5 +   0 +   0
  ----:     --   ------------
    57:       6 =   0 +   0 +   6
    58:       6 =   0 +   1 +   5
    59:       6 =   0 +   2 +   4
    60:       6 =   0 +   3 +   3
    61:       6 =   0 +   4 +   2
    62:       6 =   0 +   5 +   1
    63:       6 =   0 +   6 +   0
    64:       6 =   1 +   0 +   5
    65:       6 =   1 +   1 +   4
    66:       6 =   1 +   2 +   3
    67:       6 =   1 +   3 +   2
    68:       6 =   1 +   4 +   1
    69:       6 =   1 +   5 +   0
    70:       6 =   2 +   0 +   4
    71:       6 =   2 +   1 +   3

COMP_NEXT_GRLEX_TEST:
  Normal end of execution.

COMP_RANDOM_TEST
  COMP_RANDOM generates random compositions.

   0    4    1    0    5 
   1    4    2    0    3 
   2    0    2    6    0 
   2    2    3    0    3 
   1    3    1    5    0 

COMP_RANDOM_TEST:
  Normal end of execution.

COMP_RANDOM_GRLEX_TEST
  A COMP is a composition of an integer N into K parts.
  Each part is nonnegative.  The order matters.
  COMP_RANDOM_GRLEX selects a random COMP in
  graded lexicographic (grlex) order between indices RANK1 and RANK2.

    28:       4 =   1 +   2 +   1
    59:       6 =   0 +   2 +   4
    54:       5 =   4 +   0 +   1
    43:       5 =   1 +   1 +   3
    37:       5 =   0 +   1 +   4

COMP_RANDOM_GRLEX_TEST:
  Normal end of execution.

COMP_RANK_GRLEX_TEST
  A COMP is a composition of an integer N into K parts.
  Each part is nonnegative.  The order matters.
  COMP_RANK_GRLEX determines the rank of a COMP
  from its parts.

        Actual  Inferred
  Test    Rank      Rank

     0      28        28
     1      59        59
     2      54        54
     3      43        43
     4      37        37

COMP_RANK_GRLEX_TEST:
  Normal end of execution.

COMP_UNRANK_GRLEX_TEST
  A COMP is a composition of an integer N into K parts.
  Each part is nonnegative.  The order matters.
  COMP_UNRANK_GRLEX determines the parts
  of a COMP from its rank.

  Rank: ->  NC       COMP    
  ----:     --   ------------ 
     1:       0 =   0 +   0 +   0
  ----:     --   ------------
     2:       1 =   0 +   0 +   1
     3:       1 =   0 +   1 +   0
     4:       1 =   1 +   0 +   0
  ----:     --   ------------
     5:       2 =   0 +   0 +   2
     6:       2 =   0 +   1 +   1
     7:       2 =   0 +   2 +   0
     8:       2 =   1 +   0 +   1
     9:       2 =   1 +   1 +   0
    10:       2 =   2 +   0 +   0
  ----:     --   ------------
    11:       3 =   0 +   0 +   3
    12:       3 =   0 +   1 +   2
    13:       3 =   0 +   2 +   1
    14:       3 =   0 +   3 +   0
    15:       3 =   1 +   0 +   2
    16:       3 =   1 +   1 +   1
    17:       3 =   1 +   2 +   0
    18:       3 =   2 +   0 +   1
    19:       3 =   2 +   1 +   0
    20:       3 =   3 +   0 +   0
  ----:     --   ------------
    21:       4 =   0 +   0 +   4
    22:       4 =   0 +   1 +   3
    23:       4 =   0 +   2 +   2
    24:       4 =   0 +   3 +   1
    25:       4 =   0 +   4 +   0
    26:       4 =   1 +   0 +   3
    27:       4 =   1 +   1 +   2
    28:       4 =   1 +   2 +   1
    29:       4 =   1 +   3 +   0
    30:       4 =   2 +   0 +   2
    31:       4 =   2 +   1 +   1
    32:       4 =   2 +   2 +   0
    33:       4 =   3 +   0 +   1
    34:       4 =   3 +   1 +   0
    35:       4 =   4 +   0 +   0
  ----:     --   ------------
    36:       5 =   0 +   0 +   5
    37:       5 =   0 +   1 +   4
    38:       5 =   0 +   2 +   3
    39:       5 =   0 +   3 +   2
    40:       5 =   0 +   4 +   1
    41:       5 =   0 +   5 +   0
    42:       5 =   1 +   0 +   4
    43:       5 =   1 +   1 +   3
    44:       5 =   1 +   2 +   2
    45:       5 =   1 +   3 +   1
    46:       5 =   1 +   4 +   0
    47:       5 =   2 +   0 +   3
    48:       5 =   2 +   1 +   2
    49:       5 =   2 +   2 +   1
    50:       5 =   2 +   3 +   0
    51:       5 =   3 +   0 +   2
    52:       5 =   3 +   1 +   1
    53:       5 =   3 +   2 +   0
    54:       5 =   4 +   0 +   1
    55:       5 =   4 +   1 +   0
    56:       5 =   5 +   0 +   0
  ----:     --   ------------
    57:       6 =   0 +   0 +   6
    58:       6 =   0 +   1 +   5
    59:       6 =   0 +   2 +   4
    60:       6 =   0 +   3 +   3
    61:       6 =   0 +   4 +   2
    62:       6 =   0 +   5 +   1
    63:       6 =   0 +   6 +   0
    64:       6 =   1 +   0 +   5
    65:       6 =   1 +   1 +   4
    66:       6 =   1 +   2 +   3
    67:       6 =   1 +   3 +   2
    68:       6 =   1 +   4 +   1
    69:       6 =   1 +   5 +   0
    70:       6 =   2 +   0 +   4
    71:       6 =   2 +   1 +   3

COMP_UNRANK_GRLEX_TEST:
  Normal end of execution.

I4_CHOOSE_TEST
  I4_CHOOSE evaluates C(N,K).

       N       K     CNK

       0       0       1

       1       0       1
       1       1       1

       2       0       1
       2       1       2
       2       2       1

       3       0       1
       3       1       3
       3       2       3
       3       3       1

       4       0       1
       4       1       4
       4       2       6
       4       3       4
       4       4       1

I4_CHOOSE_TEST:
  Normal end of execution.

I4_UNIFORM_AB_TEST
  I4_UNIFORM_AB computes pseudorandom values
  in an interval [A,B].

  The lower endpoint A = -100
  The upper endpoint B = 200
  The initial seed is 123456789

         1       -35
         2       187
         3       149
         4        69
         5        25
         6       -81
         7       -23
         8       -67
         9       -87
        10        90
        11       -82
        12        35
        13        20
        14       127
        15       139
        16      -100
        17       170
        18         5
        19       -72
        20       -96

I4_UNIFORM_AB_TEST:
  Normal end of execution.

I4MAT_PRINT_TEST:
  Test I4MAT_PRINT, which prints an I4MAT.

  A 5 x 3 integer matrix:

  Col:        0         1         2   
  Row
    0:       11        12        13   
    1:       21        22        23   
    2:       31        32        33   
    3:       41        42        43   
    4:       51        52        53   

I4MAT_PRINT_TEST:
  Normal end of execution.

I4MAT_PRINT_SOME_TEST
  I4MAT_PRINT_SOME prints some of an I4MAT.

  Here is I4MAT, rows 0:2, cols 3:5:

  Col:        3         4         5   
  Row
    0:       14        15        16   
    1:       24        25        26   
    2:       34        35        36   

I4MAT_PRINT_SOME_TEST:
  Normal end of execution.

I4VEC_PRINT_TEST
  I4VEC_PRINT prints an I4VEC.

  Here is an I4VEC:

     0      91
     1      92
     2      93
     3      94

I4VEC_PRINT_TEST:
  Normal end of execution.

I4VEC_SUM_TEST
  I4VEC_SUM sums the entries of an I4VEC.

  The vector:

     0       2
     1      10
     2       9
     3       6
     4       4

  The vector entries sum to 31

I4VEC_SUM_TEST:
  Normal end of execution.

I4VEC_UNIFORM_AB_TEST
  I4VEC_UNIFORM_AB computes pseudorandom values
  in an interval [A,B].

  The lower endpoint A = -100
  The upper endpoint B = 200
  The initial seed is 123456789


  The random vector:

     0     -35
     1     187
     2     149
     3      69
     4      25
     5     -81
     6     -23
     7     -67
     8     -87
     9      90
    10     -82
    11      35
    12      20
    13     127
    14     139
    15    -100
    16     170
    17       5
    18     -72
    19     -96

I4VEC_UNIFORM_AB_TEST:
  Normal end of execution.

KSUB_RANDOM2_TEST
  KSUB_RANDOM2 generates a random K subset of an N set.
  Set size is N =    5
  Subset size is K = 3

    1     4     5 
    1     2     3 
    1     3     4 
    1     4     5 
    1     2     3 
    3     4     5 
    2     3     5 
    2     4     5 
    1     2     4 
    1     3     5 

KSUB_RANDOM2_TEST:
  Normal end of execution.

R8_UNIFORM_01_TEST
  R8_UNIFORM_01 produces a sequence of random values.

  Using random seed 123456789

  SEED  R8_UNIFORM_01(SEED)

     469049721        0.218418
    2053676357        0.956318
    1781357515        0.829509
    1206231778        0.561695
     891865166        0.415307
     141988902        0.066119
     553144097        0.257578
     236130416        0.109957
      94122056        0.043829
    1361431000        0.633966

  Verify that the sequence can be restarted.
  Set the seed back to its original value, and see that
  we generate the same sequence.

  SEED  R8_UNIFORM_01(SEED)

     469049721        0.218418
    2053676357        0.956318
    1781357515        0.829509
    1206231778        0.561695
     891865166        0.415307
     141988902        0.066119
     553144097        0.257578
     236130416        0.109957
      94122056        0.043829
    1361431000        0.633966

R8_UNIFORM_01_TEST
  Normal end of execution.

R8MAT_PRINT_TEST
  R8MAT_PRINT prints an R8MAT.

  Here is an R8MAT:

  Col:        0              1              2              3              4        
  Row
      0 :           11             12             13             14             15   
      1 :           21             22             23             24             25   
      2 :           31             32             33             34             35   
      3 :           41             42             43             44             45   

  Col:        5        
  Row
      0 :           16   
      1 :           26   
      2 :           36   
      3 :           46   

R8MAT_PRINT_TEST:
  Normal end of execution.

R8MAT_PRINT_SOME_TEST
  R8MAT_PRINT_SOME prints some of an R8MAT.

  Here is an R8MAT:

  Col:        3              4              5        
  Row
      0 :           14             15             16   
      1 :           24             25             26   
      2 :           34             35             36   

R8MAT_PRINT_SOME_TEST:
  Normal end of execution.

R8MAT_WRITE_TEST:
  Test R8MAT_WRITE, which writes an R8MAT to a file.

  Created file "r8mat_write_test.txt".

R8MAT_WRITE_TEST:
  Normal end of execution.

TIMESTAMP_TEST:
  Python version:
  TIMESTAMP prints a timestamp of the current date and time.

Thu Apr 23 14:22:31 2015

TIMESTAMP_TEST:
  Normal end of execution.

SIMPLEX_GRID_COUNT_TEST:
  SIMPLEX_GRID_COUNT counts the points in a regular grid
  with N+1 points on a side, in an M-dimensional simplex.

        M:  0      1      2      3      4      5
    N:
    0:      1      1      1      1      1      1 
    1:      1      2      3      4      5      6 
    2:      1      3      6     10     15     21 
    3:      1      4     10     20     35     56 
    4:      1      5     15     35     70    126 
    5:      1      6     21     56    126    252 
    6:      1      7     28     84    210    462 
    7:      1      8     36    120    330    792 
    8:      1      9     45    165    495   1287 
    9:      1     10     55    220    715   2002 
   10:      1     11     66    286   1001   3003 

SIMPLEX_GRID_COUNT_TEST:
  Normal end of execution.

SIMPLEX_GRID_INDEX_NEXT_TEST:
  SIMPLEX_GRID_INDEX_NEXT lists, one by one, the indices
  of a simplex grid that uses N+1 points on a side,
  in an M-dimensional simplex.

   #:  1  2  3  (*)

   0:   0   0   0  ( 3)
   1:   0   0   1  ( 2)
   2:   0   0   2  ( 1)
   3:   0   0   3  ( 0)
   4:   0   1   0  ( 2)
   5:   0   1   1  ( 1)
   6:   0   1   2  ( 0)
   7:   0   2   0  ( 1)
   8:   0   2   1  ( 0)
   9:   0   3   0  ( 0)
  10:   1   0   0  ( 2)
  11:   1   0   1  ( 1)
  12:   1   0   2  ( 0)
  13:   1   1   0  ( 1)
  14:   1   1   1  ( 0)
  15:   1   2   0  ( 0)
  16:   2   0   0  ( 1)
  17:   2   0   1  ( 0)
  18:   2   1   0  ( 0)
  19:   3   0   0  ( 0)

SIMPLEX_GRID_INDEX_NEXT_TEST:
  Normal end of execution.

SIMPLEX_GRID_INDEX_SAMPLE_TEST:
  SIMPLEX_GRID_INDEX_SAMPLE returns a randomly selected
  index of a simplex grid that uses N+1 points on a side,
  in an M-dimensional simplex.

   #:  1  2  3  (*)

   0:   0   2   0  ( 1)
   1:   0   0   0  ( 3)
   2:   0   1   1  ( 1)
   3:   2   1   0  ( 0)
   4:   0   2   0  ( 1)
   5:   0   1   2  ( 0)
   6:   1   1   1  ( 0)
   7:   0   1   0  ( 2)
   8:   1   1   0  ( 1)
   9:   1   0   2  ( 0)
  10:   1   2   0  ( 0)
  11:   2   1   0  ( 0)
  12:   1   0   0  ( 2)
  13:   1   0   0  ( 2)
  14:   0   0   0  ( 3)
  15:   0   0   3  ( 0)
  16:   2   1   0  ( 0)
  17:   1   0   0  ( 2)
  18:   2   0   1  ( 0)
  19:   1   1   1  ( 0)

SIMPLEX_GRID_INDEX_SAMPLE_TEST:
  Normal end of execution.

SIMPLEX_GRID_INDEX_ALL_TEST:
  SIMPLEX_GRID_INDEX_ALL returns all the indices
  of a simplex grid that uses N+1 points on a side,
  in an M-dimensional simplex.

  Simplex Grid Index Matrix:

  Col:        0         1         2         3   
  Row
    0:        0         0         0         3   
    1:        0         0         1         2   
    2:        0         0         2         1   
    3:        0         0         3         0   
    4:        0         1         0         2   
    5:        0         1         1         1   
    6:        0         1         2         0   
    7:        0         2         0         1   
    8:        0         2         1         0   
    9:        0         3         0         0   
   10:        1         0         0         2   
   11:        1         0         1         1   
   12:        1         0         2         0   
   13:        1         1         0         1   
   14:        1         1         1         0   
   15:        1         2         0         0   
   16:        2         0         0         1   
   17:        2         0         1         0   
   18:        2         1         0         0   
   19:        3         0         0         0   

SIMPLEX_GRID_INDEX_ALL_TEST:
  Normal end of execution.

SIMPLEX_GRID_INDEX_TO_POINT_TEST01:
  SIMPLEX_GRID_INDEX_TO_POINT returns the physical point
  corresponding to a grid index of a simplex grid that
  that uses N+1 points on a side,
  in an M-dimensional simplex.

  Simplex vertices:

  Col:        0              1        
  Row
      0 :           20              0   
      1 :           30             40   
      2 :           10             20   

  Choosing random simplex indices to convert:
   #:  1  2  3     X        Y

   0:   0   4   1   26.0000   36.0000 
   1:   0   0   5   10.0000   20.0000 
   2:   0   1   4   14.0000   24.0000 
   3:   4   1   0   22.0000    8.0000 
   4:   0   0   5   10.0000   20.0000 
   5:   2   0   3   14.0000   12.0000 
   6:   0   1   4   14.0000   24.0000 
   7:   2   3   0   26.0000   24.0000 
   8:   2   2   1   22.0000   20.0000 
   9:   3   0   2   16.0000    8.0000 

SIMPLEX_GRID_INDEX_TO_POINT_TEST01:
  Normal end of execution.

SIMPLEX_GRID_INDEX_TO_POINT_TEST02:
  SIMPLEX_GRID_INDEX_TO_POINT returns the physical point
  corresponding to a grid index of a simplex grid that
  that uses N+1 points on a side,
  in an M-dimensional simplex.

  Simplex vertices:

  Col:        0              1        
  Row
      0 :           20              0   
      1 :           30             40   
      2 :           10             20   

  Grid Point Coordinates:

  Col:        0              1        
  Row
      0 :           10             20   
      1 :           14             24   
      2 :           18             28   
      3 :           22             32   
      4 :           26             36   
      5 :           30             40   
      6 :           12             16   
      7 :           16             20   
      8 :           20             24   
      9 :           24             28   
     10 :           28             32   
     11 :           14             12   
     12 :           18             16   
     13 :           22             20   
     14 :           26             24   
     15 :           16              8   
     16 :           20             12   
     17 :           24             16   
     18 :           18              4   
     19 :           22              8   
     20 :           20              0   

SIMPLEX_GRID_INDEX_TO_POINT_TEST02:
  Normal end of execution.

SIMPLEX_GRID_TEST:
  Normal end of execution.
Thu Apr 23 14:22:31 2015