|
OpenMD 3.2
Molecular Dynamics in the Open
|
rectangular matrix class More...
#include "math/RectMatrix.hpp"
Public Types | |
| using | ElemType = Real |
| using | ElemPoinerType = Real* |
Public Member Functions | |
| RectMatrix () | |
| default constructor | |
| RectMatrix (Real s) | |
| Constructs and initializes every element of this matrix to a scalar. | |
| RectMatrix (Real *array) | |
| RectMatrix (const RectMatrix< Real, Row, Col > &m) | |
| copy constructor | |
| ~RectMatrix () | |
| destructor | |
| RectMatrix< Real, Row, Col > & | operator= (const RectMatrix< Real, Row, Col > &m) |
| copy assignment operator | |
| Real & | operator() (unsigned int i, unsigned int j) |
| Return the reference of a single element of this matrix. | |
| Real | operator() (unsigned int i, unsigned int j) const |
| Return the value of a single element of this matrix. | |
| void | getArray (Real *array) |
| Copy the internal data to an array. | |
| Real * | getArrayPointer () |
| Returns the pointer of internal array. | |
| Vector< Real, Row > | getRow (unsigned int row) |
| Returns a row of this matrix as a vector. | |
| void | setRow (unsigned int row, const Vector< Real, Row > &v) |
| Sets a row of this matrix. | |
| Vector< Real, Col > | getColumn (unsigned int col) |
| Returns a column of this matrix as a vector. | |
| void | setColumn (unsigned int col, const Vector< Real, Col > &v) |
| Sets a column of this matrix. | |
| void | swapRow (unsigned int i, unsigned int j) |
| swap two rows of this matrix | |
| void | swapColumn (unsigned int i, unsigned int j) |
| swap two Columns of this matrix | |
| bool | operator== (const RectMatrix< Real, Row, Col > &m) |
| Tests if this matrix is identical to matrix m. | |
| bool | operator!= (const RectMatrix< Real, Row, Col > &m) |
| Tests if this matrix is not equal to matrix m. | |
| void | negate () |
| Negates the value of this matrix in place. | |
| void | negate (const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the negation of matrix m. | |
| void | add (const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the sum of itself and m (*this += m). | |
| void | add (const RectMatrix< Real, Row, Col > &m1, const RectMatrix< Real, Row, Col > &m2) |
| Sets the value of this matrix to the sum of m1 and m2 (*this = m1 + m2). | |
| void | sub (const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the difference of itself and m (*this -= m). | |
| void | sub (const RectMatrix< Real, Row, Col > &m1, const RectMatrix< Real, Row, Col > &m2) |
| Sets the value of this matrix to the difference of matrix m1 and m2 (*this = m1 - m2). | |
| void | mul (Real s) |
| Sets the value of this matrix to the scalar multiplication of itself (*this *= s). | |
| void | mul (Real s, const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the scalar multiplication of matrix m (*this = s * m). | |
| void | div (Real s) |
| Sets the value of this matrix to the scalar division of itself (*this /= s ). | |
| void | div (Real s, const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the scalar division of matrix m (*this = m /s). | |
| RectMatrix< Real, Row, Col > & | operator*= (const Real s) |
| Multiples a scalar into every element of this matrix. | |
| RectMatrix< Real, Row, Col > & | operator/= (const Real s) |
| Divides every element of this matrix by a scalar. | |
| RectMatrix< Real, Row, Col > & | operator+= (const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the sum of the other matrix and itself (*this += m). | |
| RectMatrix< Real, Row, Col > & | operator-= (const RectMatrix< Real, Row, Col > &m) |
| Sets the value of this matrix to the differerence of itself and the other matrix (*this -= m). | |
| RectMatrix< Real, Col, Row > | transpose () const |
| Return the transpose of this matrix. | |
| template<class MatrixType> | |
| void | setSubMatrix (unsigned int beginRow, unsigned int beginCol, const MatrixType &m) |
| template<class MatrixType> | |
| void | getSubMatrix (unsigned int beginRow, unsigned int beginCol, MatrixType &m) |
| unsigned int | getNRow () const |
| unsigned int | getNCol () const |
| Real | frobeniusNorm () |
Protected Attributes | |
| Real | data_ [Row][Col] |
rectangular matrix class
Definition at line 69 of file RectMatrix.hpp.
| using OpenMD::RectMatrix< Real, Row, Col >::ElemPoinerType = Real* |
Definition at line 72 of file RectMatrix.hpp.
| using OpenMD::RectMatrix< Real, Row, Col >::ElemType = Real |
Definition at line 71 of file RectMatrix.hpp.
|
inline |
default constructor
Definition at line 75 of file RectMatrix.hpp.
Referenced by add(), add(), div(), mul(), negate(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), OpenMD::SquareMatrix< RealType, 6 >::operator=(), operator==(), RectMatrix(), OpenMD::SquareMatrix< RealType, 6 >::SquareMatrix(), OpenMD::SquareMatrix< RealType, 6 >::SquareMatrix(), OpenMD::SquareMatrix< RealType, 6 >::SquareMatrix(), sub(), sub(), and transpose().
|
inline |
Constructs and initializes every element of this matrix to a scalar.
Definition at line 82 of file RectMatrix.hpp.
|
inline |
Definition at line 88 of file RectMatrix.hpp.
|
inline |
|
inline |
destructor
Definition at line 98 of file RectMatrix.hpp.
|
inline |
Sets the value of this matrix to the sum of itself and m (*this += m).
| m | the other matrix |
Definition at line 265 of file RectMatrix.hpp.
References RectMatrix().
Referenced by OpenMD::operator+(), and operator+=().
|
inline |
Sets the value of this matrix to the sum of m1 and m2 (*this = m1 + m2).
| m1 | the first matrix |
| m2 | the second matrix |
Definition at line 276 of file RectMatrix.hpp.
References RectMatrix().
|
inline |
Sets the value of this matrix to the scalar division of itself (*this /= s ).
| s | the scalar value |
Definition at line 335 of file RectMatrix.hpp.
Referenced by OpenMD::operator/(), and operator/=().
|
inline |
Sets the value of this matrix to the scalar division of matrix m (*this = m /s).
| s | the scalar value |
| m | the matrix |
Definition at line 347 of file RectMatrix.hpp.
References RectMatrix().
|
inline |
Definition at line 429 of file RectMatrix.hpp.
|
inline |
Copy the internal data to an array.
| array | the pointer of destination array |
Definition at line 135 of file RectMatrix.hpp.
|
inline |
Returns the pointer of internal array.
Definition at line 144 of file RectMatrix.hpp.
Referenced by OpenMD::Thermo::getInertiaTensor(), OpenMD::Thermo::getPressureTensor(), OpenMD::Thermo::getPressureTensor(), and OpenMD::Thermo::getSystemQuadrupole().
|
inline |
Returns a column of this matrix as a vector.
| col | the column index |
Definition at line 175 of file RectMatrix.hpp.
Referenced by OpenMD::GhostBend::calcForce().
|
inline |
Definition at line 427 of file RectMatrix.hpp.
|
inline |
Definition at line 426 of file RectMatrix.hpp.
|
inline |
Returns a row of this matrix as a vector.
| row | the row index |
Definition at line 151 of file RectMatrix.hpp.
Referenced by OpenMD::SquareMatrix3< Real >::diagonalize().
|
inline |
Definition at line 416 of file RectMatrix.hpp.
|
inline |
Sets the value of this matrix to the scalar multiplication of itself (*this *= s).
| s | the scalar value |
Definition at line 312 of file RectMatrix.hpp.
Referenced by OpenMD::operator*(), OpenMD::operator*(), and operator*=().
|
inline |
Sets the value of this matrix to the scalar multiplication of matrix m (*this = s * m).
| s | the scalar value |
| m | the matrix |
Definition at line 324 of file RectMatrix.hpp.
References RectMatrix().
|
inline |
Negates the value of this matrix in place.
Definition at line 245 of file RectMatrix.hpp.
Referenced by OpenMD::operator-().
|
inline |
Sets the value of this matrix to the negation of matrix m.
| m | the source matrix |
Definition at line 255 of file RectMatrix.hpp.
References RectMatrix().
|
inline |
Tests if this matrix is not equal to matrix m.
| m | matrix to be compared |
Definition at line 240 of file RectMatrix.hpp.
References RectMatrix().
|
inline |
Return the reference of a single element of this matrix.
| i | row index |
| j | Column index |
Definition at line 116 of file RectMatrix.hpp.
|
inline |
Return the value of a single element of this matrix.
| i | row index |
| j | Column index |
Definition at line 127 of file RectMatrix.hpp.
|
inline |
Multiples a scalar into every element of this matrix.
| s | the scalar value |
Definition at line 357 of file RectMatrix.hpp.
References mul(), and RectMatrix().
|
inline |
Sets the value of this matrix to the sum of the other matrix and itself (*this += m).
| m | the other matrix |
Definition at line 376 of file RectMatrix.hpp.
References add(), and RectMatrix().
|
inline |
Sets the value of this matrix to the differerence of itself and the other matrix (*this -= m).
| m | the other matrix |
Definition at line 387 of file RectMatrix.hpp.
References RectMatrix(), and sub().
|
inline |
Divides every element of this matrix by a scalar.
| s | the scalar value |
Definition at line 366 of file RectMatrix.hpp.
References div(), and RectMatrix().
|
inline |
copy assignment operator
Definition at line 101 of file RectMatrix.hpp.
References RectMatrix().
Referenced by OpenMD::SquareMatrix3< RealType >::operator=(), and OpenMD::SquareMatrix< RealType, 6 >::operator=().
|
inline |
Tests if this matrix is identical to matrix m.
| m | matrix to be compared |
Definition at line 226 of file RectMatrix.hpp.
References OpenMD::equal(), and RectMatrix().
|
inline |
Sets a column of this matrix.
| col | the column index |
| v | the vector to be set |
Definition at line 189 of file RectMatrix.hpp.
|
inline |
Sets a row of this matrix.
| row | the row index |
| v | the vector to be set |
Definition at line 165 of file RectMatrix.hpp.
Referenced by OpenMD::SquareMatrix3< Real >::diagonalize().
|
inline |
Definition at line 405 of file RectMatrix.hpp.
|
inline |
Sets the value of this matrix to the difference of itself and m (*this -= m).
| m | the other matrix |
Definition at line 288 of file RectMatrix.hpp.
References RectMatrix().
Referenced by OpenMD::operator-(), and operator-=().
|
inline |
Sets the value of this matrix to the difference of matrix m1 and m2 (*this = m1 - m2).
| m1 | the first matrix |
| m2 | the second matrix |
Definition at line 300 of file RectMatrix.hpp.
References RectMatrix().
|
inline |
swap two Columns of this matrix
| i | the first Column |
| j | the second Column |
Definition at line 211 of file RectMatrix.hpp.
|
inline |
swap two rows of this matrix
| i | the first row |
| j | the second row |
Definition at line 199 of file RectMatrix.hpp.
Referenced by OpenMD::SquareMatrix3< Real >::diagonalize().
|
inline |
Return the transpose of this matrix.
Definition at line 394 of file RectMatrix.hpp.
References RectMatrix().
|
protected |
Definition at line 440 of file RectMatrix.hpp.