-rw-r--r-- | doc/user-manual/matrices.rst | 4 | ||||
-rw-r--r-- | matrix.lua | 13 |
diff --git a/doc/user-manual/matrices.rst b/doc/user-manual/matrices.rst index dec4e8b1..3377a6fc 100644 --- a/doc/user-manual/matrices.rst +++ b/doc/user-manual/matrices.rst @@ -123,6 +123,10 @@ Matrix methods Return a copy of the matrix. + .. method:: dim() + + Return the dimensions of the matrix, in the order the numbers of rows and the number of columns. + .. method:: get(i, j) This function returns the (i,j)-th element of a matrix. As a diff --git a/matrix.lua b/matrix.lua index 90582f75..cbf24590 100644 --- a/matrix.lua +++ b/matrix.lua @@ -658,6 +658,7 @@ matrix = { local matrix_methods = { alloc = matrix_alloc, + dim = matrix_dim, col = matrix_col, row = matrix_row, get = matrix_get, @@ -720,19 +721,9 @@ local matrix_mt = { ffi.metatype(gsl_matrix, matrix_mt) -matrix_complex = { - alloc = matrix_calloc, - col = matrix_complex_col, - row = matrix_complex_row, - get = matrix_complex_get, - set = matrix_complex_set, - copy = matrix_complex_copy, - norm = matrix_complex_norm, - slice = matrix_complex_slice -} - local matrix_complex_methods = { alloc = matrix_calloc, + dim = matrix_dim, col = matrix_complex_col, row = matrix_complex_row, get = matrix_complex_get, |