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>MTXRowCol</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15 #include <revolution/mtx.h> 16 17 #define MTXRowCol(m,r,c) ((m)[(r)][(c)]) 18</pre></dd></dl> 19 20<H2>Arguments</H2> 21<TABLE class="arguments" border="1" > 22 <TBODY> 23 <TR> 24<TH><em><strong><code>m</code></strong></em> </TH> 25<TD><A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></A> type matrix to be accessed</TD> 26 </TR> 27 <TR> 28<TH>r</TH> 29<TD>Row index of the element to be accessed.</TD> 30 </TR> 31 <TR> 32<TH>c</TH> 33<TD>Column index of the element to be accessed.</TD> 34 </TR> 35 </TBODY> 36</TABLE> 37 38<H2>Return Values</H2> 39<P>None.</P> 40 41<H2>Description</H2> 42<P>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>. The matrix storage format is transparent to the programmer as long as matrices are initialized and manipulated exclusively with the MTX APIs. 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> 43<P>When using the <CODE>MTXRowCol</CODE> function, think of the matrix in row-major format.</P> 44<P>The <CODE>MTXRowCol</CODE> function may be used in both 'get' and 'set' operations. For example, the following shows how to get the value stored in row 2, column 1 of the <SPAN class="argument">m</SPAN> matrix.</P> 45<dl><dd><pre class="construction"> 46val = MTXRowCol( m, 2, 1 ); 47</pre></dd></dl> 48 49<P>The following shows how to store a value in row 2, column 1 of the <SPAN class="argument">m</SPAN> matrix.</P> 50<dl><dd><pre class="construction"> 51MTXRowCol( m, 2, 1 ) = val; 52</pre></dd></dl> 53 54<H2>See Also</H2> 55<P>None.</P> 56 57<H2>Revision History</H2> 58<P> 592006/03/01 Initial version.<br> 60</P> 61 62<hr><p>CONFIDENTIAL</p></body> 63</HTML>