summaryrefslogtreecommitdiff
path: root/matrix/matrix.c
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-18 19:29:37 +0800
committerDeterminant <[email protected]>2015-05-18 19:29:37 +0800
commit23fd2694723ab3f2203e6cd040c5e6633cb989c7 (patch)
tree407e5b1f2826df831336fbb8f1bfd69f8ca6e7c5 /matrix/matrix.c
parent0f953414dfdbd7abb7b867ce0c3f9390551c1083 (diff)
add rowsum for cumatrix
Diffstat (limited to 'matrix/matrix.c')
-rw-r--r--matrix/matrix.c3
1 files changed, 1 insertions, 2 deletions
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;