Setting the Matrix Size
Methods to Get and Set Values
Matrix Match Methods
- add-scalar
- add-values
- compute-diffusion-matrix
- compute-periodic-diffusion-matrix
- copy
- get-absolute-sum
- multiply-with-values
- scale
- subtract-values
- transform
Methods for using Displaying Matrices
Adds the number scalarValue to each element in the matrix.
Adds this matrix to otherMatrix leaving the result in otherMatrix. The matrices must be of the same size. The optional argument scale allows otherMatrix to be scaled before adding it to this matrix.
This method is hardware accelerated where supported.
Sets the contents of this matrix to a diffusion rate from the matrix chemicalMatrix. chemicalMatrix is treated as a matrix of spatial chemical concentrations, and the resulting diffusion matrix gives the approximate rates of diffusion of the chemical.
This is done by sampling each concentration's local neighborhood according to the following matrix:
0 1 0 1 -4 1 0 1 0chemicalMatrix is assumed to have real boundary conditions so that the chemical will not flow beyond the edges of the matrix.
The optional scale argument may be used to scale the resulting scale matrix.
Sets the contents of this matrix to a diffusion rate from the matrix chemicalMatrix. chemicalMatrix is treated as a matrix of spatial chemical concentrations, and the resulting diffusion matrix gives the approximate rates of diffusion of the chemical.
This is done by sampling each concentration's local neighborhood according to the following matrix:
0 1 0 1 -4 1 0 1 0chemicalMatrix is assumed to have periodic boundary conditions so that the chemical will flow freely from the edges of the matrix to the other side.
The optional scale argument may be used to scale the resulting scale matrix.
Copies the contents of otherMatrix to thisMatrix.
This method is hardware accelerated where supported.
Copies the contents of this matrix to the blue channel of theImage. The optional argument scale specifies how the matrix elements should be scaled.
This method, and it's counterparts copy-to-red-channel and copy-to-green-channel are far faster than looping manually through the matrix values.
Copies the contents of this matrix to the green channel of theImage. The optional argument scale specifies how the matrix elements should be scaled.
This method, and it's counterparts copy-to-blue-channel and copy-to-red-channel are far faster than looping manually through the matrix values.
Copies the contents of this matrix to the red channel of theImage. The optional argument scale specifies how the matrix elements should be scaled.
This method, and it's counterparts copy-to-green-channel and copy-to-blue-channel are far faster than looping manually through the matrix values.
Returns the sum of the absolute values of all elements in this matrix.
This method is hardware accelerated where supported.
Returns the matrix value at position (x, y).
Returns the x size of this matrix.
Returns the y size of this matrix.
sets the size to of this matrix to (sSize, ySize).
Multiplies each element in this matrix with the corresponding element in otherMatrix. This is not regular matrix multiplication; rather, it is a way to scale each element in otherMatrix.
Prints the matrix in a style similar to MATLAB.
Scales all elements in the matrix by scaleValue.
This method is hardware accelerated where supported.
Sets all of the values in the matrix to value.
Sets the size of this matrix to (xSize, ySize).
Sets the matrix value at position (x, y).
Subtracts this matrix from this otherMatrix, leaving the result in otherMatrix. This method uses the same mechanism as add, but using a negative scale argument. The optional argument scale allows otherMatrix to be scaled before subtracting it from this matrix.
This method is hardware accelerated where supported.
Transforms this Vector with the Matrix2D matrix, storing the output in result.