📄 submat.html
字号:
<HTML><HEAD><TITLE>Newmat09 - submatrices</TITLE></HEAD><BODY><H2>Submatrices</H2><A HREF="dimen.html"> next</A> - <A HREF="dimen.html"> skip</A> - <A HREF="refer.html"> up</A> - <A HREF="index.html"> start</A><P><PRE> A.SubMatrix(fr,lr,fc,lc)</PRE>This selects a submatrix from <TT>A</TT>. The arguments fr,lr,fc,lcare thefirst row, last row, first column, last column of the submatrix with thenumbering beginning at 1. This may be used in any matrix expression oron the left hand side of <TT>=</TT>, <TT><<</TT> or Inject. Injectdoes not check noinformation loss. You can also use the construction<PRE> Real c; .... A.SubMatrix(fr,lr,fc,lc) = c;</PRE>to set a submatrix equal to a constant.<P>The following are variants of SubMatrix:<PRE> 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 column</PRE>In each case f and l mean the first and last row or column to beselected (starting at 1).<P>I allow lr = fr-1, lc = fc-1 or l = f-1 to indicate that a matrix ofzero rows or columns is to be returned.<P>If SubMatrix or its variant occurs on the right hand side of an <TT>=</TT>or <TT><<</TT>or within an expression its type is as follows<PRE> 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 ColumnVector</PRE>If SubMatrix or its variant appears on the left hand side of <TT>=</TT> or<TT><<</TT> ,think of its type being Matrix. Thus <TT>L.Row(1)</TT> where <TT>L</TT> isLowerTriangularMatrix expects <TT>L.Ncols()</TT> elements even though itwill use only one of them. If you are using <TT>=</TT> the program willcheck for no loss of data.<P>A SubMatrix can appear on the left-hand side of <TT>+=</TT> or <TT>-=</TT> witha matrix expression on the right-hand side. It can also appear on the left-handside of <TT>+=</TT>, <TT>-=</TT>, <TT>*=</TT> or <TT>/=</TT> with a Real on theright-hand side. In each case there must be no loss of information.<P>Do not use the <TT>+=</TT> and <TT>-=</TT> operations with a submatrix of aSymmetricMatrix or BandSymmetricMatrix on the LHS and a Real on the RHS. <P>If you are are using the submatrix facility to build a matrix from a smallnumber of components, consider instead using the<A HREF="binary.html">concatenation operators</A>.<P><A HREF="dimen.html"> next</A> - <A HREF="dimen.html"> skip</A> - <A HREF="refer.html"> up</A> - <A HREF="index.html"> start</A><P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -