File: MAdAllocMat.html

package info (click to toggle)
libtsp 3r0-1
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 5,096 kB
  • ctags: 1,798
  • sloc: ansic: 14,464; sh: 1,217; makefile: 182
file content (64 lines) | stat: -rw-r--r-- 1,752 bytes parent folder | download
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
<HTML>
<HEAD>
<TITLE>TSP (libtsp/MA) - MAdAllocMat</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>MAdAllocMat</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
double **MAdAllocMat (int Nrow, int Ncol)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Allocate a matrix of double values
</DL>
<H4>Description</H4>
This routine allocates a matrix of double 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 double
values.  Consider the invocation
<PRE>
  double **A;
  int Nrow, Ncol;
  ...
  A = MAdAllocMat (Nrow, Ncol);
</PRE>
Then A[i][j] is a matrix of double values for 0 &lt;= i &lt; Nrow and
0 &lt;= j &lt; Ncol.  The routine MAdAllocMat allocates an array of Nrow pointers
and a contiguous block of memory sufficient to hold the Nrow*Ncol double
values.  Each pointer is initialized to point to a row of the matrix.  A[0]
is a pointer to the first row (Ncol double values) (and to the full matrix of
Nrow*Ncol double 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
MAdFreeMat.
<H4>Parameters</H4>
<DL>
<DT>
&lt;-  double **MAdAllocMat
<DD>
Returned pointer to array of row pointers
<DT>
 -&gt; int Nrow
<DD>
Number of rows for the matrix
<DT>
 -&gt; int Ncol
<DD>
Number of elements in each row (number of columns)
</DL>
<H4>Author / revision</H4>
P. Kabal  Copyright (C) 1995
/ Revision 1.5  1995/06/08
<H4>See Also</H4>
<A HREF="MAfAllocMat.html">MAfAllocMat</A>,
<A HREF="MAdFreeMat.html">MAdFreeMat</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>