<<<<<<<<<<<<<<<<<

matrix(arrays) Arrays matrix(arrays)

NAME

matrix - a two dimensional floating point matrix

DESCRIPTION

An object providing floating point matrix type storage for LYMB scripts

SUPERCLASS

object

INSTANCE VARIABLES

n The first dimension of a matrix.

m The second dimension of a matrix.

matrix The matrix of an instance. Matrix is stored as a pointer to vector of pointers pointing to the matrix rows.

MESSAGES

m? Returns the value of m.

= argument Sets matrix value to argument. Argument can be either a list of numbers, in this case their number should be equal to n*m, or it can be a triple: a pointer to matrix (float**) followed by values of n and m. This method copies a matrix into an instance.

? Returns pointer to matrix (float**) and values of n and m.

n? Returns value of n.

nm= (arg1, arg2) Sets the values of n and m to arg1 and arg2 correspondingly.

nm? Returns values of n and m.

pointer= (arg1, arg2, arg3) Sets the value of matrix pointer to arg1, n to arg2, and m to arg3. Arg1 should be of type float**. This method does not perform copying of the matrix.

EXAMPLE

matrix new: `a' nm= (2,2) = (1,2,3,4);

matrix new: `b' nm= (2,2) = a print!; matrix new: `c' nm= (2,2) pointer= a print!; -- changing a a = (2,3,4,5) print!; -- c points to the same matrix c print!; -- but b is not changed because it was a copy b print!;

SEE ALSO

long, pointer, dmatrix, imatrix, fvector, ivector, dvector


Please send comments and suggestions to
consult@rpi.edu