31 July 2014 10:40:17 PM SIMPLEX_GRID_TEST: C++ version Test the SIMPLEX_GRID library. TEST01: SIMPLEX_GRID_SIZE 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 TEST02: 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) TEST03: 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 (*) 1: 0 1 1 ( 1) 2: 1 0 2 ( 0) 3: 0 1 2 ( 0) 4: 1 0 2 ( 0) 5: 3 0 0 ( 0) 6: 0 1 0 ( 2) 7: 0 0 3 ( 0) 8: 0 0 3 ( 0) 9: 2 0 0 ( 1) 10: 0 1 1 ( 1) 11: 0 0 0 ( 3) 12: 1 0 2 ( 0) 13: 2 1 0 ( 0) 14: 1 1 1 ( 0) 15: 2 0 0 ( 1) 16: 1 0 0 ( 2) 17: 0 0 2 ( 1) 18: 1 2 0 ( 0) 19: 1 0 0 ( 2) 20: 0 2 0 ( 1) TEST04: 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: Row: 0 1 Col 0: 20 0 1: 30 40 2: 10 20 Choosing random simplex indices to convert: #: 1 2 3 X Y 1: 1 4 0 28 32 2: 0 0 5 10 20 3: 1 2 2 20 24 4: 3 2 0 24 16 5: 0 5 0 30 40 6: 0 1 4 14 24 7: 2 1 2 18 16 8: 4 1 0 22 8 9: 1 4 0 28 32 10: 1 2 2 20 24 TEST05: 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. Transposed Simplex Grid Index Matrix: Row: 0 1 2 3 Col 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 TEST06: 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: Row: 0 1 Col 0: 20 0 1: 30 40 2: 10 20 Grid Point Coordinates: Row: 0 1 Col 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_TEST: Normal end of execution. 31 July 2014 10:40:17 PM