From 34a9ac8e4497e776c3ca499c41ef749f4edf8383 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 26 May 2024 00:11:00 +0200 Subject: Refactor C interface to pass operation as enum This is hmatrix style, less proliferation of functions as the number of ops increases --- cbits/arith_lists.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cbits/arith_lists.h (limited to 'cbits/arith_lists.h') diff --git a/cbits/arith_lists.h b/cbits/arith_lists.h new file mode 100644 index 0000000..c7495e8 --- /dev/null +++ b/cbits/arith_lists.h @@ -0,0 +1,10 @@ +LIST_BINOP(BO_ADD, 1, +) +LIST_BINOP(BO_SUB, 2, -) +LIST_BINOP(BO_MUL, 3, *) + +LIST_UNOP(UO_NEG, 1,) +LIST_UNOP(UO_ABS, 2,) +LIST_UNOP(UO_SIGNUM, 3,) + +LIST_REDOP(RO_SUM1, 1,) +LIST_REDOP(RO_PRODUCT1, 2,) -- cgit v1.2.3-70-g09d2