📄 elements.html
字号:
<HTML><HEAD><TITLE>Newmat09 - elements</TITLE></HEAD><BODY><H2>Accessing elements</H2><A HREF="copy.html"> next</A> - <A HREF="copy.html"> skip</A> - <A HREF="refer.html"> up</A> - <A HREF="index.html"> start</A><P>Elements are accessed by expressions of the form <TT>A(i,j)</TT>where i and jrun from 1 to the appropriate dimension. Access elements of vectors withjust one argument. Diagonal matrices can accept one or two subscripts.<P>This is different from the earliest version of the package in which thesubscripts ran from 0 to one less than the appropriate dimension. Use<TT>A.element(i,j)</TT> if you want this earlier convention.<P><TT>A(i,j)</TT> and <TT>A.element(i,j)</TT> can appear on either sideof an = sign.<P>If you activate the <TT>#define SETUP_C_SUBSCRIPTS</TT> in <TT>include.h</TT>you can alsoaccess elements using the traditional C style notation. That is <TT>A[i][j]</TT>for matrices (except diagonal) and <TT>V[i]</TT> for vectors and diagonalmatrices. The subscripts start at zero (ie like element) and there is norange checking. Because of the possibility of confusing <TT>V(i)</TT>and <TT>V[i]</TT>, I suggest you do not activate this option unless you reallywant to use it.<P>Symmetric matrices are stored as lower triangular matrices. It is important toremember this if you are using the <TT>A[i][j]</TT> method of accessing elements.Makesure the first subscript is greater than or equal to the second subscript.However, if youare using the <TT>A(i,j)</TT> method the program will swap <TT>i</TT> and<TT>j</TT> if necessary; so it doesn'tmatter if you think of the storage as being in the upper triangle (but it<I>does</I> matter in some other situations such as when<A HREF="entering.html">entering</A> data).<P><A HREF="copy.html"> next</A> - <A HREF="copy.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 + -