File: gbtest15.m

package info (click to toggle)
suitesparse-graphblas 7.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 67,112 kB
  • sloc: ansic: 1,072,243; cpp: 8,081; sh: 512; makefile: 506; asm: 369; python: 125; awk: 10
file content (39 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function gbtest15
%GBTEST15 list all unary operators

% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
% SPDX-License-Identifier: Apache-2.0

types = gbtest_types ;
ops = { 'identity', '~', '-', '1', 'minv', 'abs',  'sqrt', 'log', ...
    'exp', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', ...
    'sinh', 'cosh', 'tanh', 'asinh', 'acosh', 'atanh', ...
    'signum', 'ceil', 'floor', 'round', 'trunc', 'pow2', ...
    'expm1', 'log10', 'log1p', 'log2', 'lgamma', 'tgamma', 'erf', ...
    'cbrt', ...
    'erfc', 'conj', 'creal', 'cimag', 'carg', 'isinf', 'isnan', ...
    'isinfinite', 'frexpx', 'frexpe', 'i0', 'i1', 'j0', 'j1' } ;

nops = 0 ;
for k1 = 1:length (ops)
    for k2 = 1:length (types)
        op = [ops{k1} '.' types{k2}] ;
        fprintf ('\nop: (%s)\n', op) ;
        try
            GrB.unopinfo (op) ;
            GrB.unopinfo (ops {k1}, types {k2}) ;
            nops = nops + 1 ;
        catch
        end
    end
end

fprintf ('\nhelp GrB.unopinfo:\n') ;
GrB.unopinfo ;

fprintf ('number of unary ops: %d\n', nops) ;
assert (nops == 214) ;

fprintf ('gbtest15: all tests passed\n') ;