Math Object Summary#

Description#

This section briefly summarizes the use of math objects which are available to the ZebFront program modules. These classes aid the mathematical programming greatly, and are at least partially mandatory in that all input and output variables are stored with these objects. The use of high-level utility classes is very beneficial to the program longevity because it hides implementation assumptions. The main developers may thus optimize personal code without ever touching the source. In fact, this principle applies to the ZebFront methodology at every level.

CODE

DESCRIPTION

VECTOR

Array of double storage to be used as general vector storage; vectors may be of any size, but do support some methods of a first order tensor

MATRIX

basic matrix class

SMATRIX

square matrix class with some methods for a fourthorder tensor

TENSOR2

second order tensor class

ARRAY<T>

template for a list of objects; size must be given

DARRAY<T>

double dimensioned array template

LIST<T>

single dimensioned array which may be added to dynamically

Size checking

All objects verify the size equality between objects at each function or operator call when the program is compiled in debug mode. For example, to use an equality operator between two objects A and B, the size attributes of both A and B must be equal. Sizes may always be adjusted using the resize methods. The syntax of a resize method always parallels the creator syntax.

Creators

Objects usually may be created as local variables without parameters, with a size attribute, or with using another object of the same type.

Indexing

The method of indexing differs between single dimension and two dimension entities. Single dimension entities VECTOR, TENSOR2, ARRAY<T>, and LIST<T> are accessed using the [ ] operator as a normal C vector. Double dimensioned objects use the form (i,j) where i and j are integers. This operators are defined inline, and are thus as efficient as direct pointer access. The indexing implements bounds checking however in debug mode.

Sub-objects

Math objects VECTOR, TENSOR2, and MATRIX may be sub-entities of another math object. Sub-objects may be attached in their creation, or using the reassign method. The syntax for all objects follows the same convention for both the creator and the reassign methods. This dictates that the first parameters of the method begins with the size attribute as in the standard creator. The following parameter is the object which is being attached onto, and the final parameters are the location in the “host” object.

Some basic operators are summarized below:

CODE

DESCRIPTION

!

Size-of operator; returns tensor / vector / array sizes

^

Outside or cross product; two tensors multiplied returns a SMATRIX

|

Contracted product; returns a scalar