Array classes

Header file array.h

A major advantage of C++ over `traditional' programming languages is the ability to define array variables whose sizes are chosen at run time. The classes described here implement general array objects.

Extensive use is made of template classes, which are class definitions with arguments. For example, the generic array class can be used for arrays of any type of object. When an instance of the class is declared in a program, the type of object in an array is defined. This is illustrated in the examples below.

General array template

Definition
template  class Array
Data objects
int n; // number of elements in array
Methods

Arithmetic array template

Definition

General array template with stack space

Definition

General array template of named elements

Definition

General N-dimensional matrix template

Definition

N-dimensional arithmetic matrix template

Definition

N-dimensional arithmetic matrix template (fixed rank)

Definition

Subclasses of specific rank

2x2, 3x3, 3x1, 1x3, 4x4, 4x1, 1x4