Matrix Class Function Manual (G-I) |
Purpose
To get an ASCII terxt from a Matrix_uch object at the requeste psition in the matrix. The result is stored in a String object.
Class
Matrix_uch
Usage
For class Matrix_uch
{String} ret = object.GETBIN2({int} argm1, {int} argm2, {int} argm3)
argm1 = request position row number
argm2 = request position column number
argm3 = number of values wanted (default = 1)
Example:
->a = [65 66 67 68 69
70].uchar() |
See also (class function)
getbin2, getbin4, getbin4f, getbin8
Purpose
To get a binary 2-byte short integer value from a Matrix_uch object at the requeste psition in the matrix. The result is stored in a vector object.
Class
Matrix_uch
Usage
For class Matrix_uch
{VecInt} ret = object.GETBIN2({int} argm1, {int} argm2, {int} argm3)
argm1 = request position row number
argm2 = request position column number
argm3 = number of values wanted (default = 1)
Example:
->a = [1 2 3 4 5 6 7 8] 2 3 |
See also (class function)
getbin2, getbin4, getbin4f, getbin8
Purpose
To get a binary 4-byte long integer value from a Matrix_uch object at the requeste psition in the matrix. The result is stored in a vector object.
Class
Matrix_uch
Usage
For class Matrix_uch
{VecInt} ret = object.GETBIN4({int} argm1, {int} argm2, {int} argm3)
argm1 = request position row number
argm2 = request position column number
argm3 = number of values wanted (default = 1)
Example:
->a = [1 2 3 4 5 6 7 8] 2 3 |
See also (class function)
getbin2, getbin4, getbin4f, getbin8
Purpose
To get a binary 4-byte floating point value from a Matrix_uch object at the requeste psition in the matrix. The result is stored in a vector object.
Class
Matrix_uch
Usage
For class Matrix_uch
{Vector} ret = object.GETBIN4F({int} argm1, {int} argm2, {int} argm3)
argm1 = request position row number
argm2 = request position column number
argm3 = number of values wanted (default = 1)
Example:
->a = [1 2 3 4 5 6 7 8] 2.000 3.000 |
See also (class function)
getbin2, getbin4, getbin4f, getbin8
Purpose
To get a binary 8-byte double precision floating point value from a Matrix_uch object at the requeste psition in the matrix. The result is stored in a vector object.
Class
Matrix_uch
Usage
For class Matrix_uch
{Vector} ret = object.GETBIN8({int} argm1, {int} argm2, {int} argm3)
argm1 = request position row number
argm2 = request position column number
argm3 = number of values wanted (default = 1)
Example:
->a = [1 2 3 4 5 6 7 8] 2.000 3.000 |
See also (class function)
getbin2, getbin4, getbin4f, getbin8
GETCOL
Purpose
To get column vector(s) from a matrix.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{Matrix} ret = object.GETCOL({int} argm1, {int} argm2)
For class Matrix_flt
{Matrix_flt} ret = object.GETCOL({int} argm1, {int} argm2)
For class Matrix_int
{Matrix_int} ret = object.GETCOL({int} argm1, {int} argm2)
For class Matrix_sht
{Matrix_sht} ret = object.GETCOL({int} argm1, {int} argm2)
For class Matrix_uch
{Matrix_uch} ret = object.GETCOL({int} argm1, {int} argm2)
For class Matrix_bln
{Matrix_bln} ret = object.GETCOL({int} argm1, {int} argm2)
argm1 = start column number
argm2 = end column number (default = same value as argm1)
Example:
->a = [ 1 2 3; 4 5 6; 7 8 9 ] ->c = a.getcol(0) ->print c |
See also (class function)
getrow, window
Purpose
To get row vector(s) from a matrix.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{Matrix} ret = object.GETROW({int} argm1, {int} argm2)
For class Matrix_flt
{Matrix_flt} ret = object.GETROW({int} argm1, {int} argm2)
For class Matrix_int
{Matrix_int} ret = object.GETROW({int} argm1, {int} argm2)
For class Matrix_sht
{Matrix_sht} ret = object.GETROW({int} argm1, {int} argm2)
For class Matrix_uch
{Matrix_uch} ret = object.GETROW({int} argm1, {int} argm2)
For class Matrix_bln
{Matrix_bln} ret = object.GETROW({int} argm1, {int} argm2)
argm1 = start row number
argm2 = end row number (default = same value as argm1)
Example:
->a = [ 1 2 3; 4 5 6; 7 8 9 ] ->c = a.getrow(0) ->print c |
See also (class function)
getcol, window
Purpose
To get a value of an element at a particular index in a Matrix. The matrix must be virtually loaded, by using a function "vload".
Function "vload" does not really load data into memory, therefore, this function simply go to the required position and read data directly from the file.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{double} ret = object.GOGET({int} argm1, {int} argm2)
For class Matrix_flt
{float} ret = object.GOGET({int} argm1, {int} argm2)
For class Matrix_int
{int} ret = object.GOGET({int} argm1, {int} argm2)
For class Matrix_sht
{short} ret = object.GOGET({int} argm1, {int} argm2)
For class Matrix_uch
{uchar} ret = object.GOGET({int} argm1, {int} argm2)
For class Matrix_bln
{bool} ret = object.GOGET({int} argm1, {int} argm2)
argm1 = row number
argm2 = column number
Example:
->a = A.goget(20,360) -> |
See also (class function)
goset, gosetmat
Purpose
To set a value of an element at a particular index in a Matrix. The matrix must be virtually loaded, by using a function "vload".
Function "vload" does not really load data into memory, therefore, this function simply go to the required position and write data directly to the file.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{void} object.GOSET({int} argm1, {int} argm2, {double} argm3)
For class Matrix_flt
{void} object.GOSET({int} argm1, {int} argm2, {float} argm3)
For class Matrix_int
{void} object.GOSET({int} argm1, {int} argm2, {int} argm3)
For class Matrix_sht
{void} object.GOSET({int} argm1, {int} argm2, {short} argm3)
For class Matrix_uch
{void} object.GOSET({int} argm1, {int} argm2, {uchar} argm3)
For class Matrix_bln
{void} object.GOSET({int} argm1, {int} argm2, {bool} argm3)
argm1 = row number
argm2 = column number
argm3 = a new value set at the particular index
Example:
->A.goset(20,360, 999.999) -> |
See also (class function)
goget, gosetmat
Purpose
To set new values of elements in a particular portion in a Matrix. An index at which the upper left corner of the sub-matrix to be placed is specified by the user. The calling matrix must be virtually loaded, by using a function "vload".
Function "vload" does not really load data into memory, therefore, this function simply go to the required positions and write data directly to the file.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{void} object.GOSETMAT({int} argm1, {int} argm2, {Matrix} argm3)
For class Matrix_flt
{void} object.GOSETMAT({int} argm1, {int} argm2, {Matrix_flt} argm3)
For class Matrix_int
{void} object.GOSETMAT({int} argm1, {int} argm2, {Matrix_int} argm3)
For class Matrix_sht
{void} object.GOSETMAT({int} argm1, {int} argm2, {Matrix_sht} argm3)
For class Matrix_uch
{void} object.GOSETMAT({int} argm1, {int} argm2, {Matrix_uch} argm3)
For class Matrix_bln
{void} object.GOSETMAT({int} argm1, {int} argm2, {Matrix_bln} argm3)
argm1 = row number of a point at which the upper left window is located
argm2 = column number of a point at which the upper left window is located
argm3 = a matrix whose values is to be copied onto the calling matrix
Example:
->a = [ 1 2 3; 4 5 6; 7 8 9] ->a.save("mat_1") ->a.vload("mat_1") Matrix virtually loaded... ->b = [10 20; 30 40] ->print b no of row
: 2 ->a.gosetmat(1,1,b) ->a.load("mat_1")
->print a |
See also (class function)
goget, goset
Purpose
To perform a histogram matching.
The function requires one argument, a matrix to which the histogram of the original matrix, the calling matrix, to be matched. The result is a lookup table, stored as a VecIndx object, in which the first number is the value of the original matrix and the second number is the new value that will match the value of the second matrix, in order to make the histogram of the original matrix look like that of the second matrix.
The result VecIndx object can be used directly in the function "lookup", where a new matrix will be created according to the lookup table using original matrix values.
Class
Matrix_int, Matrix_sht, Matrix_uch
Usage
{VecIndx} ret = object.HISTMATCH({Matrix_uch} argm1)
argm1 = matrix whose histogram being matched by the calling matrix
Example:
->a = [ 1 2 3; 4
5 6; 7 8 9].uchar() |
See also (class function)
reclass, reassign, lookup
Purpose
To create a histogram of a matrix.
The result is a three-column matrix, in which the first column are starting values of the binsand the second column are end values of the bin. The third column are cumulative frequencies of each bin. The result can be later exported to an ASCII file so that a histogram plot can be generated by a general graphic-displayable program.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
{Matrix} ret = object.HISTO([{double} argm1, {double} argm2, {double} argm3])
argm1 = start value of bins (default = minimum value)
argm2 = end value of bins (default = maximum value)
argm3 = bin size (default = a size that generates 10 bins)
Example:
->a = [ 1 2 4; 2
3 5; 7 7 9] |
remark : The interpretation of the above example is as follows. The first row ( 1 4 4) means there are 4 elements that are greater or equal to 1 and less than 4. The second row ( 4 7 2) means there are 2 elements that are greater or equal to 4 and less than 7. The third row ( 7 10 3) means there are 3 elements that are greater or equal to 7 and less than 10.
See also (class function)
reclass, reassign
Purpose
To calculate a two-dimensional Inverse Fourier transform of a matrix. The number of rows and number of columns of the matrix must be of 2n. If not, the function will pad zero rows or zero columns, so that its size is of 2n.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
{Matrix_cmp} ret = object.IFT()
Example:
->a = [ 1 2 ; 3
4] ->b = a.fft()
->print b ->c = b.ift()
->print c |
See also (class function)
fft
Purpose
To initialize a Matrix object, to have a specified size and an initial value.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{void} object.INIT({int} argm1, {int} argm2, {double} argm3)
For class Matrix_flt
{void} object.INIT({int} argm1, {int} argm2, {float} argm3)
For class Matrix_int
{void} object.INIT({int} argm1, {int} argm2, {int} argm3)
For class Matrix_sht
{void} object.INIT({int} argm1, {int} argm2, {short} argm3)
For class Matrix_uch
{void} object.INIT({int} argm1, {int} argm2, {uchar} argm3)
For class Matrix_bln
{void} object.INIT({int} argm1, {int} argm2, {bool} argm3)
argm1 = no of rows
argm2 = no of columns
argm3 = initial value (default = 0)
Example:
->A.init(3,2) ->print A no of row
: 3 |
See also (class function)
clear, set
Purpose
To initialize a block diagonal Matrix.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{void} object.INITBDIAG({int} argm1, {Matrix} argm2)
For class Matrix_flt
{void} object.INITBDIAG({int} argm1, {Matrix_flt} argm2)
For class Matrix_int
{void} object.INITBDIAG({int} argm1, {Matrix_int} argm2)
For class Matrix_sht
{void} object.INITBDIAG({int} argm1, {Matrix_sht} argm2)
For class Matrix_uch
{void} object.INITBDIAG({int} argm1, {Matrix_uch} argm2)
For class Matrix_bln
{void} object.INITBDIAG({int} argm1, {Matrix_bln} argm2)
argm1 = no of blocks
argm2 = initial value of the block diagonal elements
Example:
->A = [ 1 2 ; 3 4] ->B = Matrix() ->B.initbdiag(2,A) ->print B no of row
: 4 |
See also (class function)
initdiag, init
Purpose
To initialize a diagonal Matrix.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
For class Matrix
{void} object.INITDIAG({int} argm1, {double} argm2)
For class Matrix_flt
{void} object.INITDIAG({int} argm1, {float} argm2)
For class Matrix_int
{void} object.INITDIAG({int} argm1, {int} argm2)
For class Matrix_sht
{void} object.INITDIAG({int} argm1, {short} argm2)
For class Matrix_uch
{void} object.INITDIAG({int} argm1, {uchar} argm2)
For class Matrix_bln
{void} object.INITDIAG({int} argm1, {bool} argm2)
argm1 = no of diagonal elements
argm2 = initial value of diagonal elements
Example:
->B = Matrix() ->B.initdiag(4,8) ->print B no of row
: 4 |
See also (class function)
initbdiag, init
Purpose
To convert to a Matrix_int object.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
{Matrix_int} ret = object.INT()
Example:
->A = [ 1 2 3; 4
5 6; 7 8 9] |
See also (class function)
double, float, short, uchar, bool
Purpose
To compute an inverse matrix.
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
{Matrix} ret = object.INV()
Example:
->A = [ 1 2 ; 3 4] ->B = A.inv() ->print B no of row
: 2 |
See also (class function)
invbdiag, invdiag, tsp
Purpose
To calculate an inverse matrix of a block diagonal matrix. The computed time of this function is mush faster than an ordinary function "inv".
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
{Matrix} ret = object.INVBDIAG({int} argm1)
argm1 = size of the block diagonal matrix
Example:
->A = [ 1 2; 3 4] |
See also (class function)
inv, invdiag, tsp
Purpose
To calculate an inverse matrix of a diagonal matrix. The computed time of this function is mush faster than an ordinary function "inv".
Class
Matrix, Matrix_flt, Matrix_int, Matrix_sht, Matrix_uch, Matrix_bln
Usage
{Matrix} ret = object.INVDIAG()
Example:
->A = [5 0 0; 0 4
0; 0 0 9] |
See also (class function)
inv, invbdiag, tsp