Open
Graph Drawing
Framework

 v.2010.10
 

Classes | Namespaces | Defines | Functions | Variables

Array.h File Reference

Declaration and implementation of Array class and Array algorithms. More...

#include <ogdf/basic/basic.h>

Go to the source code of this file.

Classes

class  ogdf::Array< E, INDEX >
 The parameterized class Array<E,INDEX> implements dynamic arrays of type E. More...

Namespaces

namespace  ogdf
 

The namespace for all OGDF objects.


Defines

#define forall_arrayindices(i, A)   for(i = (A).low(); i<=(A).high(); ++i)
 Iteration over all indices i of an array A.
#define forall_rev_arrayindices(i, A)   for(i = (A).high(); i>=(A).low(); --i)
 Iteration over all indices i of an array A, in reverse order.

Functions

template<class E , class INDEX >
void ogdf::print (ostream &os, const Array< E, INDEX > &a, char delim= ' ')
template<class E , class INDEX >
ostream & ogdf::operator<< (ostream &os, const ogdf::Array< E, INDEX > &a)

Variables

const size_t ogdf::maxSizeInsertionSort = 40

Detailed Description

Declaration and implementation of Array class and Array algorithms.

Author:
Carsten Gutwenger
License:
This file is part of the Open Graph Drawing Framework (OGDF).

Copyright (C). All rights reserved. See README.txt in the root directory of the OGDF installation for details.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 or 3 as published by the Free Software Foundation and appearing in the files LICENSE_GPL_v2.txt and LICENSE_GPL_v3.txt included in the packaging of this file.
In addition, as a special exception, you have permission to link this software with the libraries of the COIN-OR Osi project (http://www.coin-or.org/projects/Osi.xml), all libraries required by Osi, and all LP-solver libraries directly supported by the COIN-OR Osi project, and distribute executables, as long as you follow the requirements of the GNU General Public License in regard to all of the software in the executable aside from these third-party libraries.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See also:
http://www.gnu.org/copyleft/gpl.html

Definition in file Array.h.


Define Documentation

#define forall_arrayindices (   i,
  A 
)    for(i = (A).low(); i<=(A).high(); ++i)

Iteration over all indices i of an array A.

Note that the index variable i has to be defined prior to this macro (just as for forall_edges, etc.).

Example

   Array<double> A;
   ...
   int i;
   forall_arrayindices(i, A) {
     cout << A[i] << endl;
   }

Note that this code is equivalent to the following tedious long version

   Array<double> A;
   ...
   int i;
   for(i = A.low(); i <= A.high(); ++i) {
     cout << A[i] << endl;
   }

Definition at line 98 of file Array.h.

#define forall_rev_arrayindices (   i,
  A 
)    for(i = (A).high(); i>=(A).low(); --i)

Iteration over all indices i of an array A, in reverse order.

Note that the index variable i has to be defined prior to this macro (just as for forall_edges, etc.). See forall_arrayindices for an example

Definition at line 107 of file Array.h.