1 //------------------------------------------------------------------------------
2 // GxB_UnaryOp_xtype: return the type of x for z=f(x)
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 #include "GB.h"
11
GxB_UnaryOp_xtype(GrB_Type * xtype,GrB_UnaryOp unaryop)12 GrB_Info GxB_UnaryOp_xtype // return the type of x
13 (
14 GrB_Type *xtype, // return type of input x
15 GrB_UnaryOp unaryop // unary operator
16 )
17 {
18
19 //--------------------------------------------------------------------------
20 // check inputs
21 //--------------------------------------------------------------------------
22
23 GB_WHERE1 ("GxB_UnaryOp_xtype (&xtype, unaryop)") ;
24 GB_RETURN_IF_NULL (xtype) ;
25 GB_RETURN_IF_NULL_OR_FAULTY (unaryop) ;
26 ASSERT_UNARYOP_OK (unaryop, "unaryop for xtype", GB0) ;
27
28 //--------------------------------------------------------------------------
29 // return the xtype
30 //--------------------------------------------------------------------------
31
32 (*xtype) = unaryop->xtype ;
33 return (GrB_SUCCESS) ;
34 }
35
36