Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::Array2D< E > Class Template Reference

The parameterized class Array2D<E> implements dynamic two-dimensional arrays. More...

#include <Array2D.h>

List of all members.

Public Member Functions

 Array2D ()
 Creates a two-dimensional array with empty index set.
 Array2D (int a, int b, int c, int d)
 Creates a two-dimensional array with index set [a..b]*[c..d].
 Array2D (int a, int b, int c, int d, const E &x)
 Creates a two-dimensional array with index set [a..b]*[c..d] and initailizes all elements with x.
 Array2D (const Array2D< E > &array2)
 Creates a two-dimensional array that is a copy of A.
 ~Array2D ()
int low1 () const
 Returns the minimal array index in dimension 1.
int high1 () const
 Returns the maximal array index in dimension 1.
int low2 () const
 Returns the minimal array index in dimension 2.
int high2 () const
 Returns the maximal array index in dimension 2.
int size () const
 Returns the size (number of elements) of the array.
int size1 () const
 Returns the length of the index interval (number of entries) in dimension 1.
int size2 () const
 Returns the length of the index interval (number of entries) in dimension 2.
float det ()
 Returns the determinant of the matrix.
const E & operator() (int i, int j) const
 Returns a reference to the elment with index (i,j).
E & operator() (int i, int j)
 Returns a reference to the elment with index (i,j).
void init ()
 Reinitializes the array to an array with empty index set.
void init (int a, int b, int c, int d)
 Reinitializes the array to an array with index set [a..b]*[c,d].
void init (int a, int b, int c, int d, const E &x)
 Reinitializes the array to an array with index set [a..b]*[c,d] and initializes all entries with x.
Array2D< E > & operator= (const Array2D< E > &array2)
 Assignment operator.
void fill (const E &x)
 Sets all elements to x.

Private Member Functions

void construct (int a, int b, int c, int d)
void initialize ()
void initialize (const E &x)
void deconstruct ()
void copy (const Array2D< E > &array2)

Private Attributes

E * m_vpStart
 The virtual start of the array (address of A[0,0]).
int m_a
 The lowest index in dimension 1.
int m_lenDim2
 The number of elements in dimension 2.
E * m_pStart
 The real start of the array (address of A[low1,low2]).
E * m_pStop
 Successor of last element (address of A[high1,high2+1]).
int m_b
 The highest index in dimension 1.
int m_c
 The lowest index in dimension 2.
int m_d
 The highest index in dimension 2.


Detailed Description

template<class E>
class ogdf::Array2D< E >

The parameterized class Array2D<E> implements dynamic two-dimensional arrays.

Definition at line 68 of file Array2D.h.


Constructor & Destructor Documentation

template<class E>
ogdf::Array2D< E >::Array2D (  )  [inline]

Creates a two-dimensional array with empty index set.

Definition at line 74 of file Array2D.h.

template<class E>
ogdf::Array2D< E >::Array2D ( int  a,
int  b,
int  c,
int  d 
) [inline]

Creates a two-dimensional array with index set [a..b]*[c..d].

Definition at line 77 of file Array2D.h.

template<class E>
ogdf::Array2D< E >::Array2D ( int  a,
int  b,
int  c,
int  d,
const E &  x 
) [inline]

Creates a two-dimensional array with index set [a..b]*[c..d] and initailizes all elements with x.

Definition at line 82 of file Array2D.h.

template<class E>
ogdf::Array2D< E >::Array2D ( const Array2D< E > &  array2  )  [inline]

Creates a two-dimensional array that is a copy of A.

Definition at line 87 of file Array2D.h.

template<class E>
ogdf::Array2D< E >::~Array2D (  )  [inline]

Definition at line 92 of file Array2D.h.


Member Function Documentation

template<class E>
int ogdf::Array2D< E >::low1 (  )  const [inline]

Returns the minimal array index in dimension 1.

Definition at line 97 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::high1 (  )  const [inline]

Returns the maximal array index in dimension 1.

Definition at line 100 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::low2 (  )  const [inline]

Returns the minimal array index in dimension 2.

Definition at line 103 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::high2 (  )  const [inline]

Returns the maximal array index in dimension 2.

Definition at line 106 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::size (  )  const [inline]

Returns the size (number of elements) of the array.

Definition at line 109 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::size1 (  )  const [inline]

Returns the length of the index interval (number of entries) in dimension 1.

Definition at line 112 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::size2 (  )  const [inline]

Returns the length of the index interval (number of entries) in dimension 2.

Definition at line 115 of file Array2D.h.

template<class E>
float ogdf::Array2D< E >::det (  )  [inline]

Returns the determinant of the matrix.

Note:
use only for square matrices and floating point values

Definition at line 272 of file Array2D.h.

template<class E>
const E& ogdf::Array2D< E >::operator() ( int  i,
int  j 
) const [inline]

Returns a reference to the elment with index (i,j).

Definition at line 122 of file Array2D.h.

template<class E>
E& ogdf::Array2D< E >::operator() ( int  i,
int  j 
) [inline]

Returns a reference to the elment with index (i,j).

Definition at line 128 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::init (  )  [inline]

Reinitializes the array to an array with empty index set.

Definition at line 134 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::init ( int  a,
int  b,
int  c,
int  d 
) [inline]

Reinitializes the array to an array with index set [a..b]*[c,d].

Definition at line 137 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::init ( int  a,
int  b,
int  c,
int  d,
const E &  x 
) [inline]

Reinitializes the array to an array with index set [a..b]*[c,d] and initializes all entries with x.

Definition at line 144 of file Array2D.h.

template<class E>
Array2D<E>& ogdf::Array2D< E >::operator= ( const Array2D< E > &  array2  )  [inline]

Assignment operator.

Definition at line 151 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::fill ( const E &  x  )  [inline]

Sets all elements to x.

Definition at line 158 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::construct ( int  a,
int  b,
int  c,
int  d 
) [inline, private]

Definition at line 188 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::initialize (  )  [inline, private]

Definition at line 214 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::initialize ( const E &  x  )  [inline, private]

Definition at line 230 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::deconstruct (  )  [inline, private]

Definition at line 246 of file Array2D.h.

template<class E>
void ogdf::Array2D< E >::copy ( const Array2D< E > &  array2  )  [inline, private]

Definition at line 257 of file Array2D.h.


Member Data Documentation

template<class E>
E* ogdf::Array2D< E >::m_vpStart [private]

The virtual start of the array (address of A[0,0]).

Definition at line 165 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::m_a [private]

The lowest index in dimension 1.

Definition at line 166 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::m_lenDim2 [private]

The number of elements in dimension 2.

Definition at line 167 of file Array2D.h.

template<class E>
E* ogdf::Array2D< E >::m_pStart [private]

The real start of the array (address of A[low1,low2]).

Definition at line 168 of file Array2D.h.

template<class E>
E* ogdf::Array2D< E >::m_pStop [private]

Successor of last element (address of A[high1,high2+1]).

Definition at line 169 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::m_b [private]

The highest index in dimension 1.

Definition at line 170 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::m_c [private]

The lowest index in dimension 2.

Definition at line 171 of file Array2D.h.

template<class E>
int ogdf::Array2D< E >::m_d [private]

The highest index in dimension 2.

Definition at line 172 of file Array2D.h.


The documentation for this class was generated from the following file:

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:07 2007 by doxygen 1.5.4.