dimen.html

来自「矩阵算法库newmat10.tar.gz的帮助文件」· HTML 代码 · 共 46 行

HTML
46
字号
<HTML><HEAD><TITLE>Newmat09 - change dimensions</TITLE></HEAD><BODY><H2>Change dimensions</H2><A HREF="ch_type.html">  next</A> - <A HREF="ch_type.html">  skip</A> - <A HREF="refer.html">  up</A> - <A HREF="index.html">  start</A><P>The following operations change the dimensions of a matrix. The valuesof the elements are lost.<PRE>    A.ReSize(nrows,ncols);        // for type Matrix or nricMatrix    A.ReSize(n);                  // for all other types, except Band    A.ReSize(n,lower,upper);      // for BandMatrix    A.ReSize(n,lower);            // for LowerBandMatrix    A.ReSize(n,upper);            // for UpperBandMatrix    A.ReSize(n,lower);            // for SymmetricBandMatrix</PRE>Use <TT>A.CleanUp()</TT> to set the dimensions of <TT>A</TT> to zeroand release all the heap memory.<P>Remember that <TT>ReSize</TT> destroys values.If you want to <TT>ReSize</TT>, butkeep the values in the bit that is left use something like<PRE>   ColumnVector V(100);   ...                            // load values   V = V.Rows(1,50);              // to get first 50 values.</PRE>If you want to extend a matrix or vector use something like<PRE>   ColumnVector V(50);   ...                            // load values   { V.Release(); ColumnVector X=V; V.ReSize(100); V.Rows(1,50)=X; }                                  // V now length 100</PRE><P><A HREF="ch_type.html">  next</A> - <A HREF="ch_type.html">  skip</A> - <A HREF="refer.html">  up</A> - <A HREF="index.html">  start</A><P></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?