From 92417782cccc4fe776604c1acafb03e6948447a6 Mon Sep 17 00:00:00 2001 From: Lukas Krenz Date: Wed, 9 Feb 2022 17:12:59 +0100 Subject: [PATCH 1/3] Fix #24 --- include/easi/component/LuaMap.h | 4 ++-- src/component/LuaMap.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/easi/component/LuaMap.h b/include/easi/component/LuaMap.h index 05d0512..ae3dec7 100644 --- a/include/easi/component/LuaMap.h +++ b/include/easi/component/LuaMap.h @@ -27,13 +27,13 @@ class LuaMap : public Map { ~LuaMap() override; protected: - virtual Matrix map(Matrix& x) override; + Matrix map(Matrix& x) override; private: double executeLuaFunction(Matrix x, unsigned coordIdx, unsigned funcIdx); std::string function; std::vector idxToNameMap; - lua_State* luaState; + lua_State* luaState{nullptr}; }; diff --git a/src/component/LuaMap.cpp b/src/component/LuaMap.cpp index a7284e4..0fb9564 100644 --- a/src/component/LuaMap.cpp +++ b/src/component/LuaMap.cpp @@ -32,7 +32,6 @@ double LuaMap::executeLuaFunction(Matrix x, unsigned coordIdx, unsigned funcIdx) { if (!luaState) { - std::cout << "Init lua state" << std::endl; luaState = luaL_newstate(); luaL_openlibs(luaState); const auto status = luaL_dostring(luaState, function.data()); From 861ecf69d9bd4c6b1a4baf8cf4bdb98bfce90cf6 Mon Sep 17 00:00:00 2001 From: Lukas Krenz Date: Wed, 9 Feb 2022 17:13:17 +0100 Subject: [PATCH 2/3] Bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91ab18e..dcc21cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(easi) cmake_minimum_required(VERSION 3.13) set(EASI_VERSION_MAJOR 1) set(EASI_VERSION_MINOR 1) -set(EASI_VERSION_PATCH 0) +set(EASI_VERSION_PATCH 1) include(GNUInstallDirs) include(CMakePackageConfigHelpers) From f4083de0dc24e4b064a069713d8086fc19d12c98 Mon Sep 17 00:00:00 2001 From: Lukas Krenz Date: Wed, 9 Feb 2022 17:18:55 +0100 Subject: [PATCH 3/3] Make yaml 4_lua nicer --- examples/4_lua.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/4_lua.yaml b/examples/4_lua.yaml index d55f49f..78a261e 100644 --- a/examples/4_lua.yaml +++ b/examples/4_lua.yaml @@ -8,7 +8,7 @@ components: mu: 0.0 lambda: 1.96e10 - !LuaMap - returns: ["rho", "mu", "lambda"] + returns: [rho, mu, lambda] function: | function f (x) io.write(x[1], " ", x[2], " ", x[3], "\n") -- optional debug output