1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>MTXRowCol</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">MTXRowCol</H1> 12<H2 align="left">C Specification</H2> 13<BLOCKQUOTE><CODE><CODE>#include <revolution/mtx.h></CODE></CODE></BLOCKQUOTE> 14<BLOCKQUOTE><CODE><CODE>#define MTXRowCol(m,r,c) ((m)[(r)][(c)])</CODE></CODE></BLOCKQUOTE> 15<H2 align="left">Arguments</H2> 16<DIV align="left"> 17<TABLE border="1" cellpadding="3" cellspacing="0.1"> 18 <TBODY> 19 <TR> 20<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>m</EM></STRONG></CODE></TD> 21<TD width="520" valign="top" align="left"><A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></A> to be accessed.</TD> 22 </TR> 23 <TR> 24<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>r</EM></STRONG></CODE></TD> 25<TD width="520" valign="top" align="left">Row index of the element to be accessed. </TD> 26 </TR> 27 <TR> 28<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>c</EM></STRONG></CODE></TD> 29<TD width="520" valign="top" align="left">Column index of the element to be accessed. </TD> 30 </TR> 31 </TBODY> 32</TABLE> 33</DIV> 34<H2 align="left">Return Values</H2> 35<P align="left">None.</P> 36<H2 align="left">Description</H2> 37<P align="left">This macro provides storage-safe access to elements of <A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></A> and <A href="../structures/Mtx44_Mtx44Ptr.html"><CODE>Mtx44</CODE></A>. Matrix storage format is transparent to the programmer as long as matrices are initialized and manipulated exclusively with the <code>MTX API</code>. Since matrix storage format may change in the future, it is dangerous to access matrix elements explicitly. Do not initialize matrices when they are first declared and do not set values programmatically. To insulate code from changes to matrix storage format, you should use this macro instead of directly accessing individual matrix elements. If matrix storage format changes in the future, this macro will be redefined.</P> 38<P align="left">When using <code>MTXRowCol</code>, think of the matrix in row-major format.</P> 39<P align="left"><code>MTXRowCol</code> may be used in both 'get' and 'set' operations. For example, to get the value stored in row 2, column 1 of a matrix <code><em><strong>m</strong></em></code>:</P> 40<BLOCKQUOTE><CODE>val = MTXRowCol( m, 2, 1 );</CODE></BLOCKQUOTE> 41<P align="left">To store a value in row 2, column 1 of a matrix <code><strong><em>m</em></strong></code>:</P> 42<BLOCKQUOTE><CODE>MTXRowCol( m, 2, 1 ) = val;</CODE></BLOCKQUOTE> 43 44 45<H2 align="left">See Also</H2> 46<H2>Revision History</H2> 47<P>2006/03/01 Initial version.</P> 48<hr> 49<P>CONFIDENTIAL</p> 50</BODY> 51</HTML>