1function C = gamma (G)
2%GAMMA gamma function.
3% C = gamma (G) is the gamma function of each entry of G.
4% Since gamma (0) = inf, the result is a full matrix.  G must be real.
5%
6% See also GrB/gammaln.
7
8% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
9% SPDX-License-Identifier: GPL-3.0-or-later
10
11G = G.opaque ;
12type = gbtype (G) ;
13if (contains (type, 'complex'))
14    error ('input must be real') ;
15end
16if (~gb_isfloat (type))
17    type = 'double' ;
18end
19
20C = GrB (gbapply ('gamma', gbfull (G, type))) ;
21
22