var->value = value;
}
\f
-#define MATRIX_FUNCTIONS \
- F(ABS, m_m) \
- F(ALL, d_m) \
- F(ANY, d_m) \
- F(ARSIN, m_m) \
- F(ARTAN, m_m) \
- F(BLOCK, m_any) \
- F(CHOL, m_m) \
- F(CMIN, m_m) \
- F(CMAX, m_m) \
- F(COS, m_m) \
- F(CSSQ, m_m) \
- F(CSUM, m_m) \
- F(DESIGN, m_m) \
- F(DET, d_m) \
- F(DIAG, m_m) \
- F(EVAL, m_m) \
- F(EXP, m_m) \
- F(GINV, m_m) \
- F(GRADE, m_m) \
- F(GSCH, m_m) \
- F(IDENT, IDENT) \
- F(INV, m_m) \
- F(KRONEKER, m_mm) \
- F(LG10, m_m) \
- F(LN, m_m) \
- F(MAGIC, m_d) \
- F(MAKE, m_ddd) \
- F(MDIAG, m_v) \
- F(MMAX, d_m) \
- F(MMIN, d_m) \
- F(MOD, m_md) \
- F(MSSQ, d_m) \
- F(MSUM, d_m) \
- F(NCOL, d_m) \
- F(NROW, d_m) \
- F(RANK, d_m) \
- F(RESHAPE, m_mdd) \
- F(RMAX, m_m) \
- F(RMIN, m_m) \
- F(RND, m_m) \
- F(RNKORDER, m_m) \
- F(RSSQ, m_m) \
- F(RSUM, m_m) \
- F(SIN, m_m) \
- F(SOLVE, m_mm) \
- F(SQRT, m_m) \
- F(SSCP, m_m) \
- F(SVAL, m_m) \
- F(SWEEP, m_md) \
- F(T, m_m) \
- F(TRACE, d_m) \
- F(TRANSPOS, m_m) \
- F(TRUNC, m_m) \
- F(UNIFORM, m_dd)
+#define MATRIX_FUNCTIONS \
+ F(ABS, "ABS", m_m) \
+ F(ALL, "ALL", d_m) \
+ F(ANY, "ANY", d_m) \
+ F(ARSIN, "ARSIN", m_m) \
+ F(ARTAN, "ARTAN", m_m) \
+ F(BLOCK, "BLOCK", m_any) \
+ F(CHOL, "CHOL", m_m) \
+ F(CMIN, "CMIN", m_m) \
+ F(CMAX, "CMAX", m_m) \
+ F(COS, "COS", m_m) \
+ F(CSSQ, "CSSQ", m_m) \
+ F(CSUM, "CSUM", m_m) \
+ F(DESIGN, "DESIGN", m_m) \
+ F(DET, "DET", d_m) \
+ F(DIAG, "DIAG", m_m) \
+ F(EVAL, "EVAL", m_m) \
+ F(EXP, "EXP", m_m) \
+ F(GINV, "GINV", m_m) \
+ F(GRADE, "GRADE", m_m) \
+ F(GSCH, "GSCH", m_m) \
+ F(IDENT, "IDENT", IDENT) \
+ F(INV, "INV", m_m) \
+ F(KRONEKER, "KRONEKER", m_mm) \
+ F(LG10, "LG10", m_m) \
+ F(LN, "LN", m_m) \
+ F(MAGIC, "MAGIC", m_d) \
+ F(MAKE, "MAKE", m_ddd) \
+ F(MDIAG, "MDIAG", m_v) \
+ F(MMAX, "MMAX", d_m) \
+ F(MMIN, "MMIN", d_m) \
+ F(MOD, "MOD", m_md) \
+ F(MSSQ, "MSSQ", d_m) \
+ F(MSUM, "MSUM", d_m) \
+ F(NCOL, "NCOL", d_m) \
+ F(NROW, "NROW", d_m) \
+ F(RANK, "RANK", d_m) \
+ F(RESHAPE, "RESHAPE", m_mdd) \
+ F(RMAX, "RMAX", m_m) \
+ F(RMIN, "RMIN", m_m) \
+ F(RND, "RND", m_m) \
+ F(RNKORDER, "RNKORDER", m_m) \
+ F(RSSQ, "RSSQ", m_m) \
+ F(RSUM, "RSUM", m_m) \
+ F(SIN, "SIN", m_m) \
+ F(SOLVE, "SOLVE", m_mm) \
+ F(SQRT, "SQRT", m_m) \
+ F(SSCP, "SSCP", m_m) \
+ F(SVAL, "SVAL", m_m) \
+ F(SWEEP, "SWEEP", m_md) \
+ F(T, "T", m_m) \
+ F(TRACE, "TRACE", d_m) \
+ F(TRANSPOS, "TRANSPOS", m_m) \
+ F(TRUNC, "TRUNC", m_m) \
+ F(UNIFORM, "UNIFORM", m_dd)
enum { m_d_MIN_ARGS = 1, m_d_MAX_ARGS = 1 };
enum { m_dd_MIN_ARGS = 2, m_dd_MAX_ARGS = 2 };
typedef gsl_matrix *matrix_proto_m_any (gsl_matrix *[], size_t n);
typedef gsl_matrix *matrix_proto_IDENT (double, double);
-#define F(NAME, PROTOTYPE) static matrix_proto_##PROTOTYPE matrix_eval_##NAME;
+#define F(ENUM, STRING, PROTO) static matrix_proto_##PROTO matrix_eval_##ENUM;
MATRIX_FUNCTIONS
#undef F
\f
enum matrix_op
{
/* Functions. */
-#define F(NAME, PROTOTYPE) MOP_F_##NAME,
+#define F(ENUM, STRING, PROTO) MOP_F_##ENUM,
MATRIX_FUNCTIONS
#undef F
switch (e->op)
{
-#define F(NAME, PROTOTYPE) case MOP_F_##NAME:
+#define F(ENUM, STRING, PROTO) case MOP_F_##ENUM:
MATRIX_FUNCTIONS
#undef F
case MOP_NEGATE:
{
static const struct matrix_function functions[] =
{
-#define F(NAME, PROTO) { #NAME, MOP_F_##NAME, PROTO##_MIN_ARGS, PROTO##_MAX_ARGS },
+#define F(ENUM, STRING, PROTO) \
+ { #ENUM, MOP_F_##ENUM, PROTO##_MIN_ARGS, PROTO##_MAX_ARGS },
MATRIX_FUNCTIONS
#undef F
};
case MOP_OR: return (a > 0) || (b > 0);
case MOP_XOR: return (a > 0) != (b > 0);
-#define F(NAME, PROTOTYPE) case MOP_F_##NAME:
+#define F(ENUM, STRING, PROTO) case MOP_F_##ENUM:
MATRIX_FUNCTIONS
#undef F
case MOP_NEGATE:
case MOP_OR: return "OR";
case MOP_XOR: return "XOR";
-#define F(NAME, PROTOTYPE) case MOP_F_##NAME:
+#define F(ENUM, STRING, PROTO) case MOP_F_##ENUM:
MATRIX_FUNCTIONS
#undef F
case MOP_NEGATE:
return dm;
}
-#define F(NAME, PROTOTYPE) \
- static gsl_matrix *matrix_expr_evaluate_##PROTOTYPE ( \
+#define F(ENUM, STRING, PROTO) \
+ static gsl_matrix *matrix_expr_evaluate_##PROTO ( \
const char *name, gsl_matrix *[], size_t, \
- matrix_proto_##PROTOTYPE *);
+ matrix_proto_##PROTO *);
MATRIX_FUNCTIONS
#undef F
gsl_matrix *result = NULL;
switch (e->op)
{
-#define F(NAME, PROTOTYPE) \
- case MOP_F_##NAME: \
- result = matrix_expr_evaluate_##PROTOTYPE (#NAME, \
- subs, e->n_subs, \
- matrix_eval_##NAME); \
+#define F(ENUM, STRING, PROTO) \
+ case MOP_F_##ENUM: \
+ result = matrix_expr_evaluate_##PROTO (STRING, subs, e->n_subs, \
+ matrix_eval_##ENUM); \
break;
MATRIX_FUNCTIONS
#undef F