
%-------------------------------------------------------------------------------
\newpage
\subsection{{\sf GrB\_BinaryOp} Options}
\label{get_set_binop}
%-------------------------------------------------------------------------------

\begin{mdframed}[userdefinedwidth=6in]
{\footnotesize
\begin{verbatim}
GrB_Info GrB_get (GrB_BinaryOp op, GrB_Scalar value, int f) ;
GrB_Info GrB_get (GrB_BinaryOp op, char *     value, int f) ;
GrB_Info GrB_get (GrB_BinaryOp op, int32_t *  value, int f) ;
GrB_Info GrB_get (GrB_BinaryOp op, size_t *   value, int f) ;

GrB_Info GrB_set (GrB_BinaryOp op, char *     value, int f) ;
\end{verbatim}
}\end{mdframed}

\noindent
{\small
\begin{tabular}{|l|l|l|p{2.8in}|}
\hline
\verb'int field'                    & R/W  & C type        & description \\
\hline
\verb'GrB_INP0_TYPE_CODE'          & R    & \verb'int32_t'& 1st input type code (see \verb'GrB_Type_code') \\
\verb'GrB_INP1_TYPE_CODE'          & R    & \verb'int32_t'& 2nd input type code \\
\verb'GrB_OUTP_TYPE_CODE'          & R    & \verb'int32_t'& output type code \\
\verb'GxB_THETA_TYPE_CODE'         & R    & \verb'int32_t'& $\Theta$ type code, if any \\
\verb'GrB_INP0_TYPE_STRING'        & R    & \verb'char *' & name of the 1st input type \\
\verb'GrB_INP1_TYPE_STRING'        & R    & \verb'char *' & name of the 2nd input type \\
\verb'GrB_OUTP_TYPE_STRING'        & R    & \verb'char *' & name of the output type \\
\verb'GxB_THETA_TYPE_STRING'       & R    & \verb'char *' & name of the $\Theta$ type, if any \\
\hline
\verb'GrB_NAME'                     & R/W1 & \verb'char *' &    % GrB_ALREADY_SET (binop)
    name of the operator.  For built-in operators, this returns the GraphBLAS
    name (\verb'"GrB_LOR"' for \verb'GrB_LOR', for example).
    For user-defined operators, the name can be any string of any length.  It
    is not used by the JIT.  It can be set at most once. \\
\verb'GxB_JIT_C_NAME'               & R/W1 & \verb'char *' &
    This must be a valid name of a C function to enable its use in the JIT.
    The length of the name can be at most \verb'GxB_MAX_NAME_LEN', including
    the \verb'nul' terminating byte.  It can be set at most once. \\
\verb'GxB_JIT_C_DEFINITION'         & R/W1 & \verb'char *' &
    definition for a user-defined operator, as a C function; built-in operators
    return an empty string.  It can be set at most once. \\
\verb'GxB_THETA' & R & \verb'GrB_Scalar' &
    value of \verb'Theta', if any.
    The type of the \verb'GrB_Scalar'
    must match the \verb'Theta' type of the underlying
    index-binary operator exactly. \\
\hline
\end{tabular}
}

Built-in operators cannot be modified by \verb'GrB_set'.  User-defined
operators can be used without setting their name or definition, but they can be
used in JIT kernels only when both the JIT C name and the definition are set.

To use the JIT, all monoids and semirings that access this binary operator must
be defined after the user-defined operator has been given both a name and a
definition.  GraphBLAS can use a monoid or semiring that uses a binary operator
without a name, but it cannot use the JIT, even if the operator is given a name
later on after the operator is created.

The \verb'*THETA*' options can only be used in a binary operator
created by \verb'GxB_BinaryOp_new_IndexOp'.

