AForm Class Reference
An Array, a Slice, or a Frame.
More...
#include <array.h>
Enumerated Scalars
|
Form_Class
| : { ARRAY_CLASS, SLICE_CLASS, FRAME_CLASS } |
|
|
Descriptive Types
|
AForm
| : union { Array; Slice; Frame } |
|
|
|
|
APart
| : union { Array; Slice } |
|
|
Routines
Detailed Description
Arrays, Slices, and Frames are all "array-like" in that they represent an n-dimensional
lattice of values of a given type and scale, where the inner or outer dimension may have
a special interpretation depending on the objects kind. An AForm represents the union
of these three types of objects, and this page describes the routines common to an AForm
object.
Most routines in the Mylib library that take an Array as a read-only argument can
equally well operate on a Slice or Frame, and indeed most routines in the library will accept
an AForm in such cases. Other routines that only modify the elements of the array, but not
the shape, type, scale, etc., can equally well take a Slice (but not a Frame as its window
may not be withiin its underlying array), and so to distinguish that case, the APart
type is the union of an Array and a Slice.
The are routines AForm_Class, Is_Slice, Is_Frame, and Is_Array can all be used
to distinguish which type of object an AForm happens to be. Same_Shape and Same_Type
determine if two array forms have the same shape and type. The size, kind, and shape of
an array form are returned by AForm_Size, AForm_Kind, AForm_Shape. Lastly the
underlying array for an array form is returned by AForm_Array. If the array form is
an Array then it is returned (as it is its own "underlying array").
Enumerated Scalars Documentation
Form_Class | : { ARRAY_CLASS, SLICE_CLASS, FRAME_CLASS } |
The three "classes" of objects that an AForm can be.
Routine Documentation
Returns the Form_Class value that identifies the class form belongs to.
boolean |
Is_Slice (AForm *form) |
Return true if and only if form is a Slice.
boolean |
Is_Frame (AForm *form) |
Return true if and only if form is a Frame.
boolean |
Is_Array (AForm *form) |
Return true if and only if form is an Array.
Return a pointer to the underlying array of form. For an array this is
the array itself.
Return the number of elements in the shape of form.
Return the AForm_Class value that identifies which class of object form is.
Generate a coordinate that models the shape of the object form. For frames notice
that while the coordinate is the same as that returned by Frame_Shape, there is the
subtle difference that the later is owned by the Frame whereas the result of this
routine is a newly generated Coordinate, i.e. it is equivalent to
Copy_Array(Frame_Shape(form)).
Return true if and only the shape of a and b are the same.
Return true if and only the shape and the type of a and b are the same.
|