scalar.html

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

HTML
71
字号
<HTML><HEAD><TITLE>Newmat09 - scalar functions of a matrix</TITLE></HEAD><BODY><H2>Scalar functions of a matrix</H2><A HREF="submat.html">  next</A> - <A HREF="submat.html">  skip</A> - <A HREF="refer.html">  up</A> - <A HREF="index.html">  start</A><P><PRE>    int m = A.Nrows();                    // number of rows    int n = A.Ncols();                    // number of columns    Real r = A.AsScalar();                // value of 1x1 matrix    Real ssq = A.SumSquare();             // sum of squares of elements    Real sav = A.SumAbsoluteValue();      // sum of absolute values    Real s = A.Sum();                     // sum of values    Real mav = A.MaximumAbsoluteValue();  // maximum of absolute values    Real norm = A.Norm1();                // maximum of sum of absolute                                             values of elements of a column    Real norm = A.NormInfinity();         // maximum of sum of absolute                                             values of elements of a row    Real t = A.Trace();                   // trace    LogAndSign ld = A.LogDeterminant();   // log of determinant    bool z = A.IsZero();                  // test all elements zero    MatrixType mt = A.Type();             // type of matrix    Real* s = Store();                    // pointer to array of elements    int l = Storage();                    // length of array of elements    bool s = A.IsSingular();              // A is a CroutMatrix or                                             BandLUMatrix    MatrixBandWidth mbw = A.BandWidth();  // upper and lower bandwidths</PRE><TT>A.LogDeterminant()</TT> returns a value of type LogAndSign.If ld is of type LogAndSign  use<PRE>    ld.Value()    to get the value of the determinant    ld.Sign()     to get the sign of the determinant (values 1, 0, -1)    ld.LogValue() to get the log of the absolute value.</PRE><TT>A.IsZero()</TT> returns Boolean value <TT>true</TT>if the matrix <TT>A</TT>has all elements equal to 0.0.<P><TT>IsSingular</TT> is defined only for CroutMatrix and BandLUMatrix. It returns<TT>true</TT> if one of the diagonal elements of the LU decomposition isexactly zero.  <P><TT>MatrixType mt = A.Type()</TT> returns the type of a matrix.Use <TT>(char*)mt</TT> toget a string  (UT, LT, Rect, Sym, Diag, Band, UB, LB, Crout, BndLU)showing the type(Vector types are returned as Rect).<P><TT>MatrixBandWidth</TT> has member functions <TT>Upper()</TT> and<TT>Lower()</TT> for finding the upper and lower bandwidths (number of diagonalsabove and below the diagonal, both zero for a diagonal matrix). For non-bandmatrices -1 is returned for both these values.<P>The versionsSum(A), SumSquare(A), SumAbsoluteValue(A), MaximumAbsoluteValue(A), Trace(A),LogDeterminant(A), Norm1(A), NormInfinity(A)  can be used in place ofA.Sum(), A.SumSquare(), A.SumAbsoluteValue(), A.MaximumAbsoluteValue(),A.Trace(), A.LogDeterminant(), A.Norm1(), A.NormInfinity().<P><A HREF="submat.html">  next</A> - <A HREF="submat.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 + -
显示快捷键?