1% GraphBLAS Test/ folder: test GraphBLAS in MATLAB
2% See the README.txt file for more details.
3
4% Primary functiuns
5
6%   make          - compiles the MATLAB interface to GraphBLAS (for testing only)
7%   testall       - run all GraphBLAS tests
8%   nthreads_get  - get # of threads and chunk to use in GraphBLAS
9%   nthreads_set  - set # of threads and chunk to use in GraphBLAS
10
11% MATLAB mimics of GraphBLAS operations:
12%
13%   GB_spec_Col_assign            - a MATLAB mimic of GrB_Col_assign
14%   GB_spec_Col_extract           - a MATLAB mimic of GrB_Col_extract
15%   GB_spec_Matrix_extract        - a MATLAB mimic of GrB_Matrix_extract
16%   GB_spec_Matrix_extractElement - a MATLAB mimic of GrB_Matrix_extractElement
17%   GB_spec_Row_assign            - a MATLAB mimic of GrB_Row_assign
18%   GB_spec_Vector_extract        - a MATLAB mimic of GrB_Vector_extract
19%   GB_spec_Vector_extractElement - a MATLAB mimic of GrB_Matrix_extractElement
20%   GB_spec_accum                 - MATLAB mimic of the Z=accum(C,T) operation in GraphBLAS
21%   GB_spec_accum_mask            - apply the accumulator and mask
22%   GB_spec_apply                 - a MATLAB mimic of GrB_apply
23%   GB_spec_assign                - a MATLAB mimic of GrB_assign (but not Row or Col variants)
24%   GB_spec_build                 - a MATLAB version of GrB_Matrix_build and GrB_vector_build
25%   GB_spec_compare               - compare MATLAB mimic result with GraphBLAS result
26%   GB_spec_descriptor            - return components of a descriptor
27%   GB_spec_Matrix_eWiseAdd       - a MATLAB mimic of GrB_Matrix_eWiseAdd
28%   GB_spec_Vector_eWiseAdd       - a MATLAB mimic of GrB_Vector_eWiseAdd
29%   GB_spec_Matrix_eWiseMult      - a MATLAB mimic of GrB_Matrix_eWiseMult
30%   GB_spec_Vector_eWiseMult      - a MATLAB mimic of GrB_Vector_eWiseMult
31%   GB_spec_extractTuples         - a MATLAB mimic of GrB_*_extractTuples
32%   GB_spec_identity              - the additive identity of a monoid
33%   GB_spec_kron                  - a MATLAB mimic of GrB_kronecker
34%   GB_spec_mask                  - a pure MATLAB implementation of GrB_mask
35%   GB_spec_matrix                - a MATLAB mimic that conforms a matrix to the GraphBLAS spec
36%   GB_spec_mxm                   - a MATLAB mimic of GrB_mxm
37%   GB_spec_mxv                   - a MATLAB mimic of GrB_mxv
38%   GB_spec_op                    - apply a unary or binary operator
39%   GB_spec_operator              - get the contents of an operator
40%   GB_spec_opsall                - return a list of all operators, types, and semirings
41%   GB_spec_random                - generate random matrix
42%   GB_spec_reduce_to_scalar      - a MATLAB mimic of GrB_reduce (to scalar)
43%   GB_spec_reduce_to_vector      - a MATLAB mimic of GrB_reduce (to vector)
44%   GB_spec_resize                - a MATLAB mimic of GxB_resize
45%   GB_spec_select                - a MATLAB mimic of GxB_select
46%   GB_spec_semiring              - create a semiring
47%   GB_spec_subassign             - a MATLAB mimic of GxB_subassign
48%   GB_spec_transpose             - a MATLAB mimic of GrB_transpose
49%   GB_spec_vxm                   - a MATLAB mimic of GrB_vxm
50%   GB_complex_compare            - compare GraphBLAS results for complex types
51%   GB_user_op                    - apply a complex binary and unary operator
52%   GB_user_opsall                - return list of complex operators
53%   accum_mask                    - apply the mask
54%   accum_mask2                   - a simpler version of GB_spec_accum_mask
55%   GB_random_mask                - Mask = GB_random_mask (m, n, d, M_is_csc, M_is_hyper)
56%   GB_spec_getmask               - return the mask, typecasted to logical
57
58% Test scripts:
59
60%   test00   - test GB_mex_mis
61%   test01   - test GraphBLAS error handling
62%   test02   - test GrB_*_dup
63%   test03   - test GB_*_check functions
64%   test04   - test and demo for accumulator/mask and transpose
65%   test05   - test GrB_*_setElement
66%   test06   - test GrB_mxm on all semirings
67%   test07   - test GxB_subassign with a single pending tuple
68%   test07b  - test GrB_assign with a single pending tuple
69%   test08   - test GxB_subassign
70%   test08b  - test GrB_assign
71%   test09   - test GxB_subassign
72%   test09b  - test GrB_assign
73%   test10   - test GrB_apply
74%   test11   - test GrB_*_extractTuples
75%   test12   - test Wathen matrix generation
76%   test13   - test GrB_tranpsose
77%   test14   - test GrB_reduce
78%   test15   - test AxB and AdotB internal functions
79%   test16   - test user-defined complex type (runs all testc*.m)
80%   test17   - test GrB_*_extractElement
81%   test18   - test GrB_eWiseAdd and GrB_eWiseMult
82%   test19   - test GxB_subassign and GrB_*_setElement with many pending operations
83%   test19b  - test GrB_assign and GrB_*_setElement with many pending operations
84%   test20   - test GrB_mxm, mxv, and vxm
85%   test21   - test GxB_subassign
86%   test21b  - test GrB_assign
87%   test22   - test GrB_transpose
88%   test23   - test GrB_*_build
89%   test24   - test GrB_reduce
90%   test25   - test GxB_select
91%   test26   - performance test for GxB_select
92%   test27   - test GxB_select with user-defined select op (LoHi_band)
93%   test28   - test mxm with aliased inputs, C<C> = accum(C,C*C)
94%   test29   - GrB_reduce with zombies
95%   test30   - test GxB_subassign
96%   test30b  - performance test GB_mex_assign, scalar expansionb
97%   test31   - test GrB_transpose
98%   test32   - test GrB_mxm
99%   test33   - test a semiring
100%   test34   - test GrB_eWiseAdd
101%   test35   - test GrB_*_extractTuples
102%   test36   - performance test of matrix subref
103%   test38   - test GrB_transpose
104%   test39   - performance test for GrB_transpose
105%   test40   - test GrB_Matrix_extractElement
106%   test41   - test AxB
107%   test42   - test GrB_Matrix_build
108%   test43   - test subref
109%   test44   - test qsort
110%   test45   - test GrB_*_setElement and GrB_*_*build
111%   test46   - performance test of GxB_subassign
112%   test46b  - performance test of GrB_assign
113%   test47   - prformance test of GrB_vxm
114%   test48   - performance test of GrB_mxm
115%   test49   - performance test of GrB_mxm (dot product method, A'*B)
116%   test50   - test AxB numeric and symbolic
117%   test51   - test GxB_subassign, multiply operations
118%   test51b  - test GrB_assign, multiply operations
119%   test52   - test AdotB vs AxB
120%   test53   - test GrB_Matrix_extract
121%   test54   - test GB_subref (numeric case) with I=lo:hi, J=lo:hi
122%   test55   - test GxB_subassign, illustrate duplicate indices, MATLAB vs GraphBLAS
123%   test55b  - test GrB_assign, illustrate duplicate indices, MATLAB vs GraphBLAS
124%   test56   - test GrB_*_build
125%   test57   - test operator on large uint32 values
126%   test58   - test GrB_eWiseAdd
127%   test59   - test GrB_mxm
128%   test60   - test min and max operators with NaNs
129%   test61   - performance test of GrB_eWiseMult
130%   test62   - test GrB_apply
131%   test63   - test GraphBLAS binary operators
132%   test64   - test GxB_*_subassign, scalar expansion, with and without duplicates
133%   test64b  - test GrB_*_assign, scalar expansion, with and without duplicates
134%   test65   - test type casting
135%   test66   - test GrB_reduce
136%   test67   - test GrB_apply
137%   test68   - performance tests for eWiseMult
138%   test69   - test GrB_assign with aliased inputs, C<C>(:,:) = accum(C(:,:),C)
139%   test72   - special cases for mxm, ewise, ...
140%   test73   - performance of C = A*B, with mask
141%   test74   - test GrB_mxm: all built-in semirings
142%   test75   - test GrB_mxm and GrB_vxm on all semirings
143%   test75b  - GrB_mxm and GrB_vxm on all semirings (shorter test than test75)
144%   test76   - test GxB_resize
145%   test77   - test GrB_kronecker
146%   test78   - test subref
147%   test79   - run all matrices with test06
148%   test80   - rerun test06 with different matrices
149%   test81   - test GrB_Matrix_extract with index range, stride, & backwards
150%   test82   - test GrB_Matrix_extract with index range (hypersparse)
151%   test83   - test GrB_assign with J=lo:0:hi, an empty list, and C_replace true
152%   test84   - test GrB_assign (row and column with C in CSR format)
153%   test85   - test GrB_transpose: 1-by-n with typecasting
154%   test86   - performance test of of GrB_Matrix_extract
155%   test87   - performance test of GrB_mxm
156%   test88   - test hypersparse matrices with hash-based method
157%   test89   - performance test of complex A*B
158%   test90   - test AxB with user-defined semirings: plus_rdiv and plus_rdiv2
159%   test91   - test subref performance on dense vectors
160%   test92   - test GB_subref (symbolic case)
161%   test93   - test dpagerank and ipagerank
162%   test93b  - test dpagerank and ipagerank
163%   test94   - test pagerank
164%   test95   - performance test for GrB_transpose
165%   test96   - test dot product
166%   test97   - test GB_assign, scalar expansion and zombies
167%   test98   - test GrB_mxm, typecasting on the fly
168%   test99   - test GB_mex_transpose with explicit zeros in the Mask
169%   test100  - test GB_mex_isequal
170%   test101  - test import/export
171%   test102  - test GB_AxB_saxpy3_flopcount
172%   test103  - test aliases in GrB_transpose
173%   test104  - export/import
174%   test105  - eWiseAdd with hypersparse matrices
175%   test106  - GxB_subassign with alias
176%   test107  - user-defined terminal monoid
177%   test108  - test boolean monoids
178%   test109  - terminal monoid with user-defined type
179%   test110  - test accum/mask (binary search of M(:,j))
180%   test111  - performance test for eWiseAdd
181%   test112  - test row/col scale
182%   test113  - performance tests for GrB_kron
183%   test114  - performance of reduce-to-scalar
184%   test115  - test GB_assign, scalar expansion and zombies, with duplicates
185%   test116  - performance tests for GrB_assign
186%   test117  - performance tests for GrB_assign
187%   test118  - performance tests for GrB_assign
188%   test119  - performance tests for GrB_assign
189%   test120  - performance tests for GrB_assign
190%   test121  - performance tests for GrB_assign
191%   test122  - performance tests for GrB_assign
192%   test123  - test MIS on large matrix
193%   test124  - GrB_extract, trigger case 6
194%   test125  - test GrB_mxm: row and column scaling
195%   test126  - test GrB_reduce to vector on a very sparse matrix
196%   test127  - test GrB_eWiseAdd and GrB_eWiseMult (all types and operators)
197%   test128  - test eWiseMult and eWiseAdd, special cases
198%   test129  - test GxB_select (tril and nonzero, hypersparse)
199%   test130  - test GrB_apply (hypersparse cases)
200%   test131  - test GrB_Matrix_clear
201%   test132  - test GrB_*_setElement and GrB_*_*build
202%   test133  - test mask operations (GB_masker)
203%   test134  - test GxB_select
204%   test135  - reduce-to-scalar, built-in monoids with terminal values
205%   test136  - GxB_subassign, method 08, 09, 11
206%   test137  - GrB_eWiseMult with FIRST and SECOND operators
207%   test138  - test assign, with coarse-only tasks in IxJ slice
208%   test139  - merge sort, special cases
209%   test140  - test assign with duplicates
210%   test141  - test GrB_eWiseAdd (all types and operators) for dense matrices
211%   test142  - test GrB_assign for dense matrices
212%   test143  - test special cases for C<!M>=A*B and C<M>=A*B
213%   test144  - test GB_cumsum
214%   test145  - test dot4
215%   test146  - test C<M,struct> = scalar
216%   test147  - test C<M>A*B with very sparse M
217%   test148  - eWiseAdd with aliases
218%   test149  - test fine hash method for C<!M>=A*B
219%   test150  - test GrB_mxm with typecasting and zombies (dot3 and saxpy)
220%   test151  - test bitwise operators
221%   test152  - test C = A+B for dense A, B, and C
222%   test153  - list all possible semirings
223%   test154  - test GrB_apply with scalar binding
224%   test155  - test GrB_*_setElement and GrB_*_removeElement
225%   test156  - test assign C=A with typecasting
226
227% TODO:: add new tests here
228
229%   testc1   - test complex operators
230%   testc2   - test complex A*B, A'*B, A*B', A'*B', A+B
231%   testc3   - test complex GrB_extract
232%   testc4   - test complex extractElement and setElement
233%   testc5   - test complex subref
234%   testc6   - test complex apply
235%   testc7   - test complex assign
236%   testc8   - test complex eWiseAdd and eWiseMult
237%   testc9   - test complex extractTuples
238%   testca   - test complex mxm, mxv, and vxm
239%   testcb   - test complex reduce
240%   testcc   - test complex transpose
241
242% Other tests:
243
244%   t74       - run test20 and test74
245%   testperf  - run all performance tests
246%   atest     - test GrB_assign and GxB_subassign
247%   atest11   - test GrB_assign and GxB_subassign
248%   btest     - test GrB_build
249%   etest     - test eWise
250%   ee        - eWiseMult and eWiseAdd performance tests
251%   grbinfo   - print info about the GraphBLAS version
252%   mtest     - test mxm
253%   longtests - very long tests
254
255%   rtest     - test GrB_reduce to vector and scalar
256%   ss        - test GxB_select
257%   stest     - test GxB_select
258%   testall2  - run testall with different # of threads
259%   testall3  - run testall with different # of threads
260%   tt        - test eWiseMult and A+B
261%   ttest     - test GrB_extractTuples
262%   ttt       - various tests
263%   xtest     - test GrB_extract
264%   ztest     - test zombie deletion
265%   testsort  - test qsort and msort
266
267% Helper functions
268
269%   debug_off        - turn off malloc debugging
270%   debug_on         - turn on malloc debugging
271
272%   irand            - construct a random integer matrix
273%   logstat          - run a GraphBLAS test and log the results to log.txt
274%   runtest          - run a single GraphBLAS test
275%   stat             - report status of statement coverage and malloc debugging
276%   GB_define        - create C source code for GraphBLAS.h
277
278%   grbresults       - return time taken by last GraphBLAS function
279%   isequal_roundoff - compare two matrices, allowing for roundoff errors
280
281%   test_other       - installs all packages needed for extensive tests
282
283%   grb_clear_coverage - clear current statement coverage
284%   grb_get_coverage   - return current statement coverage
285
286%   bfs_book         - run BFS on a small graph
287%   bfs_matlab       - a simple breadth-first-search in MATLAB
288%   bfs_test         - compares bfs_matlab and GB_mex_bfs
289%   flopcount        - cumulative sum of flop counts for A*B, C<M>=A*B, C<!M>=A*B
290%   floptest         - compare flopcount with GB_mex_mxm_flops
291
292% Triangle counting:
293
294%   ../Demo/MATLAB/tricount       - count the number of triangles in an undirected unweighted graph
295%   ../Demo/MATLAB/adj_to_edges   - create an edge incidence matrix from an adjacency matrix
296%   ../Demo/MATLAB/check_adj      - ensure A is a valid adjacency matrix
297%   ../Demo/MATLAB/edges_to_adj   - create an adjacency matrix from an edge incidence matrix
298%   ../Demo/MATLAB/tri_matlab     - run tricount tests in MATLAB
299%   test70                        - performance comparison of triangle counting methods
300%   test70_plot                   - plot the results from test70
301%   test71                        - performance comparison of triangle counting methods
302%   test71_plot                   - plot the results from test71
303%   test71_table                  - print the table for triangle counting results
304
305% Other demos
306
307%   ../Demo/MATLAB/kron_demo      - test Program/kron_demo.c and compare with MATLAB kron
308%   ../Demo/MATLAB/kron_test      - test kron_demo.m
309
310% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
311% SPDX-License-Identifier: Apache-2.0
312
313