﻿ BigMatrix Values 亚游ag骗局|官网,ag游戏庄闲|开户,ag赌神赛规则|官网

# BigMatrix Values, BigMatrixRowArray Values

The BigMatrix class implements an MxN matrix for situations and calculations where the usual 4x3 Matrix3 class is not adequate. The BigMatrixRowArray class implements an N element vector. Each row in a BigMatrix value is a BigMatrixRowArray value. Only Float values can be stored in the elements of a BigMatrixRowArray.

Constructors

BigMatrix

Properties

Operators

+

Both BigMatrix values must have same size

[]

Returns BigMatrixRowArray of indexed row

[]

Returns float value of indexed column

[] =

Sets value in the indexed column

Because accessors are themselves operands, these definitions are recursive, which means that you can string accessors together:

[][]

Returns float value of indexed row and column

[][] =

Sets value in the matrix

Methods

invert

Inverts the matrix in place, i.e., the input BigMatrix itself is modified. The return value is also the inverted matrix. Note that this method only works if this matrix is "square", i.e. if m = n.

transpose

Returns the transpose of <BigMatrix>, i.e. result BigMatrix[i][j] = BigMatrix[j][i].

clear

Frees all the elements and sets the matrix size to be 0x0

setSize

Deletes the current elements and sets the size of the matrix to rows x columns.

identity -- mapped function

If the number of rows and columns are equal, this method sets the matrix to the identity (diagonal elements = 1, all other elements = 0). If the number of rows and columns are not equal, it does nothing. If the parameter is an array of matrices, this function returns the value OK. In both cases, the input BigMatrix value(s) are set to the identity.

Notes

A BigMatrix object is a compound object, similar to an array of arrays. All of the BigMatrix methods operate directly on the components of the input BigMatrix. As described in Reference Assignment, this can cause complications to occur if a BigMatrix object referenced by more than one variable. If you assign a new value to an element of the matrix, or use any of the BigMatrix methods, the same object is still referenced by the variables. This can be seen in the following example.

Script

bm1=bigmatrix 2 2

for i=1 to 2 do for j=1 to 2 do bm1[i][j]=random 0 10

bm2=bm1

invert bm1

bm2

Output

#BigMatrix( -- result of line 1, contents of bm1

[0.00,0.00],

[0.00,0.00]

)

OK -- result of line 2

#BigMatrix( -- result of line 3, contents of bm2

[4.00,6.00],

[4.00,9.00]

)

#BigMatrix( -- result of line 4, contents of bm1

[0.75,-0.50],

[-0.33,0.33]

)

#BigMatrix( -- result of line 5, contents of bm2

[0.75,-0.50],

[-0.33,0.33]

)