From ed2a4148dbb9c18f428571b3e2970d7b2adfb058 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 25 Aug 2015 11:47:47 +0800 Subject: add optional parameters to mat:create --- nerv/matrix/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nerv/matrix/init.lua b/nerv/matrix/init.lua index ae9b884..1091d7e 100644 --- a/nerv/matrix/init.lua +++ b/nerv/matrix/init.lua @@ -45,8 +45,8 @@ function nerv.Matrix:generate(gen) end end -function nerv.Matrix:create() - return self.__constructor(self:nrow(), self:ncol()) +function nerv.Matrix:create(nrow, ncol) + return self.__constructor(nrow or self:nrow(), ncol or self:ncol()) end nerv.MMatrixInt.fmt = "%d " -- cgit v1.2.3-70-g09d2