diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-05-26 00:11:00 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-05-26 00:11:00 +0200 |
commit | 34a9ac8e4497e776c3ca499c41ef749f4edf8383 (patch) | |
tree | f2b2e34d830d66d23ae19909c71771e810c262d0 /cbits/arith_lists.h | |
parent | 85593969debadbf11ad3c159de71e7b480ca367c (diff) |
Refactor C interface to pass operation as enum
This is hmatrix style, less proliferation of functions as the number of
ops increases
Diffstat (limited to 'cbits/arith_lists.h')
-rw-r--r-- | cbits/arith_lists.h | 10 |
1 files changed, 10 insertions, 0 deletions
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,) |