Methods
avg(mtx, r1, c1, r2, c2) → {number}
Returns the mean and standard deviation of the values contained in a matrix.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
Mean and standard deviation of the values contained in a matrix.
- Type
- number
count(mtx, r1, c1, r2, c2) → {number}
Returns the number of non-zero elements in the matrix.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
The number of non-zero elements in the matrix.
- Type
- number
cross(a, b) → {array}
Calculates the cross product of two vectors A and B.
Parameters:
Name | Type | Description |
---|---|---|
a |
object | The matrix A. |
b |
object | The matrix B. |
Returns:
A (rows x columns) matrix.
- Type
- array
dot(a, b) → {array}
Calculates the dot product of two vectors A and B.
Parameters:
Name | Type | Description |
---|---|---|
a |
object | The matrix A. |
b |
object | The matrix B. |
Returns:
A (rows x columns) matrix.
- Type
- array
max(mtx, r1, c1, r2, c2) → {number}
Returns the largest value in an array.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
The smallest value in an array.
- Type
- number
min(mtx, r1, c1, r2, c2) → {number}
Returns the smallest value in an array.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
The smallest value in an array.
- Type
- number
sum(mtx, r1, c1, r2, c2) → {number}
Calculates the sum of all cells in the matrix.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
Sum of the values contained in a matrix.
- Type
- number
sum2(mtx, r1, c1, r2, c2) → {number}
Calculates the squared sum of all cells in the matrix.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
Sum of the values contained in a matrix.
- Type
- number
trans(mtx, r1, c1, r2, c2) → {number}
Returns the transpose of an array.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix. |
r1 |
number | First row. |
c1 |
number | First column. |
r2 |
number | Last row. |
c2 |
number | Last column. |
Returns:
The transpose of an array.
- Type
- number
triang(mtx) → {array}
Calculates the triangular equivalent matrix.
Parameters:
Name | Type | Description |
---|---|---|
mtx |
object | The matrix to calculate the triangular equivalent matrix. |
Returns:
A (rows x columns) matrix.
- Type
- array
(inner) init()
Creates the attributes of the class.