PIMathMatrix.h documentation correction

This commit is contained in:
2020-10-01 15:34:24 +03:00
parent 8bc421dc30
commit e16243d64b
2 changed files with 94 additions and 111 deletions

View File

@@ -29,10 +29,10 @@
#include "pimathcomplex.h"
/**
* @brief Inline funtion of compare with zero different types
* @brief Floating point number specific comparison between value of matrix passed as parameter and zero
*
* @param v is input parameter of type T
* @return true if zero, false if not zero
* @param v floating point parameter for comparison
* @return true if v in locality of zero, otherwise false
*/
template<typename T>
inline bool _PIMathMatrixNullCompare(const T v) {
@@ -41,10 +41,10 @@ inline bool _PIMathMatrixNullCompare(const T v) {
}
/**
* @brief Inline funtion of compare with zero colmplexf type
* @brief Floating point number specific comparison between parameter value of matrix of complexf type and zero
*
* @param v is input parameter of type colmplexf
* @return true if zero, false if not zero
* @return true if absolute value of v in locality of zero, otherwise false
*/
template<>
inline bool _PIMathMatrixNullCompare<complexf>(const complexf v) {
@@ -52,10 +52,10 @@ inline bool _PIMathMatrixNullCompare<complexf>(const complexf v) {
}
/**
* @brief Inline funtion of compare with zero complexd type
* @brief Floating point number specific comparison between parameter value of matrix of complexd type and zero
*
* @param v is input parameter of type colmplexd
* @return true if zero, false if not zero
* @return true if absolute value of v in locality of zero, otherwise false
*/
template<>
inline bool _PIMathMatrixNullCompare<complexd>(const complexd v) {
@@ -120,10 +120,10 @@ public:
}
/**
* @brief Creates a matrix that is filled with elements
* @brief Creates a matrix and sets it with elements equal to value "v"
*
* @param v is a parameter the type and value of which is selected and later filled into the matrix
* @return filled matrix of type PIMathMatrixT
* @return filled matrix of type PIMathMatrixT equal to "v"
*/
static _CMatrix filled(const Type &v) {
_CMatrix tm;
@@ -145,7 +145,7 @@ public:
* else return default construction of PIMathMatrixT
*
* @param angle is the angle of rotation of the matrix along the X axis
* @return rotated matrix
* @return rotated matrix along the X axis
*/
static _CMatrix rotationX(double angle) { return _CMatrix(); }
@@ -154,7 +154,7 @@ public:
* else return default construction of PIMathMatrixT
*
* @param angle is the angle of rotation of the matrix along the Y axis
* @return rotated matrix
* @return rotated matrix along the Y axis
*/
static _CMatrix rotationY(double angle) { return _CMatrix(); }
@@ -163,7 +163,7 @@ public:
* else return default construction of PIMathMatrixT
*
* @param angle is the angle of rotation of the matrix along the Z axis
* @return rotated matrix
* @return rotated matrix along the Z axis
*/
static _CMatrix rotationZ(double angle) { return _CMatrix(); }
@@ -172,7 +172,7 @@ public:
* else return default construction of PIMathMatrixT
*
* @param factor is the value of scaling by X axis
* @return rotated matrix
* @return rotated matrix along the axis X
*/
static _CMatrix scaleX(double factor) { return _CMatrix(); }
@@ -181,7 +181,7 @@ public:
* else return default construction of PIMathMatrixT
*
* @param factor is the value of scaling by Y axis
* @return rotated matrix
* @return rotated matrix along the axis Y
*/
static _CMatrix scaleY(double factor) { return _CMatrix(); }
@@ -190,26 +190,26 @@ public:
* else return default construction of PIMathMatrixT
*
* @param factor is the value of scaling by Z axis
* @return rotated matrix
* @return rotated matrix along the axis Z
*/
static _CMatrix scaleZ(double factor) { return _CMatrix(); }
/**
* @brief Method which returns number of columns in matrix
* @brief Method which returns number of columns in this matrix
*
* @return type uint shows number of columns
* @return number of columns
*/
uint cols() const { return Cols; }
/**
* @brief Method which returns number of rows in matrix
* @brief Method which returns number of rows in this matrix
*
* @return type uint shows number of rows
* @return number of rows
*/
uint rows() const { return Rows; }
/**
* @brief Method which returns the selected column in PIMathVectorT format.
* @brief Method which returns the selected column of this matrix in PIMathVectorT format.
* 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
@@ -222,7 +222,7 @@ public:
}
/**
* @brief Method which returns the selected row in PIMathVectorT format
* @brief Method which returns the selected row of this matrix in PIMathVectorT format.
* 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
@@ -261,7 +261,7 @@ public:
}
/**
* @brief Method which changes selected rows in this matrix.
* @brief Method which permutes the values of two selected rows among themselves 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
@@ -279,7 +279,7 @@ public:
}
/**
* @brief Method which changes selected columns in this matrix.
* @brief Method which permutes the values of two selected columns among themselves 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
@@ -308,7 +308,7 @@ public:
}
/**
* @brief Method which checks if matrix is square
* @brief Method which checks if this matrix is square
*
* @return true if matrix is square, else false
*/
@@ -335,24 +335,14 @@ public:
}
/**
* @brief Full access to elements reference by row "row" and col "col".
* @brief Read-only access to elements reference by row "row" and column "col".
* If you enter an index out of the border of the matrix there will be "undefined behavior"
*
* @param row is a parameter that shows the row number of the matrix of the selected element
* @param col is a parameter that shows the column number of the matrix of the selected element
* @return reference to element of matrix by row "row" and col "col"
* @return reference to element of this matrix
*/
Type &at(uint row, uint col) { return m[row][col]; }
/**
* @brief Full access to element by row "row" and col "col".
* If you enter an index out of the border of the matrix there will be "undefined behavior"
*
* @param row is a parameter that shows the row number of the matrix of the selected element
* @param col is a parameter that shows the column number of the matrix of the selected element
* @return element of matrix by row "row" and col "col"
*/
Type at(uint row, uint col) const { return m[row][col]; }
const Type &at(uint row, uint col) { return m[row][col]; }
/**
* @brief Full access to the matrix row pointer. If you enter an index out of the border of the matrix there will be "undefined behavior"
@@ -371,10 +361,10 @@ public:
const Type *operator[](uint row) const { return m[row]; }
/**
* @brief Matrix assignment to matrix "sm"
* @brief Assignment all elements of this matrix with all elements of matrix "sm"
*
* @param sm matrix for the assigment
* @return this matrix equal with sm
* @param sm matrix used for the assignment
* @return matrix whose each element is equal to each element of the matrix "sm"
*/
_CMatrix &operator=(const _CMatrix &sm) {
memcpy(m, sm.m, sizeof(Type) * Cols * Rows);
@@ -382,9 +372,9 @@ public:
}
/**
* @brief Compare with matrix "sm"
* @brief Compare all elements of this matrix with all elements of matrix "sm"
*
* @param sm matrix for the compare
* @param sm matrix used for the compare
* @return if matrices are equal true, else false
*/
bool operator==(const _CMatrix &sm) const {
@@ -393,36 +383,36 @@ public:
}
/**
* @brief Compare with matrix "sm"
* @brief Compare all elements of this matrix with all elements of matrix "sm"
*
* @param sm matrix for the compare
* @param sm matrix used for the compare
* @return if matrices are not equal true, else false
*/
bool operator!=(const _CMatrix &sm) const { return !(*this == sm); }
/**
* @brief Addition assignment with matrix "sm"
* @brief Addition all elements of this matrix with all elements matrix "sm"
*
* @param sm matrix for the addition assigment
*/
void operator+=(const _CMatrix &sm) { PIMM_FOR_WB(r, c) m[r][c] += sm.m[r][c]; }
/**
* @brief Subtraction assignment with matrix "sm"
* @brief Subtraction all elements of this matrix with all elements matrix "sm"
*
* @param sm matrix for the subtraction assigment
*/
void operator-=(const _CMatrix &sm) { PIMM_FOR_WB(r, c) m[r][c] -= sm.m[r][c]; }
/**
* @brief Multiplication assignment with value "v"
* @brief Multiplication all elements of this matrix with value "v"
*
* @param v value for the multiplication assigment
*/
void operator*=(const Type &v) { PIMM_FOR_WB(r, c) m[r][c] *= v; }
/**
* @brief Division assignment with value "v"
* @brief Division all elements of this matrix with value "v"
*
* @param v value for the division assigment
*/
@@ -440,7 +430,7 @@ public:
}
/**
* @brief Matrix addition
* @brief Addition all elements of this matrix with all elements of matrix "sm"
*
* @param sm is matrix term
* @return the result of matrix addition
@@ -452,7 +442,7 @@ public:
}
/**
* @brief Matrix substraction
* @brief Substraction all elements of this matrix with all elements of matrix "sm"
*
* @param sm is matrix subtractor
* @return the result of matrix substraction
@@ -464,7 +454,7 @@ public:
}
/**
* @brief Matrix multiplication
* @brief Multiplication all elements of this matrix with value "v"
*
* @param v is value factor
* @return the result of matrix multiplication
@@ -476,7 +466,7 @@ public:
}
/**
* @brief Matrix division
* @brief Division all elements of this matrix with value "v"
*
* @param v is value divider
* @return the result of matrix division
@@ -731,11 +721,11 @@ inline std::ostream & operator <<(std::ostream & s, const PIMathMatrixT<Rows, Co
#endif
/**
* @brief Add matrix "m" at the end of matrix and return reference to matrix
* @brief Outputting the matrix to the console
*
* @param s PICout type
* @param m PIMathMatrixT type
* @return bitwise left PICout
* @param the matrix type PIMathMatrixT that we print to the console
* @return PIMathMatrix printed to the console
*/
template<uint Rows, uint Cols, typename Type>
inline PICout operator<<(PICout s, const PIMathMatrixT<Rows, Cols, Type> &m) {
@@ -965,7 +955,7 @@ public:
}
/**
* @brief Method which replace selected columns in this matrix. You cannot use an index larger than the number of columns,
* @brief Method which permutes the values of two selected columns among themselves 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
@@ -978,7 +968,7 @@ public:
}
/**
* @brief Method which replace selected rows in this matrix. You cannot use an index larger than the number of rows,
* @briefMethod which permutes the values of two selected rows among themselves 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
@@ -1036,9 +1026,9 @@ public:
bool isValid() const { return !PIVector2D<Type>::isEmpty(); }
/**
* @brief Matrix assignment to matrix "v"
* @brief Assignment all elements of this matrix with all elements of matrix "sm"
*
* @param v matrix for the assigment
* @param v matrix used for the assigment
* @return reference to this matrix equal with v
*/
_CMatrix &operator=(const PIVector<PIVector<Type> > &v) {
@@ -1047,9 +1037,9 @@ public:
}
/**
* @brief Compare with matrix "sm"
* @brief Compare all elements of this matrix with all elements of matrix "sm"
*
* @param sm matrix for the compare
* @param sm matrix used for the compare
* @return if matrices are equal true, else false
*/
bool operator==(const _CMatrix &sm) const {
@@ -1058,36 +1048,36 @@ public:
}
/**
* @brief Compare with matrix "sm"
* @brief Compare all elements of this matrix with all elements of matrix "sm"
*
* @param sm matrix for the compare
* @param sm matrix used for the compare
* @return if matrices are not equal true, else false
*/
bool operator!=(const _CMatrix &sm) const { return !(*this == sm); }
/**
* @brief Addition assignment with matrix "sm"
* @brief Addition all elements of this matrix with all elements matrix "sm"
*
* @param sm matrix for the addition assigment
*/
void operator+=(const _CMatrix &sm) { PIMM_FOR_A(i) _V2D::mat[i] += sm.mat[i]; }
/**
* @brief Subtraction assignment with matrix "sm"
* @brief Subtraction all elements of this matrix with all elements matrix "sm"
*
* @param sm matrix for the subtraction assigment
*/
void operator-=(const _CMatrix &sm) { PIMM_FOR_A(i) _V2D::mat[i] -= sm.mat[i]; }
/**
* @brief Multiplication assignment with value "v"
* @brief Multiplication all elements of this matrix with value "v"
*
* @param v value for the multiplication assigment
*/
void operator*=(const Type &v) { PIMM_FOR_A(i) _V2D::mat[i] *= v; }
/**
* @brief Division assignment with value "v"
* @brief Division all elements of this matrix with value "v"
*
* @param v value for the division assigment
*/
@@ -1105,7 +1095,7 @@ public:
}
/**
* @brief Matrix addition
* @brief Addition all elements of this matrix with all elements of matrix "sm"
*
* @param sm is matrix term
* @return the result of matrix addition
@@ -1117,7 +1107,7 @@ public:
}
/**
* @brief Matrix subtraction
* @brief Substraction all elements of this matrix with all elements of matrix "sm"
*
* @param sm is matrix subtractor
* @return the result of matrix subtraction
@@ -1129,7 +1119,7 @@ public:
}
/**
* @brief Matrix multiplication
* @brief Multiplication all elements of this matrix with value "v"
*
* @param v is value factor
* @return the result of matrix multiplication
@@ -1141,7 +1131,7 @@ public:
}
/**
* @brief Matrix division
* @brief Division all elements of this matrix with value "v"
*
* @param v is value divider
* @return the result of matrix division
@@ -1328,7 +1318,7 @@ inline std::ostream & operator <<(std::ostream & s, const PIMathMatrix<Type> & m
#endif
/**
* @brief Inline operator for outputting the matrix to the console
* @brief Outputting the matrix to the console
*
* @param s PICout type
* @param the matrix type PIMathMatrix that we print to the console
@@ -1349,7 +1339,7 @@ inline PICout operator<<(PICout s, const PIMathMatrix<Type> &m) {
}
/**
* @brief Inline operator for serializing a matrix into a PIByteArray
* @brief Serializing a matrix into a PIByteArray
*
* @param s PIByteArray type
* @param v PIMathMatrix type
@@ -1362,7 +1352,7 @@ inline PIByteArray &operator<<(PIByteArray &s, const PIMathMatrix<Type> &v) {
}
/**
* @brief Inline operator to deserialize matrix from PIByteArray
* @brief Deserializing matrix from PIByteArray
*
* @param s PIByteArray type
* @param v PIMathMatrix type