| Operators |
sub_matrix — Subtract two matrices.
sub_matrix( : : MatrixAID, MatrixBID : MatrixSubID)
The operator sub_matrix computes the difference of the input matrices MatrixA and MatrixB given by the matrix handles MatrixAID and MatrixBID. Both matrices must have identical dimensions. A new matrix MatrixSub is generated with the result. The operator returns the matrix handle MatrixSubID of the matrix MatrixSub. Access to the elements of the matrix is possible e.g. with the operator get_full_matrix. The formula for the calculation of the result is:
MatrixSub = MatrixA - MatrixB.
Example:
/ 3.0 1.0 -2.0 \ / 2.0 8.0 -3.0 \
MatrixA = | -5.0 7.0 2.0 | MatrixB = | -4.0 -1.0 5.0 |
\ -9.0 -4.0 1.0 / \ 2.0 -4.0 7.0 /
/ 1.0 -7.0 1.0 \
-> MatrixSub = | -1.0 8.0 -3.0 |
\ -11.0 0.0 -6.0 /
Matrix handle of the input matrix A.
Matrix handle of the input matrix B.
Matrix handle with the difference of the input matrices.
If the parameters are valid, the operator sub_matrix returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.
get_full_matrix, get_value_matrix
Foundation
| Operators |