vtf-logo

ads::ArrayIndexingBase< 1 > Class Template Reference

The indexing interface to 1-D arrays. Independent of the value type. More...

#include <ArrayIndexingBase1.h>

Inheritance diagram for ads::ArrayIndexingBase< 1 >:

ads::ArrayIndexing< 1, T > ads::Array< 1, T, A > List of all members.

Public Types

typedef int size_type
 The size type is a signed integer.
typedef FixedArray< 1, int > index_type
 A multi-index for compatibility with higher dimensional arrays.
typedef IndexRange< 1, int > range_type
 A range of indices.

Public Member Functions

Accessors
index_type extents () const
 Return the extents of the array.
size_type extent (const int) const
 Return the $ i^{th} $ extent of the array.
const range_typeranges () const
 Return the index ranges of the array.
const index_typelbounds () const
 Return the index lower bounds.
const index_typeubounds () const
 Return the index upper bounds.
int lbound (const int i) const
 Return the $ i^{th} $ lower bound.
int ubound (const int i) const
 Return the $ i^{th} $ upper bound.
index_type strides () const
 Return the strides between elements in each dimension.
Accessors, specialized for 1-D.
const range_typerange () const
 Return the index range.
int lbound () const
 Return the lower bound on the index range.
int ubound () const
 Return the upper bound on the index range.
Accessors: Convert between a container index and a multi-index.
int index (const index_type &mi) const
 Convert a multi-index to a container index.
int index (const int i0) const
 Convert a multi-index to a container index.
void index_to_indices (int index, int &i) const
 Convert a container index to a "multi-index" in a 1-D array.
void index_to_indices (int index, ads::FixedArray< 1, int > &multi_index) const
 Convert a container index to a multi-index in a 1-D array.
File I/O
void put (std::ostream &out) const
 Write the range to a file stream in ascii format.
void write (std::ostream &out) const
 Write the range to a file stream in binary format.
Equality.
bool operator== (const ArrayIndexingBase &x) const
 Return true if the ranges are the same.

Static Public Member Functions

Static members.
static int rank ()
 Return the rank (number of dimensions) of the array.

Protected Member Functions

Constructors etc.
 ArrayIndexingBase ()
 Default constructor. Empty range.
 ArrayIndexingBase (const ArrayIndexingBase &x)
 Copy constructor.
ArrayIndexingBaseoperator= (const ArrayIndexingBase &x)
 Assignment operator.
 ArrayIndexingBase (const index_type &extent)
 Construct given the extent.
void rebuild (const index_type &extent)
 Rebuild given the extent.
 ArrayIndexingBase (const size_type size)
 Construct given the size.
void rebuild (const size_type size)
 Rebuild given the size.
 ArrayIndexingBase (const range_type &range)
 Construct given the index range.
void rebuild (const range_type &range)
 Rebuild given the index range.
void swap (ArrayIndexingBase &x)
 Swaps data with another ArrayIndexingBase.
 ~ArrayIndexingBase ()
 Destructor.

Detailed Description

template<>
class ads::ArrayIndexingBase< 1 >

The indexing interface to 1-D arrays. Independent of the value type.


Member Typedef Documentation

typedef int ads::ArrayIndexingBase< 1 >::size_type

The size type is a signed integer.

Having std::size_t (which is an unsigned integer) as the size type causes minor problems. Consult "Large Scale C++ Software Design" by John Lakos for a discussion of using unsigned integers in a class interface.

Reimplemented in ads::Array< 1, T, A >, and ads::ArrayIndexing< 1, T >.


The documentation for this class was generated from the following file:
Generated on Fri Aug 24 12:55:38 2007 for Algorithms and Data Structures Package by  doxygen 1.4.7