1 //------------------------------------------------------------------------------
2 // GxB_Monoid_operator: return the op of a monoid
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_Monoid_operator(GrB_BinaryOp * op,GrB_Monoid monoid)12 GrB_Info GxB_Monoid_operator        // return the monoid operator
13 (
14     GrB_BinaryOp *op,               // returns the binary op of the monoid
15     GrB_Monoid monoid               // monoid to query
16 )
17 {
18 
19     //--------------------------------------------------------------------------
20     // check inputs
21     //--------------------------------------------------------------------------
22 
23     GB_WHERE1 ("GxB_Monoid_operator (&op, monoid)") ;
24     GB_RETURN_IF_NULL (op) ;
25     GB_RETURN_IF_NULL_OR_FAULTY (monoid) ;
26     ASSERT_MONOID_OK (monoid, "monoid for op", GB0) ;
27 
28     //--------------------------------------------------------------------------
29     // return the ztype
30     //--------------------------------------------------------------------------
31 
32     (*op) = monoid->op ;
33     return (GrB_SUCCESS) ;
34 }
35 
36