Constructor
new MiniMat(data, x_len, y_lenopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Array.<Object> | an array containing all data, column major (column major order is like Octave and R) | |
x_len |
int | the number of columns. | |
y_len |
int |
<optional> |
the number of rows, default 1. |
- Source:
Classes
Methods
apply(fcn)
applies a function to each element
Parameters:
Name | Type | Description |
---|---|---|
fcn |
function | a function which replaces values of its input to its output. |
- Source:
col(index, to_indexopt)
Get a column or columns by index.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
index |
int | the first column index of the desired selection | |
to_index |
int |
<optional> |
the last column index of the desired selection. if to_index is unset or -1, only the index column is returned |
- Source:
col_set(index, data, to_index)
Set a columns data in place.
Parameters:
Name | Type | Description |
---|---|---|
index |
int | which column to change |
data |
Array.<Object> | the data to change the column to |
to_index |
int | the last column to change, if changing multiple columns. |
- Source:
diag()
Get the diagonal of the matrix
- Source:
elem_inv()
returns the elementwise inverse in place
- Source:
elementwise(mat, operation)
Perform an in-place elementwise operation on the matrix. This is an in place operation, so the object reference is changed, but the one passed is not.
Parameters:
Name | Type | Description |
---|---|---|
mat |
MiniMat | Another matrix to use for values for the operation |
operation |
function | a function which returns one value given two |
- Source:
json()
Get a JSON string from a matrix
- Source:
norm(lopt)
Return the matrix norm of a level passed in
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
l |
int |
<optional> |
2 | the matrix norm level to take, default 2. Can be inf or fro also. |
- Source:
normalize(rowvecsopt)
normalize by vectors
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rowvecs |
bool |
<optional> |
false | true to normalize on rows |
- Source:
row(index, to_indexopt)
Get a row or rows by index.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
index |
int | the first row index of the desired selection | |
to_index |
int |
<optional> |
the last row index of the desired selection. if to_index is unset or -1, only the index row is returned |
- Source:
row_set(index, data, to_index)
Set a row's data in place.
Parameters:
Name | Type | Description |
---|---|---|
index |
int | which row to change |
data |
Array.<Object> | the data to change the row to |
to_index |
int | the last row to change, if changing multiple rows. |
- Source:
same_dims()
Check that the sizes are the same for these
- Source:
toString(machineopt)
Give a string value for either human or machine inspection
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
machine |
bool |
<optional> |
false | Whether or not to return a test comparision string. |
- Source:
trace()
Get the trace of the matrix
- Source: