1function unopinfo (op, type)
2%GRB.UNOPINFO list the details of a GraphBLAS unary operator.
3%
4%   GrB.unopinfo
5%   GrB.unopinfo (op)
6%   GrB.unopinfo (op, type)
7%
8% For GrB.unopinfo(op), the op must be a string of the form 'op.type',
9% where 'op' is listed below.  The second usage allows the type to be
10% omitted from the first argument, as just 'op'.  This is valid for all
11% GraphBLAS operations, since the type defaults to the type of the input
12% matrix.  However, GrB.unopinfo does not have a default type and thus one
13% must be provided, either in the op as GrB.unopinfo ('abs.double'), or in
14% the second argument, GrB.unopinfo ('abs', 'double').
15%
16% The functions z=f(x) are listed below.  Unless otherwise specified,
17% z and x have the same type.  Some functions have synonyms, as listed.
18%
19% For all 13 types:
20%   identity    z = x       also '+', 'uplus'
21%   ainv        z = -x      additive inverse, also '-', 'negate', 'uminus'
22%   minv        z = 1/x     multiplicative inverse
23%   one         z = 1       does not depend on x, also '1'
24%   abs         z = |x|     'abs.complex' returns a real result
25%
26% For all 11 real types:
27%   lnot        z = ~(x ~= 0)   logical negation (z is 1 or 0, with the
28%                               same type as x), also '~', 'not'.
29%
30% For 4 floating-point types (real & complex)x(single & double):
31%   sqrt        z = sqrt (x)    square root
32%   log         z = log (x)     base-e logarithm
33%   log2        z = log2 (x)    base-2 logarithm
34%   log10       z = log10 (x)   base-10 logarithm
35%   log1p       z = log1p (x)   log (x-1), base-e
36%   exp         z = exp (x)     base-e exponential, e^x
37%   pow2        z = pow2 (x)    base-2 exponential, 2^x
38%   expm1       z = exp1m (x)   e^x-1
39%   sin         z = sin (x)     sine
40%   cos         z = cos (x)     cosine
41%   tan         z = tan (x)     tangent
42%   acos        z = acos (x)    arc cosine
43%   asin        z = asin (x)    arc sine
44%   atan        z = atan (x)    arc tangent
45%   sinh        z = sinh (x)    hyperbolic sine
46%   cosh        z = cosh (x)    hyperbolic cosine
47%   tanh        z = tanh (x)    hyperbolic tangent
48%   asinh       z = asinh (x)   inverse hyperbolic sine
49%   acosh       z = acosh (x)   inverse hyperbolic cosine
50%   atanh       z = atanh (x)   inverse hyperbolic tangent
51%   signum      z = signum (x)  signum function, also 'sign'
52%   ceil        z = ceil (x)    ceiling
53%   floor       z = floor (x)   floor
54%   round       z = round (x)   round to nearest
55%   trunc       z = trunc (x)   truncate, also 'fix'
56%
57% For 'single complex' and 'double complex' only:
58%   creal       z = real (x)    real part of x (z is real), also 'real'
59%   cimag       z = imag (x)    imag. part of x (z is real), also 'imag'
60%   carg        z = carg (x)    phase angle (z is real), also 'angle'
61%   conj        z = conj (x)    complex conjugate (z is complex)
62%
63% For all 4 floating-point types (result is logical):
64%   isinf       z = isinf (x)       true if x is +Inf or -Inf
65%   isnan       z = isnan (x)       true if x is NaN
66%   isfinite    z = isfinite (x)    true if x is finite
67%
68% For single and double (result same type as input):
69%   lgamma      z = lgamma (x)  log of gamma function, also 'gammaln'
70%   tgamma      z = tgamma (x)  gamma function, also 'gamma'
71%   erf         z = erf (x)     error function
72%   erfc        z = erfc (x)    complementary error function
73%   frexpx      z = frexpx (x)  mantissa from ANSI C11 frexp function
74%   frexpe      z = frexpe (x)  exponent from ANSI C11 frexp function
75%                               The MATLAB [f,e]=log2(x) returns
76%                               f = frexpx (x) and e = frexpe (x).
77%
78% For integer types only (result is same type as input):
79%   bitcmp      z = ~(x)        bitwise complement, also 'bitnot'
80%
81% For int32 and int64 types, applied to an entry A(i,j)
82%   positioni0  z = i-1     also 'i0'
83%   positioni1  z = i       also 'i', 'i1', and 'positioni'
84%   positionj0  z = j-1     also 'j0'
85%   positionj1  z = j       also 'j', 'j1', and 'positionj'
86%
87% Example:
88%
89%   % valid unary operators
90%   GrB.unopinfo ('+.double') ;     % also a valid binary operator
91%   GrB.unopinfo ('abs.double') ;
92%   GrB.unopinfo ('not.int32') ;
93%   GrB.unopinfo ('pow2.double') ;  % also a valid binary operator
94%   GrB.binopinfo ('pow2.double') ;
95%
96%   % invalid unary operator (generates an error; this is a binary op):
97%   GrB.unopinfo ('*.double') ;
98%
99% See also GrB.binopinfo, GrB.descriptorinfo, GrB.monoidinfo,
100% GrB.selectopinfo, GrB.semiringinfo.
101
102% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
103% SPDX-License-Identifier: GPL-3.0-or-later
104
105if (nargin == 0)
106    help GrB.unopinfo
107elseif (nargin == 1)
108    gbunopinfo (op) ;
109else
110    gbunopinfo (op, type) ;
111end
112
113