From b6301089cde20f4c825c7f5deaf179082aad63da Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 24 Jun 2015 22:45:18 +0800 Subject: use libnervcore & libluaT --- tnet_io/cwrapper.cpp | 10 +++++++--- tnet_io/cwrapper.h | 2 +- tnet_io/init.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'tnet_io') diff --git a/tnet_io/cwrapper.cpp b/tnet_io/cwrapper.cpp index 84e1d63..98ad864 100644 --- a/tnet_io/cwrapper.cpp +++ b/tnet_io/cwrapper.cpp @@ -10,7 +10,7 @@ extern "C" { #include "string.h" #include "../../nerv/common.h" - extern Matrix *nerv_matrix_host_float_new_(lua_State *L, long nrow, long ncol); + extern Matrix *nerv_matrix_host_float_create(long nrow, long ncol, Status *status); struct TNetFeatureRepo { TNet::FeatureRepository feature_repo; @@ -60,7 +60,9 @@ extern "C" { repo->feats_host.CheckData(utter_str); int n = repo->feats_host.Rows(); int m = repo->feats_host.Cols(); - mat = nerv_matrix_host_float_new_(L, n, m); + Status status; + mat = nerv_matrix_host_float_create(n, m, &status); + NERV_LUA_CHECK_STATUS(L, status); size_t stride = mat->stride; if (debug) fprintf(stderr, "[tnet] feature: %s %d %d\n", utter_str.c_str(), n, m); @@ -124,7 +126,9 @@ extern "C" { sample_rate, tag); int n = labs_hosts[0].Rows(); int m = labs_hosts[0].Cols(); - mat = nerv_matrix_host_float_new_(L, n, m); + Status status; + mat = nerv_matrix_host_float_create(n, m, &status); + NERV_LUA_CHECK_STATUS(L, status); size_t stride = mat->stride; if (debug) fprintf(stderr, "[tnet] label: %s %d %d\n", tag, n, m); diff --git a/tnet_io/cwrapper.h b/tnet_io/cwrapper.h index 01371ec..a52770b 100644 --- a/tnet_io/cwrapper.h +++ b/tnet_io/cwrapper.h @@ -1,6 +1,6 @@ #ifndef NERV_TNET_IO_CWRAPPER #define NERV_TNET_IO_CWRAPPER -#include "../../nerv/matrix/generic/matrix.h" +#include "../../nerv/lib/matrix/matrix.h" #include "../../nerv/common.h" #ifdef __cplusplus extern "C" { diff --git a/tnet_io/init.c b/tnet_io/init.c index 5251d1e..3e3f90d 100644 --- a/tnet_io/init.c +++ b/tnet_io/init.c @@ -4,7 +4,7 @@ const char *nerv_tnet_feat_repo_tname = "nerv.TNetFeatureRepo"; const char *nerv_tnet_label_repo_tname = "nerv.TNetLabelRepo"; -extern const char *nerv_matrix_host_float_tname; +const char *nerv_matrix_host_float_tname = "nerv.MMatrixFloat"; static int feat_repo_new(lua_State *L) { const char *scp_file = luaL_checkstring(L, 1); -- cgit v1.2.3-70-g09d2