1 //------------------------------------------------------------------------------
2 // GrB_UnaryOp_new: create a new user-defined unary operator
3 //------------------------------------------------------------------------------
4
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7
8 //------------------------------------------------------------------------------
9
10 // GrB_UnaryOp_new is implemented both as a macro and a function. Both are
11 // user-callable. The macro is used by default since it can capture the name
12 // of the unary function.
13
14 #include "GB.h"
15
16 // the macro version of this function must first be #undefined
17 #undef GrB_UnaryOp_new
18 #undef GrM_UnaryOp_new
19
GRB(UnaryOp_new)20 GrB_Info GRB (UnaryOp_new) // create a new user-defined unary operator
21 (
22 GrB_UnaryOp *unaryop, // handle for the new unary operator
23 GxB_unary_function function, // pointer to the unary function
24 GrB_Type ztype, // type of output z
25 GrB_Type xtype // type of input x
26 )
27 {
28 return (GB_UnaryOp_new (unaryop, function, ztype, xtype, NULL)) ;
29 }
30
31