1 //------------------------------------------------------------------------------
2 // GB_check.h: check and optionally print an object
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 #ifndef GB_CHECK_H
11 #define GB_CHECK_H
12 
13 // pr values for *_check functions
14 #define GB0 GxB_SILENT
15 #define GB1 GxB_SUMMARY
16 #define GB2 GxB_SHORT
17 #define GB3 GxB_COMPLETE
18 #define GB4 GxB_SHORT_VERBOSE
19 #define GB5 GxB_COMPLETE_VERBOSE
20 
21 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
22 GrB_Info GB_entry_check     // print a single value
23 (
24     const GrB_Type type,    // type of value to print
25     const void *x,          // value to print
26     int pr,                 // print level
27     FILE *f                 // file to print to
28 ) ;
29 
30 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
31 GrB_Info GB_code_check          // print and check an entry using a type code
32 (
33     const GB_Type_code code,    // type code of value to print
34     const void *x,              // entry to print
35     int pr,                     // print level
36     FILE *f                     // file to print to
37 ) ;
38 
39 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
40 GrB_Info GB_Type_check      // check a GraphBLAS Type
41 (
42     const GrB_Type type,    // GraphBLAS type to print and check
43     const char *name,       // name of the type from the caller; optional
44     int pr,                 // print level
45     FILE *f                 // file for output
46 ) ;
47 
48 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
49 GrB_Info GB_BinaryOp_check  // check a GraphBLAS binary operator
50 (
51     const GrB_BinaryOp op,  // GraphBLAS operator to print and check
52     const char *name,       // name of the operator
53     int pr,                 // print level
54     FILE *f                 // file for output
55 ) ;
56 
57 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
58 GrB_Info GB_UnaryOp_check   // check a GraphBLAS unary operator
59 (
60     const GrB_UnaryOp op,   // GraphBLAS operator to print and check
61     const char *name,       // name of the operator
62     int pr,                 // print level
63     FILE *f                 // file for output
64 ) ;
65 
66 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
67 GrB_Info GB_SelectOp_check  // check a GraphBLAS select operator
68 (
69     const GxB_SelectOp op,  // GraphBLAS operator to print and check
70     const char *name,       // name of the operator
71     int pr,                 // print level
72     FILE *f                 // file for output
73 ) ;
74 
75 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
76 GrB_Info GB_Monoid_check        // check a GraphBLAS monoid
77 (
78     const GrB_Monoid monoid,    // GraphBLAS monoid to print and check
79     const char *name,           // name of the monoid, optional
80     int pr,                     // print level
81     FILE *f                     // file for output
82 ) ;
83 
84 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
85 GrB_Info GB_Semiring_check          // check a GraphBLAS semiring
86 (
87     const GrB_Semiring semiring,    // GraphBLAS semiring to print and check
88     const char *name,               // name of the semiring, optional
89     int pr,                         // print level
90     FILE *f                         // file for output
91 ) ;
92 
93 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
94 GrB_Info GB_Descriptor_check    // check a GraphBLAS descriptor
95 (
96     const GrB_Descriptor D,     // GraphBLAS descriptor to print and check
97     const char *name,           // name of the descriptor, optional
98     int pr,                     // print level
99     FILE *f                     // file for output
100 ) ;
101 
102 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
103 GrB_Info GB_matvec_check    // check a GraphBLAS matrix or vector
104 (
105     const GrB_Matrix A,     // GraphBLAS matrix to print and check
106     const char *name,       // name of the matrix, optional
107     int pr,                 // print level; if negative, ignore nzombie
108                             // conditions and use GB_FLIP(pr) for diagnostics
109     FILE *f,                // file for output
110     const char *kind        // "matrix" or "vector"
111 ) ;
112 
113 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
114 GrB_Info GB_Matrix_check    // check a GraphBLAS matrix
115 (
116     const GrB_Matrix A,     // GraphBLAS matrix to print and check
117     const char *name,       // name of the matrix
118     int pr,                 // print level
119     FILE *f                 // file for output
120 ) ;
121 
122 GB_PUBLIC   // accessed by the MATLAB tests in GraphBLAS/Test only
123 GrB_Info GB_Vector_check    // check a GraphBLAS vector
124 (
125     const GrB_Vector v,     // GraphBLAS vector to print and check
126     const char *name,       // name of the vector
127     int pr,                 // print level
128     FILE *f                 // file for output
129 ) ;
130 
131 GrB_Info GB_Scalar_check    // check a GraphBLAS GxB_Scalar
132 (
133     const GxB_Scalar v,     // GraphBLAS GxB_Scalar to print and check
134     const char *name,       // name of the GxB_Scalar
135     int pr,                 // print level
136     FILE *f                 // file for output
137 ) ;
138 
139 #endif
140 
141