- HasNan
- Transpose
- TransposeConjugate
- TriL
- TriU
- Diag
- Row
- Col
- Copy
- Compare
- CompareByDigits
- CompareEqual
- Flat
- Clip
- Reshape
- Resize
- Set
- SwapRows
- SwapCols
- Split
- Hsplit
- Vsplit
- ArgSort
- Sort
Flat
Allows addressing a matrix element through one index instead of two.
bool matrix::Flat(
|
Parameters
index
[in] Flat index
value
[in] Value to set by given index.
Return Value
Value by given index.
Note
For the matrix mat(3,3), access can be written as follows:
- reading: 'x=mat.Flat(4)', which is equivalent to 'x=mat[1][1]'
- writing: 'mat.Flat(5, 42)', equivalent to 'mat[1][2]=42'
Example
matrix matrix_a={{10,3,2},{1,8,12},{6,5,4},{7,11,9}};
|