From 8bc421dc3061cb2a62c978538ca41172c4ddea98 Mon Sep 17 00:00:00 2001 From: maakshishov Date: Fri, 25 Sep 2020 13:42:09 +0300 Subject: [PATCH] PIMathMatrix.h documentation correction --- libs/main/math/pimathmatrix.h | 55 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/libs/main/math/pimathmatrix.h b/libs/main/math/pimathmatrix.h index 7d42fbc3..cc0eacb8 100644 --- a/libs/main/math/pimathmatrix.h +++ b/libs/main/math/pimathmatrix.h @@ -235,12 +235,12 @@ public: } /** - * @brief Set the selected column in matrix. + * @brief Set the selected column in this matrix. * If you enter an index out of the border of the matrix there will be "undefined behavior" * * @param index is the number of the selected column * @param v is a vector of the type _CMCol that needs to fill the column - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &setCol(uint index, const _CMCol &v) { PIMM_FOR_R(i) m[i][index] = v[i]; @@ -248,12 +248,12 @@ public: } /** - * @brief Set the selected row in matrix + * @brief Set the selected row in this matrix * If you enter an index out of the border of the matrix there will be "undefined behavior" * * @param index is the number of the selected row * @param v is a vector of the type _CMCol that needs to fill the row - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &setRow(uint index, const _CMRow &v) { PIMM_FOR_C(i) m[index][i] = v[i]; @@ -261,12 +261,12 @@ public: } /** - * @brief Method which changes selected rows in a matrix. + * @brief Method which changes selected rows in this matrix. * If you enter an index out of the border of the matrix there will be "undefined behavior" * * @param r0 is the number of the first selected row * @param r1 is the number of the second selected row - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &swapRows(uint r0, uint r1) { Type t; @@ -279,12 +279,12 @@ public: } /** - * @brief Method which changes selected columns in a matrix. + * @brief Method which changes selected columns in this matrix. * If you enter an index out of the border of the matrix there will be "undefined behavior" * * @param c0 is the number of the first selected column * @param c1 is the number of the second selected column - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &swapCols(uint c0, uint c1) { Type t; @@ -297,10 +297,10 @@ public: } /** - * @brief Method which fills the matrix with selected value + * @brief Method which set this matrix elements with selected value * * @param v is a parameter the type and value of which is selected and later filled into the matrix - * @return filled matrix type _CMatrix + * @return reference to this */ _CMatrix &fill(const Type &v) { PIMM_FOR_WB(r, c) m[r][c] = v; @@ -374,7 +374,7 @@ public: * @brief Matrix assignment to matrix "sm" * * @param sm matrix for the assigment - * @return matrix equal with sm + * @return this matrix equal with sm */ _CMatrix &operator=(const _CMatrix &sm) { memcpy(m, sm.m, sizeof(Type) * Cols * Rows); @@ -512,7 +512,7 @@ public: * @brief Transforming matrix to upper triangular. Works only with square matrix, nonzero matrices and invertible matrix * * @param ok is a parameter with which we can find out if the method worked correctly - * @return copy of transformed upper triangular matrix + * @return reference to this of transformed upper triangular matrix */ _CMatrix &toUpperTriangular(bool *ok = 0) { if (Cols != Rows) { @@ -554,8 +554,7 @@ public: /** * @brief Matrix inversion operation. Works only with square matrix, nonzero matrices and invertible matrix * - * @param ok is a parameter with which we can find out if the method worked correctly - * @return copy of inverted matrix + * @param ok is a parameter with which we can find out if the method worked correct * @return reference to this inverted matrix */ _CMatrix &invert(bool *ok = 0) { static_assert(Cols == Rows, "Only square matrix invertable"); @@ -941,12 +940,12 @@ public: static _CMatrix matrixCol(const PIMathVector &val) { return _CMatrix(1, val.size(), val.toVector()); } /** - * @brief Set the selected column in matrix. If there are more elements of the vector than elements in the column of the matrix - * or index larger than the number of columns otherwise there will be "undefined behavior" + * @brief Set the selected column in this matrix. If there are more elements of the vector than elements in the column of the matrix + * or index larger than the number of columns otherwise there will be "undefined behavior" * * @param index is the number of the selected column * @param v is a vector of the type _CMCol that needs to fill the column - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &setCol(uint index, const _CMCol &v) { PIMM_FOR_R(i) _V2D::element(i, index) = v[i]; @@ -954,11 +953,11 @@ public: } /** - * @brief Set the selected row in matrix. If there are more elements of the vector than elements in the row of the matrix, + * @brief Set the selected row in this matrix. If there are more elements of the vector than elements in the row of the matrix, * or index larger than the number of rows otherwise there will be "undefined behavior" * @param index is the number of the selected row * @param v is a vector of the type _CMCol that needs to fill the row - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &setRow(uint index, const _CMCol &v) { PIMM_FOR_C(i) _V2D::element(index, i) = v[i]; @@ -966,12 +965,12 @@ public: } /** - * @brief Method which replace selected columns in a matrix. You cannot use an index larger than the number of columns, + * @brief Method which replace selected columns in this matrix. You cannot use an index larger than the number of columns, * otherwise there will be "undefined behavior" * * @param r0 is the number of the first selected row * @param r1 is the number of the second selected row - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &swapCols(uint r0, uint r1) { PIMM_FOR_C(i) { piSwap(_V2D::element(i, r0), _V2D::element(i, r1)); } @@ -979,12 +978,12 @@ public: } /** - * @brief Method which replace selected rows in a matrix. You cannot use an index larger than the number of rows, + * @brief Method which replace selected rows in this matrix. You cannot use an index larger than the number of rows, * otherwise there will be "undefined behavior" * * @param c0 is the number of the first selected row * @param c1 is the number of the second selected row - * @return matrix type _CMatrix + * @return reference to this */ _CMatrix &swapRows(uint c0, uint c1) { PIMM_FOR_R(i) { piSwap(_V2D::element(c0, i), _V2D::element(c1, i)); } @@ -992,10 +991,10 @@ public: } /** - * @brief Method which fills the matrix with selected value + * @brief Method which set this matrix elements with selected value * * @param v is a parameter the type and value of which is selected and later filled into the matrix - * @return filled matrix type _CMatrix + * @return reference to this */ _CMatrix &fill(const Type &v) { PIMM_FOR_A(i) _V2D::mat[i] = v; @@ -1040,7 +1039,7 @@ public: * @brief Matrix assignment to matrix "v" * * @param v matrix for the assigment - * @return matrix equal with v + * @return reference to this matrix equal with v */ _CMatrix &operator=(const PIVector > &v) { *this = _CMatrix(v); @@ -1197,7 +1196,7 @@ public: * @brief Transforming matrix to upper triangular. Works only with square matrix, nonzero matrices and invertible matrix * * @param ok is a parameter with which we can find out if the method worked correctly - * @return copy of transformed upper triangular matrix + * @return this transformed upper triangular matrix */ _CMatrix &toUpperTriangular(bool *ok = 0) { if (!isSquare()) { @@ -1241,7 +1240,7 @@ public: * * @param ok is a parameter with which we can find out if the method worked correctly * @param sv is a vector multiplier - * @return copy of inverted matrix + * @return this inverted matrix */ _CMatrix &invert(bool *ok = 0, _CMCol *sv = 0) { if (!isSquare()) {