From 23fd2694723ab3f2203e6cd040c5e6633cb989c7 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 18 May 2015 19:29:37 +0800 Subject: add rowsum for cumatrix --- matrix/matrix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'matrix/matrix.c') diff --git a/matrix/matrix.c b/matrix/matrix.c index ef311d6..b392f56 100644 --- a/matrix/matrix.c +++ b/matrix/matrix.c @@ -10,7 +10,7 @@ const char *nerv_float_matrix_(tname) = "nerv.FloatMatrix"; -static void host_float_array_alloc(float **dptr, long *stride, +static void host_float_array_alloc(float **dptr, size_t *stride, long width, long height) { *dptr = (float *)malloc(width * height); *stride = width; @@ -29,7 +29,6 @@ int nerv_float_matrix_(set_elem)(lua_State *L) { Matrix *self = luaT_checkudata(L, 1, nerv_float_matrix_(tname)); int idx = luaL_checkinteger(L, 2); float v = luaL_checknumber(L, 3); - long upper = self->nrow * self->ncol; if (idx < 0 || idx >= self->nmax) nerv_error(L, "index must be within range [0, %d)", self->nmax); self->data.f[idx] = v; -- cgit v1.2.3-70-g09d2