1function test166
2%TEST166 GxB_select with a dense matrix
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7rng ('default') ;
8fprintf ('test166: ') ;
9
10n = 10 ;
11A.matrix = rand (n) ;
12A.matrix (1,1) = 0 ;
13A.pattern = true (n) ;
14A.sparsity = 8 ;
15Cin = sparse (n, n) ;
16
17[~, ~, ~, ~, ~, select_ops] = GB_spec_opsall ;
18
19thunk = 0 ;
20
21for k = 1:length(select_ops)
22
23    op = select_ops {k} ;
24    fprintf ('%s ', op) ;
25    if (mod (k, 4) == 0)
26        fprintf ('\n') ;
27    end
28
29    % no mask, thunk = 0
30    C1 = GB_spec_select (Cin, [], [], op, A, thunk, []) ;
31    C2 = GB_mex_select  (Cin, [], [], op, A, thunk, [], 'test') ;
32    GB_spec_compare (C1, C2) ;
33
34end
35
36fprintf ('resize\n') ;
37C1 = GB_spec_resize (A, 5, 15) ;
38C2 = GB_mex_resize  (A, 5, 15) ;
39GB_spec_compare (C1, C2) ;
40fprintf ('test166: all tests passed\n') ;
41
42