From 9ac8ecc09912bba5c6109557ebe20575e49b2870 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Mon, 16 Dec 2019 19:49:11 +0100 Subject: [PATCH] Replace inline funcs by macros in C code --- pkg/src/functions.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/src/functions.c b/pkg/src/functions.c index 1c7295a..b634c98 100644 --- a/pkg/src/functions.c +++ b/pkg/src/functions.c @@ -1,16 +1,10 @@ #include <stdlib.h> // Index matrix (by columns) -int inline mi(int i, int j, int d1, int d2) -{ - return j*d1 + i; -} +#define mi(i, j, d1, d2) (j*d1 + i) // Index 3-tensor (by columns, matrices ordered by last dim) -int inline ti(int i, int j, int k, int d1, int d2, int d3) -{ - return k*d1*d2 + j*d1 + i; -} +#define ti(i, j, k, d1, d2, d3) (k*d1*d2 + j*d1 + i) // Empirical cross-moment of order 2 between X size nxd and Y size n void Moments_M2(double* X, double* Y, int* pn, int* pd, double* M2) -- 2.44.0