| 12
 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
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 
 | <?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-PMT">
<title>About template types</title>
<para>
Some of the container types listed in this section are defined for
many base types. This is similar to templates in C++ and generics in
Ada, but it is implemented via preprocessor macros since the C language
cannot handle it. Here is the list of template types and the all base
types they currently support:
<glosslist>
<glossentry><glossterm>vector</glossterm><glossdef><para>
  Vector is currently defined for <type>igraph_real_t</type>,
  <type>long int</type> (long), <type>char</type> (char),
  <type>igraph_bool_t</type> (bool). The default is
  <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>matrix</glossterm><glossdef><para>
  Matrix is currently defined for <type>igraph_real_t</type>,
  <type>long int</type> (long), <type>char</type> (char),
  <type>igraph_bool_t</type> (bool). The default is
  <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>array3</glossterm><glossdef><para>
  Array3 is currently defined for <type>igraph_real_t</type>,
  <type>long int</type> (long), <type>char</type> (char),
  <type>igraph_bool_t</type> (bool). The default is
  <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>stack</glossterm><glossdef><para>
  Stack is currently defined for <type>igraph_real_t</type>,
  <type>long int</type> (long), <type>char</type> (char),
  <type>igraph_bool_t</type> (bool). The default is
  <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>double-ended queue</glossterm><glossdef><para>
  Dqueue is currently defined for <type>igraph_real_t</type>,
  <type>long int</type> (long), <type>char</type> (char),
  <type>igraph_bool_t</type> (bool). The default is
  <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>heap</glossterm><glossdef><para>
  Heap is currently defined for <type>igraph_real_t</type>,
  <type>long int</type> (long), <type>char</type> (char).
  In addition both maximum and minimum heaps are available.
  The default is the <type>igraph_real_t</type> maximum heap.
</para></glossdef></glossentry>
</glosslist>
</para>
<para>
The name of the base element (in parentheses) is added to the function
names, except for the default type.
</para>
<para>
Some examples: 
<itemizedlist>
<listitem><para>
  <type>igraph_vector_t</type> is a vector of
  <type>igraph_real_t</type> elements. Its functions are
  <function>igraph_vector_init</function>,
  <function>igraph_vector_destroy</function>,
  <function>igraph_vector_sort</function>, etc.
</para></listitem>
<listitem><para>
  <type>igraph_vector_bool_t</type> is a vector of
  <type>igraph_bool_t</type> elements, initialize it with
  <function>igraph_vector_bool_init</function>, destroy it with
  <function>igraph_vector_bool_destroy</function>, etc.
</para></listitem>
<listitem><para>
  <type>igraph_heap_t</type> is a maximum heap with
  <type>igraph_real_t</type> elements. The corresponding functions are
  <function>igraph_heap_init</function>,
  <function>igraph_heap_pop</function>, etc.
</para></listitem>
<listitem><para>
  <type>igraph_heap_min_t</type> is a minimum heap with
  <type>igraph_real_t</type> elements. The corresponding functions are
  called <function>igraph_heap_min_init</function>,
  <function>igraph_heap_min_pop</function>, etc. 
</para></listitem>
<listitem><para>
  <type>igraph_heap_long_t</type> is a maximum heap with <type>long
  int</type> elements. Its function have the
  <function>igraph_heap_long_</function> prefix.
</para></listitem>
<listitem><para>
  <type>igraph_heap_min_long_t</type> is a minimum heap containing
  <type>long int</type> elements. Its functions have the 
  <function>igraph_heap_min_long_</function> prefix.
</para></listitem>
</itemizedlist>
</para>
<para>
Note that the <link linkend="VECTOR">VECTOR</link> and the <link
linkend="MATRIX">MATRIX</link> macros can be used on <emphasis>all</emphasis>
vector and matrix types. 
</para>
</section>
 |