From a2636f1f5f967e9bef0adfc039d60c15d8608914 Mon Sep 17 00:00:00 2001 From: CismonX Date: Sun, 10 Mar 2019 23:23:11 +0800 Subject: [PATCH] update stubs --- stubs/impl/CxDCol.php | 2 +- stubs/impl/CxDMat.php | 2 +- stubs/impl/CxDRow.php | 2 +- stubs/impl/CxDSvCol.php | 8 ++ stubs/impl/CxDSvRow.php | 8 ++ stubs/impl/{DColvec.php => DCol.php} | 2 +- stubs/impl/DMat.php | 2 +- stubs/impl/DRow.php | 2 +- stubs/impl/DSvCol.php | 8 ++ stubs/impl/DSvRow.php | 8 ++ stubs/impl/ICol.php | 2 +- stubs/impl/IMat.php | 2 +- stubs/impl/IRow.php | 2 +- stubs/impl/ISvCol.php | 8 ++ stubs/impl/ISvRow.php | 8 ++ stubs/impl/SpCxDMat.php | 2 +- stubs/impl/SpDMat.php | 2 +- stubs/impl/SpIMat.php | 2 +- stubs/internal/Common.php | 17 ---- stubs/internal/Dense.php | 2 +- stubs/internal/Matrix.php | 132 ++++++++++++++++++--------- stubs/internal/Resizable.php | 23 +++++ stubs/internal/ResizableMatrix.php | 37 ++++++++ stubs/internal/ResizableVector.php | 23 +++++ stubs/internal/Sparse.php | 18 +++- stubs/internal/Splittable.php | 83 ----------------- stubs/internal/Vector.php | 27 ++++++ 27 files changed, 279 insertions(+), 155 deletions(-) create mode 100644 stubs/impl/CxDSvCol.php create mode 100644 stubs/impl/CxDSvRow.php rename stubs/impl/{DColvec.php => DCol.php} (57%) create mode 100644 stubs/impl/DSvCol.php create mode 100644 stubs/impl/DSvRow.php create mode 100644 stubs/impl/ISvCol.php create mode 100644 stubs/impl/ISvRow.php create mode 100644 stubs/internal/Resizable.php create mode 100644 stubs/internal/ResizableMatrix.php create mode 100644 stubs/internal/ResizableVector.php delete mode 100644 stubs/internal/Splittable.php diff --git a/stubs/impl/CxDCol.php b/stubs/impl/CxDCol.php index dcb3a31..78b9b23 100644 --- a/stubs/impl/CxDCol.php +++ b/stubs/impl/CxDCol.php @@ -2,7 +2,7 @@ namespace Arma; -class CxDCol implements Col +class CxDCol implements Col, Internal\ResizableVector { /** * Construct a complex column vector out of two non-complex column vectors. diff --git a/stubs/impl/CxDMat.php b/stubs/impl/CxDMat.php index de4bc7c..0759697 100644 --- a/stubs/impl/CxDMat.php +++ b/stubs/impl/CxDMat.php @@ -2,7 +2,7 @@ namespace Arma; -class CxDMat implements Mat +class CxDMat implements Mat, Internal\ResizableMatrix { /** * Construct a complex matrix out of two non-complex matrices. diff --git a/stubs/impl/CxDRow.php b/stubs/impl/CxDRow.php index 58645bc..d295984 100644 --- a/stubs/impl/CxDRow.php +++ b/stubs/impl/CxDRow.php @@ -2,7 +2,7 @@ namespace Arma; -class CxDRow implements Row +class CxDRow implements Row, Internal\ResizableVector { /** * Construct a complex row vector out of two non-complex row vectors. diff --git a/stubs/impl/CxDSvCol.php b/stubs/impl/CxDSvCol.php new file mode 100644 index 0000000..ca05941 --- /dev/null +++ b/stubs/impl/CxDSvCol.php @@ -0,0 +1,8 @@ + 0, the k-th super-diagonal is accessed (top-right corner). - * For k < 0, the k-th sub-diagonal is accessed (bottom-left corner). - * - * @param int $k - * @return Subview - */ - function diag($k = 0); + // Matrix characteristics /** * Check whether the matrix has exactly one column or one row. @@ -111,4 +71,94 @@ interface Matrix * @return bool */ function isHermitian(); + + // Matrix subview + + /** + * Read/write access to a certain column of the object. + * + * @param int $col_number + * @return Subview + */ + function col($col_number); + + /** + * Read/write access to a certain row of the object. + * + * @param int $row_number + * @return Subview + */ + function row($row_number); + + /** + * Read/write access to certain columns of the object. + * + * @param int $first_col + * @param int $last_col + * @return Subview + */ + function cols($first_col, $last_col); + + /** + * Read/write access to certain rows of the object. + * + * @param int $first_row + * @param int $last_row + * @return Subview + */ + function rows($first_row, $last_row); + + /** + * Read/write access to a matrix subview. + * + * @param int $first_row + * @param int $first_col + * @param int $last_row + * @param int $last_col + * @return Subview + */ + function submat($first_row, $first_col, $last_row, $last_col); + + /** + * Read/write access to a matrix subview of first specified columns. + * + * @param $n_cols + * @return Subview + */ + function head_cols($n_cols); + + /** + * Read/write access to a matrix subview of first specified rows. + * + * @param int $n_rows + * @return Subview + */ + function head_rows($n_rows); + + /** + * Read/write access to a matrix subview of last specified columns. + * + * @param int $n_cols + * @return Subview + */ + function tail_cols($n_cols); + + /** + * Read/write access to a matrix subview of last specified rows. + * + * @param int $n_rows + * @return Subview + */ + function tail_rows($n_rows); + + /** + * Read/write access to a diagonal in a matrix. + * + * For k=0 the main diagonal is accessed. For k > 0, the k-th super-diagonal is accessed (top-right corner). + * For k < 0, the k-th sub-diagonal is accessed (bottom-left corner). + * + * @param int $k + * @return Subview + */ + function diag($k = 0); } diff --git a/stubs/internal/Resizable.php b/stubs/internal/Resizable.php new file mode 100644 index 0000000..11d01c0 --- /dev/null +++ b/stubs/internal/Resizable.php @@ -0,0 +1,23 @@ +