📄 symmetric.html
字号:
<HTML><!-- -- Copyright (c) 1998,1999 -- University of Notre Dame -- -- Permission to use, copy, modify, distribute and sell this software -- and its documentation for any purpose is hereby granted without fee, -- provided that the above copyright notice appears in all copies and -- that both that copyright notice and this permission notice appear -- in supporting documentation. The University of Notre Dame makes no -- representations about the suitability of this software for any -- purpose. It is provided "as is" without express or implied warranty. -- --><HEAD><TITLE>Description of symmetric</TITLE></HEAD><BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" ALINK="#ff0000"> <FONT FACE=Helvetica><!--end header--><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 WIDTH=100%><TR><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><TR><TD Align=left valign=middle width=440 rowspan=2><FONT FACE=verdana,arial,helvetica SIZE=+3 COLOR=#110088><B>symmetric<int Uplo = dynamic_uplo></B></FONT></TD><TD valign=middle Align=right width=128 rowspan=2><A HREF="http://lsc.nd.edu/research/mtl"><IMG BORDER=0 SRC="./glossy-mtl-logo.jpg" height=48 ALT="[MTL Home]"></A></TD><TD Align=center width=280 nowrap><Font face=verdana,arial,helvetica size=+3><b>Programmers Guide</b></font></TD></TR><TR BGCOLOR='#2020b0'><TD HEIGHT=20 VALIGN='MIDDLE' NOWRAP align=center STYLE="font-family:verdana,arial,helvetica;font-weight:bold;"> <A STYLE="text-decoration:none;color:white;font-family:verdana,arial,helvetica;font-weight:bold;" HREF="./table_of_contents.html">Contents</A> | <A STYLE="text-decoration:none;color:white;font-family:verdana,arial,helvetica;font-weight:bold;" HREF="./mtl_index.html">Index</A> | <A STYLE="text-decoration:none;color:white;font-family:verdana,arial,helvetica;font-weight:bold;" HREF="http://lsc.nd.edu/research/mtl/search.html">Search</A> </TD></TR></TABLE></TD></TR><TR><TD><Table Border=0 CellPadding=0 CellSpacing=0 width=100% cols=2><TR><TD Align=left><BR><TABLE BORDER=0 CellSpacing=0 CellPadding=0><TR><TD><Img src = "containers.gif" Alt="" WIDTH = "194" HEIGHT = "38" ></TD></TR><TR><TD><Img src = "selectors.gif" Alt="" WIDTH = "194" HEIGHT = "38" ></TD></TR></TABLE></TD><TD Align=right><BR><TABLE BORDER=0 CellSpacing=0 CellPadding=0><TR><TD><Img src = "type.gif" Alt="" WIDTH = "194" HEIGHT = "38" ></TD></TR></TABLE></TD></TR><TR><TD Align=left VAlign=top><b>Category</b>:containers,selectors</TD><TD Align=right VAlign=top><b>Component type</b>:type</TD></TR></Table></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="10" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Description</B></FONT></TD></TR><TR><TD> Symmetric matrices are similar to <A HREF="banded.html" >banded</A> matrices in that there is only access to a particular band of the <A HREF="matrix.html" >matrix</A>. The difference is that in an MTL <A HREF="symmetric.html" >symmetric</A> <A HREF="matrix.html" >matrix</A>, <tt>A(i,j)</tt> and <tt>A(j,i)</tt> refer to the same element. The following is an example of a <A HREF="symmetric.html" >symmetric</A> <A HREF="matrix.html" >matrix</A>: <pre> the full <A HREF="symmetric.html" >symmetric</A> <A HREF="matrix.html" >matrix</A> [ 1 2 3 4 5 ] [ 2 6 7 8 9 ] [ 3 7 10 11 12 ] [ 4 8 11 13 14 ] [ 5 9 12 14 15 ] the <A HREF="symmetric.html" >symmetric</A> <A HREF="matrix.html" >matrix</A> in <A HREF="packed.html" >packed</A> storage [ 1 ] [ 2 6 ] [ 3 7 10 ] [ 4 8 11 13 ] [ 5 9 12 14 15 ] </pre> Similar to the <A HREF="triangle.html" >triangle</A> shape, the user must provide an <tt>Uplo</tt> argument which specifies which part of the <A HREF="matrix.html" >matrix</A> is actually stored. The valid choices are <tt>upper</tt> and <tt>lower</tt> for <A HREF="symmetric.html" >symmetric</A> matrices. <pre> typedef <A HREF="matrix.html" >matrix</A> < double, <A HREF="symmetric.html" >symmetric</A><lower>, <A HREF="packed.html" >packed</A><>, <A HREF="row_major.html" >row_major</A> >::type SymmMatrix; </pre></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Example</B></FONT></TD></TR><TR><TD>In <A HREF=../../contrib/examples/symm_packed_vec_prod.cc>symm_packed_vec_prod.cc</A>:<PRE> double da[16]; typedef matrix< double, symmetric<lower>, packed<external>, column_major >::type Matrix; const Matrix::size_type matrix_size = 5; Matrix A(da, matrix_size, matrix_size); typedef dense1D<double> Vec; Vec y(matrix_size,1),x(matrix_size), Ax(matrix_size); double alpha=1, beta=0; // 1 2 3 4 5 1 1000 // 2 6 7 8 9 2 2000 // A = 3 7 10 11 12 x = 3 y = 3000 // 4 8 11 13 14 4 4000 // 5 9 12 14 15 5 5000 //make A for (i = 0; i < 15; ++i) da[i] = i + 1; //make x y for ( i = 0; i < matrix_size; ++i){ y[i]=1000*(i+1); x[i]=i+1; } mult(A, scaled(x,alpha), scaled(y,beta), y);</PRE><P>More examples can be found in <a href=../../contrib/examples/symm_banded_vec_prod.cc>symm_banded_vec_prod.cc</a></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Definition</B></FONT></TD></TR><TR><TD><A HREF=""></A></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Template Parameters</B></FONT></TD></TR><TR><TD><BR><TABLE BORDER><TR><TH>Parameter</TH><TH>Description</TH><TH>Default</TH></TR><TR><TD><TT>Uplo</TT></TD><TD>The portion of the <A HREF="matrix.html" >matrix</A> that is stored. Either upper or lower.</TD><TD><TT> </TT></TD></TR></TABLE></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Model of</B></FONT></TD></TR><TR><TD></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Members</B></FONT></TD></TR><TR><TD><TABLE BORDER><TR><TH>Member</TH><TH>Where defined</TH><TH>Description</TH></TR> <TR><TD VALIGN="TOP"><TT> <TT>enum { id = SYMM, uplo = Uplo, M=0, N=0 } </TT></TD> <TD><FONT FACE=Times SIZE=3> </FONT></TD> <TD><FONT FACE=Times SIZE=3> </FONT></TD> </TR></TABLE></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>New members</B></FONT></TD></TR><TR><TD></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>Notes</B></FONT></TD></TR><TR><TD></TD></TR><TR><TD><IMG SRC="whitespace.gif" Alt="" WIDTH="32" HEIGHT="15" ALIGN="TOP"></TD></TR><TR BGCOLOR=#e0e0e0><TD VALIGN=BOTTOM><FONT FACE=arial,helvetica SIZE=+1><B>See also</B></FONT></TD></TR><TR><TD></TD></TR></TABLE><!--start footer--> <P><CENTER><CENTER><IMG SRC="./blue-bar.jpg" width=640></CENTER></CENTER><P><A HREF="http://www.nd.edu"><IMG BORDER=0 SRC="./ndtoclogo.gif" ALT="[MTL Home]" ALIGN=absmiddle></A></A><FONT SIZE="-2"><A HREF="../LICENSE.htm">Copyright ©1998,1999 University of Notre Dame. All Rights Reserved.</FONT></FONT></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -