1 //------------------------------------------------------------------------------
2 // GxB_SelectOp_ttype: return the type of thunk for z=f(x,thunk)
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_SelectOp_ttype(GrB_Type * ttype,GxB_SelectOp selectop)12 GrB_Info GxB_SelectOp_ttype // return type of thunk or NULL if generic
13 (
14 GrB_Type *ttype, // return type of input thunk
15 GxB_SelectOp selectop // select operator
16 )
17 {
18
19 //--------------------------------------------------------------------------
20 // check inputs
21 //--------------------------------------------------------------------------
22
23 GB_WHERE1 ("GxB_SelectOp_ttype (&ttype, selectop)") ;
24 GB_RETURN_IF_NULL (ttype) ;
25 GB_RETURN_IF_NULL_OR_FAULTY (selectop) ;
26 ASSERT_SELECTOP_OK (selectop, "selectop for ttype", GB0) ;
27
28 //--------------------------------------------------------------------------
29 // return the ttype
30 //--------------------------------------------------------------------------
31
32 (*ttype) = selectop->ttype ;
33 return (GrB_SUCCESS) ;
34 }
35
36