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 |
---|---|
|
Array of |
|
basic matrix class |
|
square matrix class with some methods for a fourthorder tensor |
|
second order tensor class |
|
template for a list of objects; size must be given |
|
double dimensioned array template |
|
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
andB
, the size attributes of bothA
andB
must be equal. Sizes may always be adjusted using theresize
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>
, andLIST<T>
are accessed using the[ ]
operator as a normal C vector. Double dimensioned objects use the form(i,j)
wherei
andj
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
, andMATRIX
may be sub-entities of another math object. Sub-objects may be attached in their creation, or using thereassign
method. The syntax for all objects follows the same convention for both the creator and thereassign
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 |
|
Contracted product; returns a scalar |