A.SubMatrix(fr,lr,fc,lc)This selects a submatrix from A. The arguments fr,lr,fc,lc are the first row, last row, first column, last column of the submatrix with the numbering beginning at 1. This may be used in any matrix expression or on the left hand side of =, << or Inject. Inject does not check no information loss. You can also use the construction
Real c; .... A.SubMatrix(fr,lr,fc,lc) = c;to set a submatrix equal to a constant.
The follwing are variants of SubMatrix:
A.SymSubMatrix(f,l) // This assumes fr=fc and lr=lc. A.Rows(f,l) // select rows A.Row(f) // select single row A.Columns(f,l) // select columns A.Column(f) // select single columnIn each case f and l mean the first and last row or column to be selected (starting at 1).
If SubMatrix or its variant occurs on the right hand side of an = or << or within an expression its type is as follows
A.Submatrix(fr,lr,fc,lc): If A is RowVector or ColumnVector then same type otherwise type Matrix A.SymSubMatrix(f,l): Same type as A A.Rows(f,l): Type Matrix A.Row(f): Type RowVector A.Columns(f,l): Type Matrix A.Column(f): Type ColumnVectorIf SubMatrix or its variant appears on the left hand side of = or << , think of its type being Matrix. Thus L.Row(1) where L is LowerTriangularMatrix expects L.Ncols() elements even though it will use only one of them. If you are using = the program will check for no loss of data. If you are are using the submatrix facility to build a matrix from a small number of components, consider instead using the concatenation operators.