From 39e71c9e0c3735bc5f198f4df08cbbbe7a5642ec Mon Sep 17 00:00:00 2001 From: huxuan Date: Mon, 23 May 2016 21:59:50 +0900 Subject: [PATCH] Update python binding according to interface change. --- binding/python/multiverso/api.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/binding/python/multiverso/api.py b/binding/python/multiverso/api.py index aa965f8..9170858 100644 --- a/binding/python/multiverso/api.py +++ b/binding/python/multiverso/api.py @@ -124,10 +124,8 @@ class MatrixTableHandler(TableHandler): return None row_ids_n = len(row_ids) int_array_type = c_int * row_ids_n - float_array_type = c_float * self._num_col - float_pointer_array_type = POINTER(c_float) * row_ids_n + float_array_type = c_float * (self._num_col * row_ids_n) - c_data = float_pointer_array_type(*[float_array_type(*row) - for row in np.array(data).reshape((row_ids_n, self._num_col))]) - mv_lib.MV_AddMatrixTableByRows(self._handler, int_array_type(*row_ids), - row_ids_n, self._num_col, c_data) + c_data = float_array_type(* np.array(data).reshape((-1, ))) + mv_lib.MV_AddMatrixTableByRows(self._handler, c_data, self._num_col, + int_array_type(*row_ids), row_ids_n)