1 //------------------------------------------------------------------------------
2 // gbselectopinfo : print a GraphBLAS selectop (for illustration only)
3 //------------------------------------------------------------------------------
4 
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: GPL-3.0-or-later
7 
8 //------------------------------------------------------------------------------
9 
10 // Usage:
11 
12 // gbselectopinfo (selectop)
13 
14 #include "gb_matlab.h"
15 
16 #define USAGE "usage: GrB.selectopinfo (selectop)"
17 
mexFunction(int nargout,mxArray * pargout[],int nargin,const mxArray * pargin[])18 void mexFunction
19 (
20     int nargout,
21     mxArray *pargout [ ],
22     int nargin,
23     const mxArray *pargin [ ]
24 )
25 {
26 
27     //--------------------------------------------------------------------------
28     // check inputs
29     //--------------------------------------------------------------------------
30 
31     gb_usage (nargin == 1 && nargout == 0, USAGE) ;
32 
33     //--------------------------------------------------------------------------
34     // construct the GraphBLAS selectop and print it
35     //--------------------------------------------------------------------------
36 
37     #define LEN 256
38     char opstring [LEN+2] ;
39     gb_mxstring_to_string (opstring, LEN, pargin [0], "select operator") ;
40 
41     GxB_SelectOp op = gb_mxstring_to_selectop (pargin [0]) ;
42     OK (GxB_SelectOp_fprint (op, opstring, GxB_COMPLETE, NULL)) ;
43     GB_WRAPUP ;
44 }
45 
46