CMatrixRow:Class Description


The CMatrixRow class manages a 1-dimensional array of elements that form each of the rows of a CMatrix object. The elements may be any kind of thing (number, string, object), although the CMatrix usually is implemented to hold numbers. CMatrixRow elements are referenced as numeric array indices, like [1] or [10000].

A CMatrixRow is sparse, meaning that there may be "holes" at indices where no value is defined. For example, you might define only one value at index 10000. Being sparse, this CMatrixRow requires storing only 1 value in memory, rather than 10000 elements with one defined value following 9999 other elements.

Usage

Construction

Object = CMatrixRow:new()

Destruction

Object:delete()

Construction

new

Creates a new instance of the CMatrixRow class. There are 3 constructor formats.

delete

Deletes the instance of the CMatrixRow object.

Copy

Copies this CMatrixRow to a new CMatrixRow

Operations

Count

Returns the number of members actually initialized.

Dot

Returns the dot product with another CMatrixRow.

Empty

Empties the contents of the CMatrixRow but does not delete it.

Exists

Returns true if a member exists at the index.

Get

Returns the member value at an array index.

Init

Initializes all members to a value.

MaxIndex

Returns the maximum member index.

Remove

Removes the member at an index.

Set

Sets the member value at an index.

Related Topics

Script Classes

CMatrix class