    

 ## On this page

  

 

 # MatrixBlock Class Reference

 Last update: 16.07.2025 

A generic view onto parts of a [Matrix](class_matrix.xhtml "Standard matrix class. "). [More...](class_matrix_block.xhtml#details)

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

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

[Matrix](class_matrix.xhtml) [\_\_neg\_\_](class_matrix_block.xhtml#a2c73883479858e4c1c7b5f10120d384d) () const char \* [\_\_str\_\_](class_matrix_block.xhtml#adb0255d0035cd7783ce87f41a3cae5cc) () transforms this objects into a string, required by SWIG [More...](#adb0255d0035cd7783ce87f41a3cae5cc)  
  [Add](class_matrix_block.xhtml#aae390486e349048d81ac273eb7aa9670) ([Matrix](class_matrix.xhtml) other) modifies this matrix by the matrix sum A+B [More...](#aae390486e349048d81ac273eb7aa9670)  
  [Add](class_matrix_block.xhtml#a25e0ea5c8f9b3101114cbb16faf410f5) ([MatrixBlock](class_matrix_block.xhtml) other) modifies this matrix by the matrix sum A+B [More...](#a25e0ea5c8f9b3101114cbb16faf410f5)  
 <a id="a087ab2e312c3f5ce4e20173db757fdf8"></a> **Assign** ([Matrix](class_matrix.xhtml) ar)  [Assign](class_matrix_block.xhtml#a6d654d1ab1ea88faee2c64103aec6703) ([MatrixBlock](class_matrix_block.xhtml) ar) The assignment operator (copy by value) [More...](#a6d654d1ab1ea88faee2c64103aec6703)  
 [MatrixBlock](class_matrix_block.xhtml) [Block](class_matrix_block.xhtml#a8879d4398a0c2f56fe0fcfd5daa2e2a1) ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) row, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) col, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) numrows, [TUnsignedIndex](class_matrix_block.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_block.xhtml#a08daeaee307e7a167c01319997a0fdd0) ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) col) returns a reference to the 'col'th column [More...](#a08daeaee307e7a167c01319997a0fdd0)  
 [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) [Cols](class_matrix_block.xhtml#aeca933e9807a041c96c0ff00dce7fe81) () const [MatrixBlock](class_matrix_block.xhtml) [Cols](class_matrix_block.xhtml#a68d169caa3b3dbc2d105237205de4816) ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) col1, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) ncol) returns a block containing the ncol columns starting at column index col1 [More...](#a68d169caa3b3dbc2d105237205de4816)  
  [Div](class_matrix_block.xhtml#a2e4ffbe13f1929444cbb608d5b941fb7) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) other) modifies this matrix by the scalar matrix quotient A/s [More...](#a2e4ffbe13f1929444cbb608d5b941fb7)  
 <a id="a8e9b9a6341a21706e7ab7fa74d85fb6b"></a>[Matrix](class_matrix.xhtml) [GetCols](class_matrix_block.xhtml#a8e9b9a6341a21706e7ab7fa74d85fb6b) ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) col1, [TUnsignedIndex](class_matrix_block.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="acd3fbaa37c0588fd4903b38447b089b9"></a>[Matrix](class_matrix.xhtml) **GetRows** ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) row1, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) nrow=1) <a id="ac0edad89b0b68029ed1832f062589d1d"></a>[Matrix](class_matrix.xhtml) **GetRows** ([Matrix](class_matrix.xhtml) indices) bool [IsApprox](class_matrix_block.xhtml#ad01c21bf740a1759cb91c0bde523d03b) ([Matrix](class_matrix.xhtml) other, [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if other and this are approx. identical [More...](#ad01c21bf740a1759cb91c0bde523d03b)  
 bool [IsApprox](class_matrix_block.xhtml#a11db06291893eecf8aaa28e6247f594a) ([MatrixBlock](class_matrix_block.xhtml) other, [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) const returns true if other and this are approx. identical [More...](#a11db06291893eecf8aaa28e6247f594a)  
 bool [IsApproxToConstant](class_matrix_block.xhtml#ac6b5ff21f6e6dace60d84b61dca1be06) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) value, [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is constant and approx. equal s [More...](#ac6b5ff21f6e6dace60d84b61dca1be06)  
 bool [IsDiagonal](class_matrix_block.xhtml#a01f5dd6f597e652c42bd3015ad507191) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is a diagonal matrix by precision s [More...](#a01f5dd6f597e652c42bd3015ad507191)  
 bool [IsIdentity](class_matrix_block.xhtml#aac69c6571245195e236f0c642c4a4a97) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is the identity matrix by precision s [More...](#aac69c6571245195e236f0c642c4a4a97)  
 bool [IsLowerTriangular](class_matrix_block.xhtml#a52353850b8d700400f021350033e1d1f) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is a lower triangular matrix by precision s [More...](#a52353850b8d700400f021350033e1d1f)  
 bool [IsScalar](class_matrix_block.xhtml#a087c6c345ee2a195620c445edce6ac3e) () bool [IsUnitary](class_matrix_block.xhtml#a532f94f1b94ee8d7c37b5778e665e171) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is a unitary matrix by precision s (is an orthonormal basis) [More...](#a532f94f1b94ee8d7c37b5778e665e171)  
 bool [IsUpperTriangular](class_matrix_block.xhtml#aaa1b06c2e42742d84cf52d0339718d74) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s) returns true if array is an upper triangular matrix by precision s [More...](#aaa1b06c2e42742d84cf52d0339718d74)  
 bool [IsVector](class_matrix_block.xhtml#a4bf46091a7288ba42f1df85840d905a7) () bool [IsZero](class_matrix_block.xhtml#aaf6af85eb9b71f6e502c05cef31a4add) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) s)  [MatrixBlock](class_matrix_block.xhtml#a0fffac266f16ee6932ef69f7892701bf) () INTERNAL USE!!!! [More...](#a0fffac266f16ee6932ef69f7892701bf)  
  [MatrixBlock](class_matrix_block.xhtml#ad8995f1d05f12b8692cac3ba8d30ee37) ([MatrixBlock](class_matrix_block.xhtml) ar) destructor, [More...](#ad8995f1d05f12b8692cac3ba8d30ee37)  
  [MatrixBlock](class_matrix_block.xhtml#a3fdcf3f8c4eeb2b100447600dde31bdc) ([Matrix](class_matrix.xhtml) x, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) startRow, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) startCol, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) blockRows, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) blockCols) constructor from [Matrix](class_matrix.xhtml "Standard matrix class. ") [More...](#a3fdcf3f8c4eeb2b100447600dde31bdc)  
  [MatrixBlock](class_matrix_block.xhtml#a085cef826dd5d2f93c55d37797cb2b55) ([Matrix](class_matrix.xhtml) x) constructor from full [Matrix](class_matrix.xhtml "Standard matrix class. ") [More...](#a085cef826dd5d2f93c55d37797cb2b55)  
 <a id="a02269c910dc4d6e7962201306589c136"></a>[TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) **MaxCoeff** ([TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) \*OUTPUT, [TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) \*OUTPUT) const [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) [MinCoeff](class_matrix_block.xhtml#a2f341a74fe43447f9cd684a645ea55b1) ([TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) \*OUTPUT, [TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) \*OUTPUT) const find the smallest element in the array [More...](#a2f341a74fe43447f9cd684a645ea55b1)  
  [Mul](class_matrix_block.xhtml#a67ad9262c1ebdd144f96accf0222b777) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) other) modifies this matrix by the scalar matrix product A\*s [More...](#a67ad9262c1ebdd144f96accf0222b777)  
 [Matrix](class_matrix.xhtml) [operator\*](class_matrix_block.xhtml#a29e90840f4d196f9fd74cf8f59b94cb9) ([Matrix](class_matrix.xhtml) other) const returns the matrix product A\*B [More...](#a29e90840f4d196f9fd74cf8f59b94cb9)  
 [Matrix](class_matrix.xhtml) [operator\*](class_matrix_block.xhtml#a53936030c84cd000ecbf81d5fa6fb005) ([MatrixBlock](class_matrix_block.xhtml) other) const returns the matrix product A\*B [More...](#a53936030c84cd000ecbf81d5fa6fb005)  
 [Matrix](class_matrix.xhtml) [operator\*](class_matrix_block.xhtml#ab37a095452e105c76034aca0303000d9) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) other) const returns the scalar matrix product A\*s [More...](#ab37a095452e105c76034aca0303000d9)  
 [Matrix](class_matrix.xhtml) [operator+](class_matrix_block.xhtml#aab49eb12364bb2a0a4341e884029dfea) ([Matrix](class_matrix.xhtml) other) const returns the matrix sum A+B [More...](#aab49eb12364bb2a0a4341e884029dfea)  
 [Matrix](class_matrix.xhtml) [operator+](class_matrix_block.xhtml#ae0cebd5d95ee9c112d3e835b1eb2f184) ([MatrixBlock](class_matrix_block.xhtml) other) const returns the matrix sum A+B [More...](#ae0cebd5d95ee9c112d3e835b1eb2f184)  
 [Matrix](class_matrix.xhtml) [operator-](class_matrix_block.xhtml#a2277ad125549453bb0e2e986287ead45) ([Matrix](class_matrix.xhtml) other) const returns the matrix difference A-B [More...](#a2277ad125549453bb0e2e986287ead45)  
 [Matrix](class_matrix.xhtml) [operator-](class_matrix_block.xhtml#adb471a658b8d9f65134fb3ef7163d8c5) ([MatrixBlock](class_matrix_block.xhtml) other) const returns the matrix difference A-B [More...](#adb471a658b8d9f65134fb3ef7163d8c5)  
 [Matrix](class_matrix.xhtml) [operator/](class_matrix_block.xhtml#a380ed928adb0f77541239d3ed8a56f43) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) other) const returns the scalar matrix quotient A/s [More...](#a380ed928adb0f77541239d3ed8a56f43)  
 [Matrix](class_matrix.xhtml) [operator&lt;](class_matrix_block.xhtml#a872a8318f4c9b443d9268a2ac27ece7a) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) x) const returns a matrix of 1 and 0 indicating which element is less than x [More...](#a872a8318f4c9b443d9268a2ac27ece7a)  
 [MatrixBlock](class_matrix_block.xhtml) [Row](class_matrix_block.xhtml#a90b7fd2d31acbef1bf30eef064fd5348) ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) row) returns a reference to the 'row'th row [More...](#a90b7fd2d31acbef1bf30eef064fd5348)  
 [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) [Rows](class_matrix_block.xhtml#a9bc99715ea9c71ed92be5142140f505c) () const [MatrixBlock](class_matrix_block.xhtml) [Rows](class_matrix_block.xhtml#a60a48880d61ca9103ae8725dd71980d6) ([TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) row1, [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae) nrow) returns a block containing the nrow columns starting at column index row1 [More...](#a60a48880d61ca9103ae8725dd71980d6)  
  [SetConstant](class_matrix_block.xhtml#a7e9b8781289e118b3ea0fddfca5626d4) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) value) initializes the matrix with constant values [More...](#a7e9b8781289e118b3ea0fddfca5626d4)  
 <a id="ab906717579cb29562dcfbb5b685b0a1e"></a> [SetIdentity](class_matrix_block.xhtml#ab906717579cb29562dcfbb5b685b0a1e) () initializes the matrix as identity matrix   
  [SetLinearCols](class_matrix_block.xhtml#a69847737f899eb099b48ba10685b81b1) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) [a](group__tmath.xhtml#ga7e205066f67b9e3fd4c8cbd5859e8da3), [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) b) initializes the matrix with linear columns [More...](#a69847737f899eb099b48ba10685b81b1)  
  [SetLinearRows](class_matrix_block.xhtml#af141c5f38b1ec802761d4554daca44e4) ([TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) [a](group__tmath.xhtml#ga7e205066f67b9e3fd4c8cbd5859e8da3), [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f) b) initializes the matrix with linear rows [More...](#af141c5f38b1ec802761d4554daca44e4)  
 <a id="a2ee33cbc9e62f783252c8fe672f89656"></a> [SetOnes](class_matrix_block.xhtml#a2ee33cbc9e62f783252c8fe672f89656) () initializes the matrix with constant values "1"   
 <a id="add294531143600c1ca80ace287222efa"></a> [SetRandom](class_matrix_block.xhtml#add294531143600c1ca80ace287222efa) () initializes the matrix with random values   
 <a id="a82fdaa2aa8c930c663007796e9aaa03f"></a> [SetZero](class_matrix_block.xhtml#a82fdaa2aa8c930c663007796e9aaa03f) () initializes the matrix with zeros   
  [Sub](class_matrix_block.xhtml#a4fbbdfc36bec89e69078091d5e3fc724) ([Matrix](class_matrix.xhtml) other) modifies this matrix by the matrix difference A-B [More...](#a4fbbdfc36bec89e69078091d5e3fc724)  
  [Sub](class_matrix_block.xhtml#a8ff14282011c997c57439e80c5e2f624) ([MatrixBlock](class_matrix_block.xhtml) other) modifies this matrix by the matrix difference A-B [More...](#a8ff14282011c997c57439e80c5e2f624)  
 [Matrix](class_matrix.xhtml) [Transpose](class_matrix_block.xhtml#a7c9a50b8de83115cb0346dff0de3dd90) () ## <a name="pub-attribs"></a>Public Attributes

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

A generic view onto parts of a [Matrix](class_matrix.xhtml "Standard matrix class. ").

Objects of this kind do not create a data buffer, but use the data buffer of an existing [Matrix](class_matrix.xhtml "Standard matrix class. ") object. The object saves the indices of the part of the refered matrix object it refers to (start position and size). A matrix block may represent a view onto

- the whole matrix
- columns
- rows
- arbitrary submatrices

[Matrix](class_matrix.xhtml "Standard matrix class. ") blocks themeselves behave like [Matrix](class_matrix.xhtml "Standard matrix class. ") objects. Most of the operators and some external functions are defined. You can even assign values to the block (which in turn will change the data of the referred matrix).

By using a reference counting system it is guaranteed that the refered object will not be deleted before the [MatrixBlock](class_matrix_block.xhtml "A generic view onto parts of a Matrix. ") is deleted.



## Constructor &amp; Destructor Documentation

<a id="a0fffac266f16ee6932ef69f7892701bf"></a>## [◆ ](#a0fffac266f16ee6932ef69f7892701bf)MatrixBlock() \[1/4\]

 [MatrixBlock](class_matrix_block.xhtml)  ( ) 

INTERNAL USE!!!!

NoteDo never use this constructor. Is needed by SWIG only! 



<a id="ad8995f1d05f12b8692cac3ba8d30ee37"></a>## [◆ ](#ad8995f1d05f12b8692cac3ba8d30ee37)MatrixBlock() \[2/4\]

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

destructor,

copy constructor

Parameters arthe matrix block to be copied from (it will refer to the same matrix) 



<a id="a3fdcf3f8c4eeb2b100447600dde31bdc"></a>## [◆ ](#a3fdcf3f8c4eeb2b100447600dde31bdc)MatrixBlock() \[3/4\]

 [MatrixBlock](class_matrix_block.xhtml)  ( [Matrix](class_matrix.xhtml)  *x*,    [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *startRow*,    [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *startCol*,    [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *blockRows*,    [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *blockCols*   ) 

constructor from [Matrix](class_matrix.xhtml "Standard matrix class. ")

Parameters xthe matrix to be referred to startRowthe top left row index startColthe top left column index blockRowsthe numnber of rows blockColsthe numnber of columns 



<a id="a085cef826dd5d2f93c55d37797cb2b55"></a>## [◆ ](#a085cef826dd5d2f93c55d37797cb2b55)MatrixBlock() \[4/4\]

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

constructor from full [Matrix](class_matrix.xhtml "Standard matrix class. ")

Parameters xthe matrix to be referred to 



## 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="a6d654d1ab1ea88faee2c64103aec6703"></a>## [◆ ](#a6d654d1ab1ea88faee2c64103aec6703)Assign()

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

The assignment operator (copy by value)

Parameters arthe input matrix to be read from 



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

 [MatrixBlock](class_matrix_block.xhtml) Block  ( [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *row*,    [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *col*,    [TUnsignedIndex](class_matrix_block.xhtml#ab423d248b103558b5903c702c13335ae)  *numrows*,    [TUnsignedIndex](class_matrix_block.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_block.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_block.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_block.xhtml#ab423d248b103558b5903c702c13335ae)  *col1*,    [TUnsignedIndex](class_matrix_block.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="a2e4ffbe13f1929444cbb608d5b941fb7"></a>## [◆ ](#a2e4ffbe13f1929444cbb608d5b941fb7)Div()

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

modifies this matrix by the scalar matrix quotient A/s

Parameters otherthe scalar s 



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

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

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="a11db06291893eecf8aaa28e6247f594a"></a>## [◆ ](#a11db06291893eecf8aaa28e6247f594a)IsApprox() \[2/2\]

 bool IsApprox  ( [MatrixBlock](class_matrix_block.xhtml)  *other*,    [TScalar](class_matrix_block.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_block.xhtml#ad33f729eda6e45412aac71cee702012f)  *value*,    [TScalar](class_matrix_block.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_block.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_block.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_block.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_block.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_block.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_block.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_block.xhtml#ad33f729eda6e45412aac71cee702012f) MinCoeff  ( [TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) \*  *OUTPUT*,    [TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) \*  *OUTPUT*   )  const

find the smallest element in the array

Returnsreturns 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 



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

 Mul  ( [TScalar](class_matrix_block.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_block.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_block.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_block.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="a90b7fd2d31acbef1bf30eef064fd5348"></a>## [◆ ](#a90b7fd2d31acbef1bf30eef064fd5348)Row()

 [MatrixBlock](class_matrix_block.xhtml) Row  ( [TUnsignedIndex](class_matrix_block.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_block.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_block.xhtml#ab423d248b103558b5903c702c13335ae)  *row1*,    [TUnsignedIndex](class_matrix_block.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="a7e9b8781289e118b3ea0fddfca5626d4"></a>## [◆ ](#a7e9b8781289e118b3ea0fddfca5626d4)SetConstant()

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

initializes the matrix with constant values

Parameters valuethe scalar value of the matrix 



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

 SetLinearCols  ( [TScalar](class_matrix_block.xhtml#ad33f729eda6e45412aac71cee702012f)  *a*,    [TScalar](class_matrix_block.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_block.xhtml#ad33f729eda6e45412aac71cee702012f)  *a*,    [TScalar](class_matrix_block.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="a7c9a50b8de83115cb0346dff0de3dd90"></a>## [◆ ](#a7c9a50b8de83115cb0346dff0de3dd90)Transpose()

 [Matrix](class_matrix.xhtml) Transpose  ( ) 

Returnsthe transpose 



## Member Data Documentation

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

 apply int { [TEigenIndex](class_matrix_block.xhtml#a86f01d421642db7700772fc3e957ba41) }

find the largest element in the array

Returnsreturns 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