> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MatrixBlock Class Reference

Part of [tmath](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath)

A generic view onto parts of a [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md).

## Public Types

| Type | Name |
| - | - |
|  typedef Eigen::Block\< [MatrixBase](#a1ef23fdfe98b3d18679b427ec61dc4d6), Eigen::Dynamic, Eigen::Dynamic > | [Base](#a09a3d2bacf808bdb41dfdc45a99eb23d) the type of the ancestor class; here: an Eigen::Block |
|  typedef Eigen::Matrix\< [TScalar](#ad33f729eda6e45412aac71cee702012f), Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > | [MatrixBase](#a1ef23fdfe98b3d18679b427ec61dc4d6) the type of the Eigen matrix base class we refer to |
|  typedef [TScalar](#ad33f729eda6e45412aac71cee702012f) \* | [TBuffer](#a3541a03e0ef75e0b541a5969c9c998a2) the data type of the dynamic data buffer (pointer) |
|  typedef MatrixBase::Index | [TEigenIndex](#a86f01d421642db7700772fc3e957ba41) index type for Eigen matrices |
|  typedef number | [TScalar](#ad33f729eda6e45412aac71cee702012f) the floating point number type of a mtrix element |
|  typedef number | [TUnsignedIndex](#ab423d248b103558b5903c702c13335ae) an unsigned index type |

## Public Member Functions

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

## Public Attributes

| Type | Name |
| - | - |
| apply | [int](#a0824d20c454aab42f337b2a6c0a81dc2) \{ [TEigenIndex](#a86f01d421642db7700772fc3e957ba41) } find the largest element in the array |
|  apply [int](#a0824d20c454aab42f337b2a6c0a81dc2) \* | **OUTPUT** \{ [TEigenIndex](#a86f01d421642db7700772fc3e957ba41) \*OUTPUT } |

## Detailed Description

A generic view onto parts of a [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md).

Objects of this kind do not create a data buffer, but use the data buffer of an existing [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) 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](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) blocks themeselves behave like [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) 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](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix_block.md) is deleted.

## Constructor & Destructor Documentation

### MatrixBlock() \[1/4]

```cpp theme={null}
MatrixBlock()
```

INTERNAL USE!!!!

> [!NOTE]
>
> Do never use this constructor. Is needed by SWIG only!

### MatrixBlock() \[2/4]

```cpp theme={null}
MatrixBlock(MatrixBlock ar)
```

destructor,

copy constructor

**Parameters**

| Name | Description |
| - | - |
| ar | the matrix block to be copied from (it will refer to the same matrix) |

### MatrixBlock() \[3/4]

```cpp theme={null}
MatrixBlock(
    Matrix x,
    TUnsignedIndex startRow,
    TUnsignedIndex startCol,
    TUnsignedIndex blockRows,
    TUnsignedIndex blockCols
)
```

constructor from [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md)

**Parameters**

| Name | Description |
| - | - |
| x | the matrix to be referred to |
| startRow | the top left row index |
| startCol | the top left column index |
| blockRows | the numnber of rows |
| blockCols | the numnber of columns |

### MatrixBlock() \[4/4]

```cpp theme={null}
MatrixBlock(Matrix x)
```

constructor from full [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md)

**Parameters**

| Name | Description |
| - | - |
| x | the matrix to be referred to |

## Member Function Documentation

### \_\_neg\_\_()

```cpp theme={null}
Matrix __neg__() const
```

**Returns**

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

### \_\_str\_\_()

```cpp theme={null}
char* __str__()
```

transforms this objects into a string, required by SWIG

**Returns**

a string

### Add() \[1/2]

```cpp theme={null}
Add(Matrix other)
```

modifies this matrix by the matrix sum A+B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

### Add() \[2/2]

```cpp theme={null}
Add(MatrixBlock other)
```

modifies this matrix by the matrix sum A+B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

### Assign()

```cpp theme={null}
Assign(MatrixBlock ar)
```

The assignment operator (copy by value)

**Parameters**

| Name | Description |
| - | - |
| ar | the input matrix to be read from |

### Block()

```cpp theme={null}
MatrixBlock Block(
    TUnsignedIndex row,
    TUnsignedIndex col,
    TUnsignedIndex numrows,
    TUnsignedIndex numcols
)
```

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

**Parameters**

| Name | Description |
| - | - |
| row | the top left row index |
| col | the top left column index |
| numrows | the number of rows of the matrix part |
| numcols | the number of columns of the matrix part |

**Returns**

a matrix block serving as a reference to the specified matrix part

### Col()

```cpp theme={null}
MatrixBlock Col(TUnsignedIndex col)
```

returns a reference to the 'col'th column

**Parameters**

| Name | Description |
| - | - |
| col | the requested column index |

**Returns**

a matrix block serving as a reference to the column

### Cols() \[1/2]

```cpp theme={null}
TUnsignedIndex Cols() const
```

**Returns**

the number of cols

### Cols() \[2/2]

```cpp theme={null}
MatrixBlock Cols(
    TUnsignedIndex col1,
    TUnsignedIndex ncol
)
```

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

**Parameters**

| Name | Description |
| - | - |
| col1 | the left column index |
| ncol | the number of columns of the matrix part |

**Returns**

a matrix block serving as a reference to the specified matrix part

### Div()

```cpp theme={null}
Div(TScalar other)
```

modifies this matrix by the scalar matrix quotient A/s

**Parameters**

| Name | Description |
| - | - |
| other | the scalar s |

### IsApprox() \[1/2]

```cpp theme={null}
bool IsApprox(
    Matrix other,
    TScalar s
)
```

returns true if other and this are approx. identical

**Parameters**

| Name | Description |
| - | - |
| other | the object to be compared |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsApprox() \[2/2]

```cpp theme={null}
bool IsApprox(
    MatrixBlock other,
    TScalar s
) const
```

returns true if other and this are approx. identical

**Parameters**

| Name | Description |
| - | - |
| other | the object to be compared |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsApproxToConstant()

```cpp theme={null}
bool IsApproxToConstant(
    TScalar value,
    TScalar s
)
```

returns true if array is constant and approx. equal s

**Parameters**

| Name | Description |
| - | - |
| value | the constant value to be compared with |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsDiagonal()

```cpp theme={null}
bool IsDiagonal(TScalar s)
```

returns true if array is a diagonal matrix by precision s

**Parameters**

| Name | Description |
| - | - |
| s | a tolerance for the test |

**Returns**

the result of the operation

### IsIdentity()

```cpp theme={null}
bool IsIdentity(TScalar s)
```

returns true if array is the identity matrix by precision s

**Parameters**

| Name | Description |
| - | - |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsLowerTriangular()

```cpp theme={null}
bool IsLowerTriangular(TScalar s)
```

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

**Parameters**

| Name | Description |
| - | - |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsScalar()

```cpp theme={null}
bool IsScalar()
```

**Returns**

true if array is a scalar

### IsUnitary()

```cpp theme={null}
bool IsUnitary(TScalar s)
```

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

**Parameters**

| Name | Description |
| - | - |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsUpperTriangular()

```cpp theme={null}
bool IsUpperTriangular(TScalar s)
```

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

**Parameters**

| Name | Description |
| - | - |
| s | a tolerance for the equality test |

**Returns**

the result of the operation

### IsVector()

```cpp theme={null}
bool IsVector()
```

**Returns**

true if array is a vector

### IsZero()

```cpp theme={null}
bool IsZero(TScalar s)
```

**Returns**

true if array is a zero matrix by precision s

**Parameters**

| Name | Description |
| - | - |
| s | a tolerance for the equality test |

### MinCoeff()

```cpp theme={null}
TScalar MinCoeff(
    TEigenIndex * OUTPUT,
    TEigenIndex * OUTPUT
) const
```

find the smallest element in the array

**Returns**

returns the minimum element in the array

**Parameters**

| Name | Description |
| - | - |
| row | will be modified and will contain the row position of the found value on return |
| col | will be modified and will contain the column position of the found value on return |

### Mul()

```cpp theme={null}
Mul(TScalar other)
```

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

**Parameters**

| Name | Description |
| - | - |
| other | the scalar s |

### operator\*() \[1/3]

```cpp theme={null}
Matrix operator*(Matrix other) const
```

returns the matrix product A\*B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

**Returns**

the result of the operation

### operator\*() \[2/3]

```cpp theme={null}
Matrix operator*(MatrixBlock other) const
```

returns the matrix product A\*B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

**Returns**

the result of the operation

### operator\*() \[3/3]

```cpp theme={null}
Matrix operator*(TScalar other) const
```

returns the scalar matrix product A\*s

**Parameters**

| Name | Description |
| - | - |
| other | the scalar s |

**Returns**

the result of the operation

### operator+() \[1/2]

```cpp theme={null}
Matrix operator+(Matrix other) const
```

returns the matrix sum A+B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

**Returns**

the result of the operation

### operator+() \[2/2]

```cpp theme={null}
Matrix operator+(MatrixBlock other) const
```

returns the matrix sum A+B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

**Returns**

the result of the operation

### operator-() \[1/2]

```cpp theme={null}
Matrix operator-(Matrix other) const
```

returns the matrix difference A-B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

**Returns**

the result of the operation

### operator-() \[2/2]

```cpp theme={null}
Matrix operator-(MatrixBlock other) const
```

returns the matrix difference A-B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

**Returns**

the result of the operation

### operator/()

```cpp theme={null}
Matrix operator/(TScalar other) const
```

returns the scalar matrix quotient A/s

**Parameters**

| Name | Description |
| - | - |
| other | the scalar s |

**Returns**

the result of the operation

### operator\<()

```cpp theme={null}
Matrix operator<(TScalar x) const
```

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

**Parameters**

| Name | Description |
| - | - |
| x | the scalar x |

**Returns**

the result of the operation

### Row()

```cpp theme={null}
MatrixBlock Row(TUnsignedIndex row)
```

returns a reference to the 'row'th row

**Parameters**

| Name | Description |
| - | - |
| row | the requested row index |

**Returns**

a matrix block serving as a reference to the row

### Rows() \[1/2]

```cpp theme={null}
TUnsignedIndex Rows() const
```

**Returns**

the number of rows

### Rows() \[2/2]

```cpp theme={null}
MatrixBlock Rows(
    TUnsignedIndex row1,
    TUnsignedIndex nrow
)
```

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

**Parameters**

| Name | Description |
| - | - |
| row1 | the right row index |
| nrow | the number of rows of the matrix part |

**Returns**

a matrix block serving as a reference to the specified matrix part

### SetConstant()

```cpp theme={null}
SetConstant(TScalar value)
```

initializes the matrix with constant values

**Parameters**

| Name | Description |
| - | - |
| value | the scalar value of the matrix |

### SetLinearCols()

```cpp theme={null}
SetLinearCols(
    TScalar a,
    TScalar b
)
```

initializes the matrix with linear columns

**Parameters**

| Name | Description |
| - | - |
| a | the value of the first row |
| b | the value of the last row |

### SetLinearRows()

```cpp theme={null}
SetLinearRows(
    TScalar a,
    TScalar b
)
```

initializes the matrix with linear rows

**Parameters**

| Name | Description |
| - | - |
| a | the value of the first column |
| b | the value of the last column |

### Sub() \[1/2]

```cpp theme={null}
Sub(Matrix other)
```

modifies this matrix by the matrix difference A-B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

### Sub() \[2/2]

```cpp theme={null}
Sub(MatrixBlock other)
```

modifies this matrix by the matrix difference A-B

**Parameters**

| Name | Description |
| - | - |
| other | the matrix B |

### Transpose()

```cpp theme={null}
Matrix Transpose()
```

**Returns**

the transpose

## Member Data Documentation

### int

```cpp theme={null}
apply int { TEigenIndex }
```

find the largest element in the array

**Returns**

returns the maximum element in the array

**Parameters**

| Name | Description |
| - | - |
| row | will be modified and will contain the row position of the found value on return |
| col | will be modified and will contain the column position of the found value on return |
