diff --git a/binding/lua/multiverso.lua b/binding/lua/multiverso.lua index e39b1fd..8535062 100644 --- a/binding/lua/multiverso.lua +++ b/binding/lua/multiverso.lua @@ -24,7 +24,7 @@ ffi.cdef[[ void MV_GetMatrixTableAll(TableHandler handler, float* data, int size); void MV_AddMatrixTableAll(TableHandler handler, float* data, int size); void MV_GetMatrixTableByRows(TableHandler handler, int row_ids[], int row_ids_n, int num_col, float** data); - void MV_AddMatrixTableByRows(TableHandler handler, int row_ids[], int row_ids_n, int num_col, float* data[]); + void MV_AddMatrixTableByRows(TableHandler handler, float* data, int num_col, int row_ids[], int row_ids_n); ]] package.cpath = "../../build/src/?.so;" .. package.cpath @@ -134,7 +134,8 @@ function mv.MatrixTableHandler:add(data, row_ids) crow_ids = util.array2cdata(row_ids, #row_ids, "int[?]") crow_ids_n = ffi.new("int", #row_ids) cdata = util.matrix2cdata(data, #row_ids, tonumber(self._num_col)) - libmv.MV_AddMatrixTableByRows(self._handler[0], crow_ids, crow_ids_n, self._num_col, cdata) + libmv.MV_AddMatrixTableByRows(self._handler[0], cdata, self._num_col, + crow_ids, crow_ids_n) end end