# OpenGraph DrawingFramework

v.2012.07

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.

## Macros

#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.
#define OGDF_ARRAY_H

## Functions

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

## Detailed Description

Declaration and implementation of Array class and Array algorithms.

This file is part of the Open Graph Drawing Framework (OGDF).
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; see the file LICENSE.txt included in the packaging of this file for details.
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.
http://www.gnu.org/copyleft/gpl.html

Definition in file Array.h.

## Macro Definition 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;
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 84 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 93 of file Array.h.

 #define OGDF_ARRAY_H

Definition at line 50 of file Array.h.