1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
<HTML>
<HEAD>
<TITLE>TSP (libtsp/MA) - MAfSubMat</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>MAfSubMat</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
float **MAfSubMat (const float *A[], int n, int m, int Nrow)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Set up pointers to a submatrix of a matrix of float values
</DL>
<H4>Description</H4>
This routine allocates an array of row pointers. These pointers access a
submatrix of a previously allocated matrix. The returned value is a pointer
to an array of pointers to the rows of the submatrix. The calling routine
can treat the returned value as a two-dimensional matrix of float values.
Consider the invocation
<PRE>
float **A;
float **sA;
...
A = MAfAllocMat (Nrow, Ncol);
sA = MAfSubMat ((const float **) A, n, m, Nrow-n);
... now sA[0][0] == A[n][m]
</PRE>
Then sA[i][j] is a matrix of float values for 0 <= i < N-n and
0 <= j < Ncol-m. The array of pointers to the submatrix should be
deallocated using the routine UTfree.
<H4>Parameters</H4>
<DL>
<DT>
<- float **MAfSubMat
<DD>
Returned pointer to array of row pointers for the submatrix
<DT>
-> const float *A[]
<DD>
A is an array of pointers to the rows of an N by N matrix. Note that
with ANSI C, if the actual parameter is not declared to have the const
attribute, an explicit cast to (const float **) is required.
<DT>
-> int n
<DD>
Index for the first row of the submatrix
<DT>
-> int m
<DD>
Index for the first column of the submatrix
<DT>
-> int Nrow
<DD>
Number of rows in the submatrix
</DL>
<H4>Author / revision</H4>
P. Kabal Copyright (C) 1995
/ Revision 1.6 1995/06/08
<H4>See Also</H4>
<A HREF="MAfAllocMat.html">MAfAllocMat</A>,
<A HREF="../UT/UTfree.html">UTfree</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>
|