    

 ## On this page

  

 

 # Matrix Class Reference

 Last update: 16.07.2025 

Standard matrix class. [More...](class_matrix.xhtml#details)

## <a name="pub-types"></a>Public Types

<a id="a973c5b26a9107f3517a08587cff16bd2"></a>typedef Eigen::Matrix&lt; [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f), Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor &gt; [Base](class_matrix.xhtml#a973c5b26a9107f3517a08587cff16bd2) the type of the ancestor class   
 <a id="a3541a03e0ef75e0b541a5969c9c998a2"></a>typedef [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) \* [TBuffer](class_matrix.xhtml#a3541a03e0ef75e0b541a5969c9c998a2) the data type of the dynamic data buffer (pointer)   
 <a id="a353dbc81e718cd4640b7c719b512892f"></a>typedef Base::Index [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) index type for Eigen matrices   
 <a id="ad33f729eda6e45412aac71cee702012f"></a>typedef number [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) the floating point number type of a mtrix element   
 <a id="ab423d248b103558b5903c702c13335ae"></a>typedef number [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) an unsigned index type   
 ## <a name="pub-methods"></a>Public Member Functions

<a id="a409c220b0818155c19d4c4db187e38ae"></a>string **\_\_getstate\_\_** () [Matrix](class_matrix.xhtml) [\_\_neg\_\_](class_matrix.xhtml#a2c73883479858e4c1c7b5f10120d384d) () const <a id="a93055c15dec0379a5aa9246794ecc970"></a> **\_\_setstate\_internal** (string state) char \* [\_\_str\_\_](class_matrix.xhtml#adb0255d0035cd7783ce87f41a3cae5cc) () transforms this objects into a string, required by SWIG [More...](#adb0255d0035cd7783ce87f41a3cae5cc)  
  [Add](class_matrix.xhtml#aae390486e349048d81ac273eb7aa9670) ([Matrix](class_matrix.xhtml) other) modifies this matrix by the matrix sum A+B [More...](#aae390486e349048d81ac273eb7aa9670)  
  [Add](class_matrix.xhtml#a25e0ea5c8f9b3101114cbb16faf410f5) ([MatrixBlock](class_matrix_block.xhtml) other) modifies this matrix by the matrix sum A+B [More...](#a25e0ea5c8f9b3101114cbb16faf410f5)  
 <a id="af4912b06072bc88055919100dd4df444"></a>[Matrix](class_matrix.xhtml) [AddCol](class_matrix.xhtml#af4912b06072bc88055919100dd4df444) ([Matrix](class_matrix.xhtml) m) returns an object including new data data   
 <a id="a316e7446fe396ef7395fdd7eb9470858"></a>[Matrix](class_matrix.xhtml) **AddRow** ([Matrix](class_matrix.xhtml) m) [Matrix](class_matrix.xhtml) [AppendCols](class_matrix.xhtml#a8d45e6e20e2284a40d69bf343b0b0359) ([Matrix](class_matrix.xhtml) m) returns an object with modified data [More...](#a8d45e6e20e2284a40d69bf343b0b0359)  
 [Matrix](class_matrix.xhtml) [AppendRows](class_matrix.xhtml#ab43482ffc988b4e4fee38e3f4d7bfe50) ([Matrix](class_matrix.xhtml) m) returns an object with modified data [More...](#ab43482ffc988b4e4fee38e3f4d7bfe50)  
  [Assign](class_matrix.xhtml#a087ab2e312c3f5ce4e20173db757fdf8) ([Matrix](class_matrix.xhtml) ar) The assignment operator for matrices (data only) [More...](#a087ab2e312c3f5ce4e20173db757fdf8)  
  [Assign](class_matrix.xhtml#a6d654d1ab1ea88faee2c64103aec6703) ([MatrixBlock](class_matrix_block.xhtml) ar) The assignment operator for blocks (data only) [More...](#a6d654d1ab1ea88faee2c64103aec6703)  
 [MatrixBlock](class_matrix_block.xhtml) [Block](class_matrix.xhtml#a8879d4398a0c2f56fe0fcfd5daa2e2a1) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) numrows, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) numcols) returns a reference to a block starting at 'row','column' with size 'numrows'\*'numcols' [More...](#a8879d4398a0c2f56fe0fcfd5daa2e2a1)  
 [MatrixBlock](class_matrix_block.xhtml) [Col](class_matrix.xhtml#a08daeaee307e7a167c01319997a0fdd0) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col) returns a reference to the 'col'th column [More...](#a08daeaee307e7a167c01319997a0fdd0)  
 [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) [Cols](class_matrix.xhtml#aeca933e9807a041c96c0ff00dce7fe81) () const [MatrixBlock](class_matrix_block.xhtml) [Cols](class_matrix.xhtml#a68d169caa3b3dbc2d105237205de4816) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col1, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) ncol) returns a block containing the ncol columns starting at column index col1 [More...](#a68d169caa3b3dbc2d105237205de4816)  
 void [ConservativeResize](class_matrix.xhtml#ab8c24eb13027a50ecf2ab7406af4cc6b) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) rows, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) cols=1) resizes the matrix to its new dimensions without destroying the contents. [More...](#ab8c24eb13027a50ecf2ab7406af4cc6b)  
 [MatrixCWise](class_matrix_c_wise.xhtml) [CW](class_matrix.xhtml#ae1c2d29afd675d763db255b6fd3362f7) ()  [Div](class_matrix.xhtml#a2e4ffbe13f1929444cbb608d5b941fb7) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) other) modifies this matrix by the scalar matrix quotient A/s [More...](#a2e4ffbe13f1929444cbb608d5b941fb7)  
 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [Dot](class_matrix.xhtml#abfed915b7780c75668a49b9c9029e8be) ([Matrix](class_matrix.xhtml) other) returns the scalar product of two vectors (a'b) [More...](#abfed915b7780c75668a49b9c9029e8be)  
 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [Dot](class_matrix.xhtml#aab4bd2af115bd460e3cf5a789dc5108d) ([MatrixBlock](class_matrix_block.xhtml) other) returns the scalar product of two vectors (a'b) [More...](#aab4bd2af115bd460e3cf5a789dc5108d)  
 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [Dott](class_matrix.xhtml#aae92c980182f755faafdac5613004c20) ([Matrix](class_matrix.xhtml) other) returns the weighted scalar product of this matrix and the given vector multiplied once from left and once from right (b'Ab) [More...](#aae92c980182f755faafdac5613004c20)  
 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [Dott](class_matrix.xhtml#a67c5a1cc69b21c0cad7c3765e093840f) ([MatrixBlock](class_matrix_block.xhtml) other) returns the weighted scalar product of this matrix and the given vector multiplied once from left and once from right (b'Ab) [More...](#a67c5a1cc69b21c0cad7c3765e093840f)  
 <a id="a8e9b9a6341a21706e7ab7fa74d85fb6b"></a>[Matrix](class_matrix.xhtml) [GetCols](class_matrix.xhtml#a8e9b9a6341a21706e7ab7fa74d85fb6b) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col1, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) ncol=1) returns an object providing copy of data   
 <a id="a2e2f6212a71005206146c73eff303623"></a>[Matrix](class_matrix.xhtml) **GetCols** ([Matrix](class_matrix.xhtml) indices) <a id="aa759de5ec4f041efcd591f813c386ad9"></a>[Matrix](class_matrix.xhtml) **GetColsThread** ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) ncols) <a id="acd3fbaa37c0588fd4903b38447b089b9"></a>[Matrix](class_matrix.xhtml) **GetRows** ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row1, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) nrow=1) <a id="ac0edad89b0b68029ed1832f062589d1d"></a>[Matrix](class_matrix.xhtml) **GetRows** ([Matrix](class_matrix.xhtml) indices) <a id="ab7489eccfc7609116ff5f3986b3d7b3c"></a>[Matrix](class_matrix.xhtml) **GetRowsThread** ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) nrows) [Matrix](class_matrix.xhtml) [InnerProduct](class_matrix.xhtml#ac9ff4aabff3596abf5955bae04b910ac) ([Matrix](class_matrix.xhtml) other) returns the inner product of two matrices/vectors (a'\*b) [More...](#ac9ff4aabff3596abf5955bae04b910ac)  
 [Matrix](class_matrix.xhtml) [InnerProduct](class_matrix.xhtml#ae3959900c4fac029b062c2becab74189) ([MatrixBlock](class_matrix_block.xhtml) other) returns the inner product of two matrices/vectors (a'\*b) [More...](#ae3959900c4fac029b062c2becab74189)  
 bool [IsApprox](class_matrix.xhtml#a5e294708c28b3276177033f775b07959) ([Matrix](class_matrix.xhtml) other, [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) const returns true if other and this are approx. identical [More...](#a5e294708c28b3276177033f775b07959)  
 bool [IsApproxToConstant](class_matrix.xhtml#ac6b5ff21f6e6dace60d84b61dca1be06) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) value, [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is constant and approx. equal s [More...](#ac6b5ff21f6e6dace60d84b61dca1be06)  
 bool [IsDiagonal](class_matrix.xhtml#a01f5dd6f597e652c42bd3015ad507191) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is a diagonal matrix by precision s [More...](#a01f5dd6f597e652c42bd3015ad507191)  
 bool [IsIdentity](class_matrix.xhtml#aac69c6571245195e236f0c642c4a4a97) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is the identity matrix by precision s [More...](#aac69c6571245195e236f0c642c4a4a97)  
 bool [IsLowerTriangular](class_matrix.xhtml#a52353850b8d700400f021350033e1d1f) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is a lower triangular matrix by precision s [More...](#a52353850b8d700400f021350033e1d1f)  
 bool [IsScalar](class_matrix.xhtml#a087c6c345ee2a195620c445edce6ac3e) () bool [IsUnitary](class_matrix.xhtml#a532f94f1b94ee8d7c37b5778e665e171) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is a unitary matrix by precision s (is an orthonormal basis) [More...](#a532f94f1b94ee8d7c37b5778e665e171)  
 bool [IsUpperTriangular](class_matrix.xhtml#aaa1b06c2e42742d84cf52d0339718d74) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is an upper triangular matrix by precision s [More...](#aaa1b06c2e42742d84cf52d0339718d74)  
 bool [IsVector](class_matrix.xhtml#a4bf46091a7288ba42f1df85840d905a7) () bool [IsZero](class_matrix.xhtml#aaf6af85eb9b71f6e502c05cef31a4add) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) s)  [Matrix](class_matrix.xhtml#a3aede62f513da27e6f61ae7a972b4f96) () destructor [More...](#a3aede62f513da27e6f61ae7a972b4f96)  
  [Matrix](class_matrix.xhtml#ae5224f99e6ff6e4fb950942127f7e6a7) ([Matrix](class_matrix.xhtml) ar) copy constructor [More...](#ae5224f99e6ff6e4fb950942127f7e6a7)  
  [Matrix](class_matrix.xhtml#a02871da8f44599d14514aa0151bf069e) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) nrow, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) ncol=1) constructs a matrix and allocates nrow\*ncol elements [More...](#a02871da8f44599d14514aa0151bf069e)  
  [Matrix](class_matrix.xhtml#af6fdd420eadda66bc8985006bc2bf33f) ([MatrixBlock](class_matrix_block.xhtml) x) constructs a matrix from a matrix block [More...](#af6fdd420eadda66bc8985006bc2bf33f)  
  [Matrix](class_matrix.xhtml#a0cca63ba6c0409c3ead928e2344df131) (sparse::SparseMatrix x) copies from a sparse matrix [More...](#a0cca63ba6c0409c3ead928e2344df131)  
  [Matrix](class_matrix.xhtml#ab0ed2c94ee6d96d9f03d8e56b3e41730) (sparse::SymSparseMatrix x) copies from a symmetric sparse matrix [More...](#ab0ed2c94ee6d96d9f03d8e56b3e41730)  
 <a id="a02269c910dc4d6e7962201306589c136"></a>[TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) **MaxCoeff** ([TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*OUTPUT, [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*OUTPUT) const [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [MinCoeff](class_matrix.xhtml#a2f341a74fe43447f9cd684a645ea55b1) ([TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*OUTPUT, [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*OUTPUT) const find the smallest element in the array returns the minimum element in the array [More...](#a2f341a74fe43447f9cd684a645ea55b1)  
  [Mul](class_matrix.xhtml#a67ad9262c1ebdd144f96accf0222b777) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) other) modifies this matrix by the scalar matrix product A\*s [More...](#a67ad9262c1ebdd144f96accf0222b777)  
 [Matrix](class_matrix.xhtml) [operator\*](class_matrix.xhtml#a29e90840f4d196f9fd74cf8f59b94cb9) ([Matrix](class_matrix.xhtml) other) const returns the matrix product A\*B [More...](#a29e90840f4d196f9fd74cf8f59b94cb9)  
 [Matrix](class_matrix.xhtml) [operator\*](class_matrix.xhtml#a53936030c84cd000ecbf81d5fa6fb005) ([MatrixBlock](class_matrix_block.xhtml) other) const returns the matrix product A\*B [More...](#a53936030c84cd000ecbf81d5fa6fb005)  
 [Matrix](class_matrix.xhtml) [operator\*](class_matrix.xhtml#ab37a095452e105c76034aca0303000d9) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) other) const returns the scalar matrix product A\*s [More...](#ab37a095452e105c76034aca0303000d9)  
 [Matrix](class_matrix.xhtml) [operator+](class_matrix.xhtml#aab49eb12364bb2a0a4341e884029dfea) ([Matrix](class_matrix.xhtml) other) const returns the matrix sum A+B [More...](#aab49eb12364bb2a0a4341e884029dfea)  
 [Matrix](class_matrix.xhtml) [operator+](class_matrix.xhtml#ae0cebd5d95ee9c112d3e835b1eb2f184) ([MatrixBlock](class_matrix_block.xhtml) other) const returns the matrix sum A+B [More...](#ae0cebd5d95ee9c112d3e835b1eb2f184)  
 [Matrix](class_matrix.xhtml) [operator-](class_matrix.xhtml#a2277ad125549453bb0e2e986287ead45) ([Matrix](class_matrix.xhtml) other) const returns the matrix difference A-B [More...](#a2277ad125549453bb0e2e986287ead45)  
 [Matrix](class_matrix.xhtml) [operator-](class_matrix.xhtml#adb471a658b8d9f65134fb3ef7163d8c5) ([MatrixBlock](class_matrix_block.xhtml) other) const returns the matrix difference A-B [More...](#adb471a658b8d9f65134fb3ef7163d8c5)  
 [Matrix](class_matrix.xhtml) [operator/](class_matrix.xhtml#a380ed928adb0f77541239d3ed8a56f43) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) other) const returns the scalar matrix quotient A/s [More...](#a380ed928adb0f77541239d3ed8a56f43)  
 [Matrix](class_matrix.xhtml) [operator&lt;](class_matrix.xhtml#a872a8318f4c9b443d9268a2ac27ece7a) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) x) const returns a matrix of 1 and 0 indicating which element is less than x [More...](#a872a8318f4c9b443d9268a2ac27ece7a)  
 [Matrix](class_matrix.xhtml) [operator=](class_matrix.xhtml#af745b2c8e2616be12145fc40d890125a) ([Matrix](class_matrix.xhtml) ar) copy assignment operator [More...](#af745b2c8e2616be12145fc40d890125a)  
 [Matrix](class_matrix.xhtml) [OuterProduct](class_matrix.xhtml#ac64b04d3ca8a4e032beeb4f5eeffeb02) ([Matrix](class_matrix.xhtml) other) returns the outer product of two matrices/vectors (a\*b') [More...](#ac64b04d3ca8a4e032beeb4f5eeffeb02)  
 [Matrix](class_matrix.xhtml) [OuterProduct](class_matrix.xhtml#ad12dccec7451d37c6d3a5d5dcac42c65) ([MatrixBlock](class_matrix_block.xhtml) other) returns the outer product of two matrices/vectors (a\*b') [More...](#ad12dccec7451d37c6d3a5d5dcac42c65)  
  [Print](class_matrix.xhtml#a6a84471f08e9842cce4e162251b007fd) (string format="%g ", TUnsignedIndex rows=20, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) cols=20) const prints the matrix up to the given rows and columns [More...](#a6a84471f08e9842cce4e162251b007fd)  
 <a id="af7053eeaaf953b070ec4c3058f456cf3"></a>[Matrix](class_matrix.xhtml) [RemoveCol](class_matrix.xhtml#af7053eeaaf953b070ec4c3058f456cf3) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col) returns an object of corresponding smaller size   
 <a id="ae11bf64c4bf72314db394048d27c82ef"></a>[Matrix](class_matrix.xhtml) **RemoveRow** ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row) [MatrixBlock](class_matrix_block.xhtml) [Row](class_matrix.xhtml#a90b7fd2d31acbef1bf30eef064fd5348) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row) returns a reference to the 'row'th row [More...](#a90b7fd2d31acbef1bf30eef064fd5348)  
 [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) [Rows](class_matrix.xhtml#a9bc99715ea9c71ed92be5142140f505c) () const [MatrixBlock](class_matrix_block.xhtml) [Rows](class_matrix.xhtml#a60a48880d61ca9103ae8725dd71980d6) ([TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row1, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) nrow) returns a block containing the nrow columns starting at column index row1 [More...](#a60a48880d61ca9103ae8725dd71980d6)  
 void [SetCols](class_matrix.xhtml#aa01aeb9db4f7058ce09c4cbc03d4ed0e) ([Matrix](class_matrix.xhtml) m, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col) returns an object providing copy of data [More...](#aa01aeb9db4f7058ce09c4cbc03d4ed0e)  
 <a id="a47dbe58637a7ce3f27c018201e0d8c86"></a> **SetColsThread** ([Matrix](class_matrix.xhtml) m, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) col)  [SetConstant](class_matrix.xhtml#a7e9b8781289e118b3ea0fddfca5626d4) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) value) initializes the matrix with constant values [More...](#a7e9b8781289e118b3ea0fddfca5626d4)  
 <a id="a14985545f226fa39181250a3f2616d8f"></a>void [SetIdentity](class_matrix.xhtml#a14985545f226fa39181250a3f2616d8f) () initializes the matrix as identity matrix   
 void [SetLinearCols](class_matrix.xhtml#ad075cdbd31856a54e55560db2e051d3a) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [a](group__tmath.xhtml#ga7e205066f67b9e3fd4c8cbd5859e8da3), [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) b) initializes the matrix with linear columns [More...](#ad075cdbd31856a54e55560db2e051d3a)  
  [SetLinearRows](class_matrix.xhtml#af141c5f38b1ec802761d4554daca44e4) ([TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) [a](group__tmath.xhtml#ga7e205066f67b9e3fd4c8cbd5859e8da3), [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) b) initializes the matrix with linear rows [More...](#af141c5f38b1ec802761d4554daca44e4)  
 <a id="a3c651523d502a1e36640b61815c4e365"></a>void [SetOnes](class_matrix.xhtml#a3c651523d502a1e36640b61815c4e365) () initializes the matrix with constant values "1"   
 <a id="aec924a4e001d87c82eaa2caad4dc8a74"></a>void [SetRandom](class_matrix.xhtml#aec924a4e001d87c82eaa2caad4dc8a74) () initializes the matrix with random values   
 <a id="a297992c3debc4bcb956444e9b541ce5f"></a>void **SetRows** ([Matrix](class_matrix.xhtml) m, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row) <a id="a3f14e9f42ba1ee3585bdda826844d5b9"></a> **SetRowsThread** ([Matrix](class_matrix.xhtml) m, [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) row) <a id="ae57e5aca5db002545e4b9335c8d9dbfa"></a>void [SetZero](class_matrix.xhtml#ae57e5aca5db002545e4b9335c8d9dbfa) () initializes the matrix with zeros   
  [Sub](class_matrix.xhtml#a4fbbdfc36bec89e69078091d5e3fc724) ([Matrix](class_matrix.xhtml) other) modifies this matrix by the matrix difference A-B [More...](#a4fbbdfc36bec89e69078091d5e3fc724)  
  [Sub](class_matrix.xhtml#a8ff14282011c997c57439e80c5e2f624) ([MatrixBlock](class_matrix_block.xhtml) other) modifies this matrix by the matrix difference A-B [More...](#a8ff14282011c997c57439e80c5e2f624)  
  [Swap](class_matrix.xhtml#a8c07d898b8b4a9af07820bb9ff22ba6e) ([Matrix](class_matrix.xhtml) ar) The swap operator for matrices (data only) [More...](#a8c07d898b8b4a9af07820bb9ff22ba6e)  
 [Matrix](class_matrix.xhtml) [Transpose](class_matrix.xhtml#ada11290ae7810df3f90734047053700b) () const <a id="a4a19e2c82194b4c92c8a17f7b64469e9"></a>void [TransposeInPlace](class_matrix.xhtml#a4a19e2c82194b4c92c8a17f7b64469e9) () transposes this matrix   
 ## <a name="pub-attribs"></a>Public Attributes

apply [int](class_matrix.xhtml#a0824d20c454aab42f337b2a6c0a81dc2) { [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) } find the largest element in the array returns the maximum element in the array [More...](#a0824d20c454aab42f337b2a6c0a81dc2)  
 <a id="abd1212808e1ac01b27618f74766603b6"></a>apply [int](class_matrix.xhtml#a0824d20c454aab42f337b2a6c0a81dc2) \* **OUTPUT** { [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*OUTPUT } <a id="details" name="details"></a>## Detailed Description

Standard matrix class.

A class that represents storage for dense linalg objects.

The storage scheme is column\_major (FORTRAN). It is derived from Eigen::Matrix. Many operations have been added/overwritten for compatibility with scripting requirements. Most operations of Eigen2 are still available.

Basic Eigen linalg operators have been overloaded. To access a linalg operator from C++, for example the matrix product, type

[Matrix](class_matrix.xhtml "Standard matrix class. ") x,y,z;

...

z = x.Base::operator*(z)



 This will give you the fastest operation possible within the Eigen library. The overloaded operators have some if-clauses and do not make use of expression templates what may harm performance.

[Matrix](class_matrix.xhtml) offers a handling for complex numbers which differs from Eigen: The odd columns are the real parts and the odd columns contain the imaginary parts.

Some of the underlying Eigen methods are available for SWIG. They are not integrated into the error chacking system, though! neverthelesse, ften they are the most efficient methods. To distuingish between Eigen and own methods, the Eigen methods identifiers start with a noncapital first letter, our own methods start with a capital letter.

Operators for SWIG are provided using the methods **add**, etc., The SWIG-operators must be safeguarded, whereas the C++-operators should be the original Eigen2 operators. Therefore they must be defined separately on C++ level.

[Matrix](class_matrix.xhtml) is useing a reference counter system. It is advised not to use 'delete [Matrix()](class_matrix.xhtml#a3aede62f513da27e6f61ae7a972b4f96 "destructor ");' to remove it from memory, but to use removeReference.



## Constructor &amp; Destructor Documentation

<a id="a3aede62f513da27e6f61ae7a972b4f96"></a>## [◆ ](#a3aede62f513da27e6f61ae7a972b4f96)Matrix() \[1/6\]

 [Matrix](class_matrix.xhtml)  ( ) 

destructor

default constructor





<a id="ae5224f99e6ff6e4fb950942127f7e6a7"></a>## [◆ ](#ae5224f99e6ff6e4fb950942127f7e6a7)Matrix() \[2/6\]

 [Matrix](class_matrix.xhtml)  ( [Matrix](class_matrix.xhtml)  *ar*) 

copy constructor

Parameters arthe object to be copied 



<a id="a02871da8f44599d14514aa0151bf069e"></a>## [◆ ](#a02871da8f44599d14514aa0151bf069e)Matrix() \[3/6\]

 [Matrix](class_matrix.xhtml)  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *nrow*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *ncol* = `1`   ) 

constructs a matrix and allocates nrow\*ncol elements

Parameters nrowthe number of rows ncolthe number of columns 



<a id="af6fdd420eadda66bc8985006bc2bf33f"></a>## [◆ ](#af6fdd420eadda66bc8985006bc2bf33f)Matrix() \[4/6\]

 [Matrix](class_matrix.xhtml)  ( [MatrixBlock](class_matrix_block.xhtml)  *x*) 

constructs a matrix from a matrix block

Parameters xthe object to be copied from 



<a id="a0cca63ba6c0409c3ead928e2344df131"></a>## [◆ ](#a0cca63ba6c0409c3ead928e2344df131)Matrix() \[5/6\]

 [Matrix](class_matrix.xhtml)  ( sparse::SparseMatrix  *x*) 

copies from a sparse matrix

Parameters xthe object to be copied from 



<a id="ab0ed2c94ee6d96d9f03d8e56b3e41730"></a>## [◆ ](#ab0ed2c94ee6d96d9f03d8e56b3e41730)Matrix() \[6/6\]

 [Matrix](class_matrix.xhtml)  ( sparse::SymSparseMatrix  *x*) 

copies from a symmetric sparse matrix

Parameters xthe object to be copied from 



## Member Function Documentation

<a id="a2c73883479858e4c1c7b5f10120d384d"></a>## [◆ ](#a2c73883479858e4c1c7b5f10120d384d)\_\_neg\_\_()

 [Matrix](class_matrix.xhtml) \_\_neg\_\_  ( )  const

Returnsunary minus (B=-A) Used by SWIG. 



<a id="adb0255d0035cd7783ce87f41a3cae5cc"></a>## [◆ ](#adb0255d0035cd7783ce87f41a3cae5cc)\_\_str\_\_()

 char\* \_\_str\_\_  ( ) 

transforms this objects into a string, required by SWIG

Returnsa string 



<a id="aae390486e349048d81ac273eb7aa9670"></a>## [◆ ](#aae390486e349048d81ac273eb7aa9670)Add() \[1/2\]

 Add  ( [Matrix](class_matrix.xhtml)  *other*) 

modifies this matrix by the matrix sum A+B

Parameters otherthe matrix B 



<a id="a25e0ea5c8f9b3101114cbb16faf410f5"></a>## [◆ ](#a25e0ea5c8f9b3101114cbb16faf410f5)Add() \[2/2\]

 Add  ( [MatrixBlock](class_matrix_block.xhtml)  *other*) 

modifies this matrix by the matrix sum A+B

Parameters otherthe matrix B 



<a id="a8d45e6e20e2284a40d69bf343b0b0359"></a>## [◆ ](#a8d45e6e20e2284a40d69bf343b0b0359)AppendCols()

 [Matrix](class_matrix.xhtml) AppendCols  ( [Matrix](class_matrix.xhtml)  *m*) 

returns an object with modified data

Parameters mthe columns to be appended Returns[Matrix](class_matrix.xhtml "Standard matrix class. ") with columns appended 



<a id="ab43482ffc988b4e4fee38e3f4d7bfe50"></a>## [◆ ](#ab43482ffc988b4e4fee38e3f4d7bfe50)AppendRows()

 [Matrix](class_matrix.xhtml) AppendRows  ( [Matrix](class_matrix.xhtml)  *m*) 

returns an object with modified data

Parameters mthe rows to be appended Returns[Matrix](class_matrix.xhtml "Standard matrix class. ") with rows appended 



<a id="a087ab2e312c3f5ce4e20173db757fdf8"></a>## [◆ ](#a087ab2e312c3f5ce4e20173db757fdf8)Assign() \[1/2\]

 Assign  ( [Matrix](class_matrix.xhtml)  *ar*) 

The assignment operator for matrices (data only)

Parameters arthe source object 



<a id="a6d654d1ab1ea88faee2c64103aec6703"></a>## [◆ ](#a6d654d1ab1ea88faee2c64103aec6703)Assign() \[2/2\]

 Assign  ( [MatrixBlock](class_matrix_block.xhtml)  *ar*) 

The assignment operator for blocks (data only)

Parameters arthe source object 



<a id="a8879d4398a0c2f56fe0fcfd5daa2e2a1"></a>## [◆ ](#a8879d4398a0c2f56fe0fcfd5daa2e2a1)Block()

 [MatrixBlock](class_matrix_block.xhtml) Block  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *row*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *col*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *numrows*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *numcols*   ) 

returns a reference to a block starting at 'row','column' with size 'numrows'\*'numcols'

Parameters rowthe top left row index colthe top left column index numrowsthe number of rows of the matrix part numcolsthe number of columns of the matrix part Returnsa matrix block serving as a reference to the specified matrix part 



<a id="a08daeaee307e7a167c01319997a0fdd0"></a>## [◆ ](#a08daeaee307e7a167c01319997a0fdd0)Col()

 [MatrixBlock](class_matrix_block.xhtml) Col  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *col*) 

returns a reference to the 'col'th column

Parameters colthe requested column index Returnsa matrix block serving as a reference to the column 



<a id="aeca933e9807a041c96c0ff00dce7fe81"></a>## [◆ ](#aeca933e9807a041c96c0ff00dce7fe81)Cols() \[1/2\]

 [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) Cols  ( )  const

Returnsthe number of cols 



<a id="a68d169caa3b3dbc2d105237205de4816"></a>## [◆ ](#a68d169caa3b3dbc2d105237205de4816)Cols() \[2/2\]

 [MatrixBlock](class_matrix_block.xhtml) Cols  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *col1*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *ncol*   ) 

returns a block containing the ncol columns starting at column index col1

Parameters col1the left column index ncolthe number of columns of the matrix part Returnsa matrix block serving as a reference to the specified matrix part 



<a id="ab8c24eb13027a50ecf2ab7406af4cc6b"></a>## [◆ ](#ab8c24eb13027a50ecf2ab7406af4cc6b)ConservativeResize()

 void ConservativeResize  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *rows*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *cols* = `1`   ) 

resizes the matrix to its new dimensions without destroying the contents.

Parameters rowsthe number of rows after resize colsthe number of columns after resize Internally it creates a copy of the object (nothing if memory is crucial). 



<a id="ae1c2d29afd675d763db255b6fd3362f7"></a>## [◆ ](#ae1c2d29afd675d763db255b6fd3362f7)CW()

 [MatrixCWise](class_matrix_c_wise.xhtml) CW  ( ) 

Returnsan object providing cwise access 



<a id="a2e4ffbe13f1929444cbb608d5b941fb7"></a>## [◆ ](#a2e4ffbe13f1929444cbb608d5b941fb7)Div()

 Div  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *other*) 

modifies this matrix by the scalar matrix quotient A/s

Parameters otherthe scalar s 



<a id="abfed915b7780c75668a49b9c9029e8be"></a>## [◆ ](#abfed915b7780c75668a49b9c9029e8be)Dot() \[1/2\]

 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) Dot  ( [Matrix](class_matrix.xhtml)  *other*) 

returns the scalar product of two vectors (a'b)

Parameters otherthe vector b Returnsthe result of the operation 



<a id="aab4bd2af115bd460e3cf5a789dc5108d"></a>## [◆ ](#aab4bd2af115bd460e3cf5a789dc5108d)Dot() \[2/2\]

 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) Dot  ( [MatrixBlock](class_matrix_block.xhtml)  *other*) 

returns the scalar product of two vectors (a'b)

Parameters otherthe vector b Returnsthe result of the operation 



<a id="aae92c980182f755faafdac5613004c20"></a>## [◆ ](#aae92c980182f755faafdac5613004c20)Dott() \[1/2\]

 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) Dott  ( [Matrix](class_matrix.xhtml)  *other*) 

returns the weighted scalar product of this matrix and the given vector multiplied once from left and once from right (b'Ab)

Parameters otherthe vector b Returnsthe result of the operation 



<a id="a67c5a1cc69b21c0cad7c3765e093840f"></a>## [◆ ](#a67c5a1cc69b21c0cad7c3765e093840f)Dott() \[2/2\]

 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) Dott  ( [MatrixBlock](class_matrix_block.xhtml)  *other*) 

returns the weighted scalar product of this matrix and the given vector multiplied once from left and once from right (b'Ab)

Parameters otherthe vector b Returnsthe result of the operation 



<a id="ac9ff4aabff3596abf5955bae04b910ac"></a>## [◆ ](#ac9ff4aabff3596abf5955bae04b910ac)InnerProduct() \[1/2\]

 [Matrix](class_matrix.xhtml) InnerProduct  ( [Matrix](class_matrix.xhtml)  *other*) 

returns the inner product of two matrices/vectors (a'\*b)

Parameters otherthe vector/matrix b Returnsthe result of the operation 



<a id="ae3959900c4fac029b062c2becab74189"></a>## [◆ ](#ae3959900c4fac029b062c2becab74189)InnerProduct() \[2/2\]

 [Matrix](class_matrix.xhtml) InnerProduct  ( [MatrixBlock](class_matrix_block.xhtml)  *other*) 

returns the inner product of two matrices/vectors (a'\*b)

Parameters otherthe vector/matrix b Returnsthe result of the operation 



<a id="a5e294708c28b3276177033f775b07959"></a>## [◆ ](#a5e294708c28b3276177033f775b07959)IsApprox()

 bool IsApprox  ( [Matrix](class_matrix.xhtml)  *other*,    [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*   )  const

returns true if other and this are approx. identical

Parameters otherthe object to be compared sa tolerance for the equality test Returnsthe result of the operation 



<a id="ac6b5ff21f6e6dace60d84b61dca1be06"></a>## [◆ ](#ac6b5ff21f6e6dace60d84b61dca1be06)IsApproxToConstant()

 bool IsApproxToConstant  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *value*,    [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*   ) 

returns true if array is constant and approx. equal s

Parameters valuethe constant value to be compared with sa tolerance for the equality test Returnsthe result of the operation 



<a id="a01f5dd6f597e652c42bd3015ad507191"></a>## [◆ ](#a01f5dd6f597e652c42bd3015ad507191)IsDiagonal()

 bool IsDiagonal  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*) 

returns true if array is a diagonal matrix by precision s

Parameters sa tolerance for the test Returnsthe result of the operation 



<a id="aac69c6571245195e236f0c642c4a4a97"></a>## [◆ ](#aac69c6571245195e236f0c642c4a4a97)IsIdentity()

 bool IsIdentity  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*) 

returns true if array is the identity matrix by precision s

Parameters sa tolerance for the equality test Returnsthe result of the operation 



<a id="a52353850b8d700400f021350033e1d1f"></a>## [◆ ](#a52353850b8d700400f021350033e1d1f)IsLowerTriangular()

 bool IsLowerTriangular  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*) 

returns true if array is a lower triangular matrix by precision s

Parameters sa tolerance for the equality test Returnsthe result of the operation 



<a id="a087c6c345ee2a195620c445edce6ac3e"></a>## [◆ ](#a087c6c345ee2a195620c445edce6ac3e)IsScalar()

 bool IsScalar  ( ) 

Returnstrue if array is a scalar 



<a id="a532f94f1b94ee8d7c37b5778e665e171"></a>## [◆ ](#a532f94f1b94ee8d7c37b5778e665e171)IsUnitary()

 bool IsUnitary  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*) 

returns true if array is a unitary matrix by precision s (is an orthonormal basis)

Parameters sa tolerance for the equality test Returnsthe result of the operation 



<a id="aaa1b06c2e42742d84cf52d0339718d74"></a>## [◆ ](#aaa1b06c2e42742d84cf52d0339718d74)IsUpperTriangular()

 bool IsUpperTriangular  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*) 

returns true if array is an upper triangular matrix by precision s

Parameters sa tolerance for the equality test Returnsthe result of the operation 



<a id="a4bf46091a7288ba42f1df85840d905a7"></a>## [◆ ](#a4bf46091a7288ba42f1df85840d905a7)IsVector()

 bool IsVector  ( ) 

Returnstrue if array is a vector 



<a id="aaf6af85eb9b71f6e502c05cef31a4add"></a>## [◆ ](#aaf6af85eb9b71f6e502c05cef31a4add)IsZero()

 bool IsZero  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *s*) 

Returnstrue if array is a zero matrix by precision s Parameters sa tolerance for the equality test 



<a id="a2f341a74fe43447f9cd684a645ea55b1"></a>## [◆ ](#a2f341a74fe43447f9cd684a645ea55b1)MinCoeff()

 [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f) MinCoeff  ( [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*  *OUTPUT*,    [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) \*  *OUTPUT*   )  const

find the smallest element in the array returns the minimum element in the array

Parameters rowwill be modified and will contain the row position of the found value on return colwill be modified and will contain the column position of the found value on return Returnssmallest elment 



<a id="a67ad9262c1ebdd144f96accf0222b777"></a>## [◆ ](#a67ad9262c1ebdd144f96accf0222b777)Mul()

 Mul  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *other*) 

modifies this matrix by the scalar matrix product A\*s

Parameters otherthe scalar s 



<a id="a29e90840f4d196f9fd74cf8f59b94cb9"></a>## [◆ ](#a29e90840f4d196f9fd74cf8f59b94cb9)operator\*() \[1/3\]

 [Matrix](class_matrix.xhtml) operator\*  ( [Matrix](class_matrix.xhtml)  *other*)  const

returns the matrix product A\*B

Parameters otherthe matrix B Returnsthe result of the operation 



<a id="a53936030c84cd000ecbf81d5fa6fb005"></a>## [◆ ](#a53936030c84cd000ecbf81d5fa6fb005)operator\*() \[2/3\]

 [Matrix](class_matrix.xhtml) operator\*  ( [MatrixBlock](class_matrix_block.xhtml)  *other*)  const

returns the matrix product A\*B

Parameters otherthe matrix B Returnsthe result of the operation 



<a id="ab37a095452e105c76034aca0303000d9"></a>## [◆ ](#ab37a095452e105c76034aca0303000d9)operator\*() \[3/3\]

 [Matrix](class_matrix.xhtml) operator\*  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *other*)  const

returns the scalar matrix product A\*s

Parameters otherthe scalar s Returnsthe result of the operation 



<a id="aab49eb12364bb2a0a4341e884029dfea"></a>## [◆ ](#aab49eb12364bb2a0a4341e884029dfea)operator+() \[1/2\]

 [Matrix](class_matrix.xhtml) operator+  ( [Matrix](class_matrix.xhtml)  *other*)  const

returns the matrix sum A+B

Parameters otherthe matrix B Returnsthe result of the operation 



<a id="ae0cebd5d95ee9c112d3e835b1eb2f184"></a>## [◆ ](#ae0cebd5d95ee9c112d3e835b1eb2f184)operator+() \[2/2\]

 [Matrix](class_matrix.xhtml) operator+  ( [MatrixBlock](class_matrix_block.xhtml)  *other*)  const

returns the matrix sum A+B

Parameters otherthe matrix B Returnsthe result of the operation 



<a id="a2277ad125549453bb0e2e986287ead45"></a>## [◆ ](#a2277ad125549453bb0e2e986287ead45)operator-() \[1/2\]

 [Matrix](class_matrix.xhtml) operator-  ( [Matrix](class_matrix.xhtml)  *other*)  const

returns the matrix difference A-B

Parameters otherthe matrix B Returnsthe result of the operation 



<a id="adb471a658b8d9f65134fb3ef7163d8c5"></a>## [◆ ](#adb471a658b8d9f65134fb3ef7163d8c5)operator-() \[2/2\]

 [Matrix](class_matrix.xhtml) operator-  ( [MatrixBlock](class_matrix_block.xhtml)  *other*)  const

returns the matrix difference A-B

Parameters otherthe matrix B Returnsthe result of the operation 



<a id="a380ed928adb0f77541239d3ed8a56f43"></a>## [◆ ](#a380ed928adb0f77541239d3ed8a56f43)operator/()

 [Matrix](class_matrix.xhtml) operator/  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *other*)  const

returns the scalar matrix quotient A/s

Parameters otherthe scalar s Returnsthe result of the operation 



<a id="a872a8318f4c9b443d9268a2ac27ece7a"></a>## [◆ ](#a872a8318f4c9b443d9268a2ac27ece7a)operator&lt;()

 [Matrix](class_matrix.xhtml) operator&lt;  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *x*)  const

returns a matrix of 1 and 0 indicating which element is less than x

Parameters xthe scalar x Returnsthe result of the operation 



<a id="af745b2c8e2616be12145fc40d890125a"></a>## [◆ ](#af745b2c8e2616be12145fc40d890125a)operator=()

 [Matrix](class_matrix.xhtml) operator=  ( [Matrix](class_matrix.xhtml)  *ar*) 

copy assignment operator

Parameters arthe object to be copy-assigned 



<a id="ac64b04d3ca8a4e032beeb4f5eeffeb02"></a>## [◆ ](#ac64b04d3ca8a4e032beeb4f5eeffeb02)OuterProduct() \[1/2\]

 [Matrix](class_matrix.xhtml) OuterProduct  ( [Matrix](class_matrix.xhtml)  *other*) 

returns the outer product of two matrices/vectors (a\*b')

Parameters otherthe vector/matrix b Returnsthe result of the operation 



<a id="ad12dccec7451d37c6d3a5d5dcac42c65"></a>## [◆ ](#ad12dccec7451d37c6d3a5d5dcac42c65)OuterProduct() \[2/2\]

 [Matrix](class_matrix.xhtml) OuterProduct  ( [MatrixBlock](class_matrix_block.xhtml)  *other*) 

returns the outer product of two matrices/vectors (a\*b')

Parameters otherthe vector/matrix b Returnsthe result of the operation 



<a id="a6a84471f08e9842cce4e162251b007fd"></a>## [◆ ](#a6a84471f08e9842cce4e162251b007fd)Print()

 Print  ( string  *format* = `"%g "`,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *rows* = `20`,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *cols* = `20`   )  const

prints the matrix up to the given rows and columns

Parameters formatthe format according to printf() rowsthe maximum number of rows to be printed colsthe maximum number of columns to be printed 



<a id="a90b7fd2d31acbef1bf30eef064fd5348"></a>## [◆ ](#a90b7fd2d31acbef1bf30eef064fd5348)Row()

 [MatrixBlock](class_matrix_block.xhtml) Row  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *row*) 

returns a reference to the 'row'th row

Parameters rowthe requested row index Returnsa matrix block serving as a reference to the row 



<a id="a9bc99715ea9c71ed92be5142140f505c"></a>## [◆ ](#a9bc99715ea9c71ed92be5142140f505c)Rows() \[1/2\]

 [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae) Rows  ( )  const

Returnsthe number of rows 



<a id="a60a48880d61ca9103ae8725dd71980d6"></a>## [◆ ](#a60a48880d61ca9103ae8725dd71980d6)Rows() \[2/2\]

 [MatrixBlock](class_matrix_block.xhtml) Rows  ( [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *row1*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *nrow*   ) 

returns a block containing the nrow columns starting at column index row1

Parameters row1the right row index nrowthe number of rows of the matrix part Returnsa matrix block serving as a reference to the specified matrix part 



<a id="aa01aeb9db4f7058ce09c4cbc03d4ed0e"></a>## [◆ ](#aa01aeb9db4f7058ce09c4cbc03d4ed0e)SetCols()

 void SetCols  ( [Matrix](class_matrix.xhtml)  *m*,    [TUnsignedIndex](class_matrix.xhtml#ab423d248b103558b5903c702c13335ae)  *col*   ) 

returns an object providing copy of data

changes object data in place





<a id="a7e9b8781289e118b3ea0fddfca5626d4"></a>## [◆ ](#a7e9b8781289e118b3ea0fddfca5626d4)SetConstant()

 SetConstant  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *value*) 

initializes the matrix with constant values

Parameters valuethe scalar value of the matrix 



<a id="ad075cdbd31856a54e55560db2e051d3a"></a>## [◆ ](#ad075cdbd31856a54e55560db2e051d3a)SetLinearCols()

 void SetLinearCols  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *a*,    [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *b*   ) 

initializes the matrix with linear columns

Parameters athe value of the first row bthe value of the last row 



<a id="af141c5f38b1ec802761d4554daca44e4"></a>## [◆ ](#af141c5f38b1ec802761d4554daca44e4)SetLinearRows()

 SetLinearRows  ( [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *a*,    [TScalar](class_matrix.xhtml#ad33f729eda6e45412aac71cee702012f)  *b*   ) 

initializes the matrix with linear rows

Parameters athe value of the first column bthe value of the last column 



<a id="a4fbbdfc36bec89e69078091d5e3fc724"></a>## [◆ ](#a4fbbdfc36bec89e69078091d5e3fc724)Sub() \[1/2\]

 Sub  ( [Matrix](class_matrix.xhtml)  *other*) 

modifies this matrix by the matrix difference A-B

Parameters otherthe matrix B 



<a id="a8ff14282011c997c57439e80c5e2f624"></a>## [◆ ](#a8ff14282011c997c57439e80c5e2f624)Sub() \[2/2\]

 Sub  ( [MatrixBlock](class_matrix_block.xhtml)  *other*) 

modifies this matrix by the matrix difference A-B

Parameters otherthe matrix B 



<a id="a8c07d898b8b4a9af07820bb9ff22ba6e"></a>## [◆ ](#a8c07d898b8b4a9af07820bb9ff22ba6e)Swap()

 Swap  ( [Matrix](class_matrix.xhtml)  *ar*) 

The swap operator for matrices (data only)

Parameters arthe other object. On output \*this will contain the input value of ar while ar contains the input value of \*this. 



<a id="ada11290ae7810df3f90734047053700b"></a>## [◆ ](#ada11290ae7810df3f90734047053700b)Transpose()

 [Matrix](class_matrix.xhtml) Transpose  ( )  const

Returnsthe transpose 



## Member Data Documentation

<a id="a0824d20c454aab42f337b2a6c0a81dc2"></a>## [◆ ](#a0824d20c454aab42f337b2a6c0a81dc2)int

 apply int { [TEigenIndex](class_matrix.xhtml#a353dbc81e718cd4640b7c719b512892f) }

find the largest element in the array returns the maximum element in the array

Parameters rowwill be modified and will contain the row position of the found value on return colwill be modified and will contain the column position of the found value on return Returnslargest elment