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
|
<HTML>
<HEAD>
<TITLE>TSP (libtsp/MA) - MAfAllocMat</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>MAfAllocMat</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
float **MAfAllocMat (int Nrow, int Ncol)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Allocate a matrix of float values
</DL>
<H4>Description</H4>
This routine allocates a matrix of float values. The returned value is
a pointer to an array of pointers to the rows of the matrix. The calling
routine can treat the returned value as a two-dimensional matrix of float
values. Consider the invocation
<PRE>
float **A;
int Nrow, Ncol;
...
A = MAfAllocMat (Nrow, Ncol);
</PRE>
Then A[i][j] is a matrix of float values for 0 <= i < Nrow and
0 <= j < Ncol. The routine MAfAllocMat allocates an array of Nrow pointers
and a contiguous block of memory sufficient to hold the Nrow*Ncol float
values. Each pointer is initialized to point to a row of the matrix. A[0]
is a pointer to the first row (Ncol float values) (and to the full matrix of
Nrow*Ncol float values). A[1] points to the next row (Ncol elements beyond
A[0]), and so on.
<P>
The space allocated by this routine should be deallocated using the routine
MAfFreeMat.
<H4>Parameters</H4>
<DL>
<DT>
<- float **MAfAllocMat
<DD>
Returned pointer to array of row pointers
<DT>
-> int Nrow
<DD>
Number of rows for the matrix
<DT>
-> int Ncol
<DD>
Number of elements in each row (number of columns)
</DL>
<H4>Author / revision</H4>
P. Kabal Copyright (C) 1995
/ Revision 1.6 1995/06/08
<H4>See Also</H4>
<A HREF="MAdAllocMat.html">MAdAllocMat</A>,
<A HREF="MAfFreeMat.html">MAfFreeMat</A>,
<A HREF="MAfSubMat.html">MAfSubMat</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>
|