Matrix multiplication
matrix-functions matr(ix)_mul(tiplication)
syntax
- matr_mul(left_att, right_att, result_domain)
definition
The matr_mul(left_att, right_att, result_domain) function calculates the matrix product of the left_att and right_att attributes with as resulting domain-unit: result_domain.
The value-type of the resulting attribute is the the value type of left_att and right_att arguments.
applies to
- attributes left_att and right_att with float32 or float64 value type
conditions
- The value type of left_att, right_att and resulting attribute need to match.
- The domain unit of the left_att, right_att attribute must be a Point value type of the group CanBeDomainUnit.
- The result_domain argument must be a unit of with a Point value type of the group CanBeDomainUnit and match with the result of the matrix product calculation in terms of number or rows/columns.
since version
7.184
example
attribute<float32> product (GridDomain) := matr_mul(left, right, GridDomain);
left
1 | 2 |
3 | 4 |
GridDomain, nr of rows = 2, nr of cols = 2
right
100 | 200 |
300 | 400 |
GridDomain, nr of rows = 2, nr of cols = 2
product
700 (1 * 100 + 2 * 300) | 1.000 (1 * 200 + 2 * 400) |
1.500 (3 * 100 + 4 * 300) | 2.200 (3 * 200 + 4 * 400) |
GridDomain, nr of rows = 2, nr of cols = 2