# Matrix product (×)

Require: `self.width == other.height`

``````var m = new Matrix.from([[3.0, 4.0],
[5.0, 6.0]])
var i = new Matrix.identity(2)

assert m * i == m
assert (m * m).to_s == """
29.0 36.0
45.0 56.0"""

var a = new Matrix.from([[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0]])
var b = new Matrix.from([[1.0],
[2.0],
[3.0]])
var c = a * b
assert c.to_s == """
14.0
32.0"""``````

## Property definitions

##### matrix \$ Matrix :: *
```	# Matrix product (×)
#
# Require: `self.width == other.height`
#
# ~~~
# var m = new Matrix.from([[3.0, 4.0],
#                          [5.0, 6.0]])
# var i = new Matrix.identity(2)
#
# assert m * i == m
# assert (m * m).to_s == """
# 29.0 36.0
# 45.0 56.0"""
#
# var a = new Matrix.from([[1.0, 2.0, 3.0],
#                          [4.0, 5.0, 6.0]])
# var b = new Matrix.from([[1.0],
#                          [2.0],
#                          [3.0]])
# var c = a * b
# assert c.to_s == """
# 14.0
# 32.0"""
# ~~~
fun *(other: Matrix): Matrix
do
assert self.width == other.height

var out = new Matrix(other.width, self.height)
out.items.mul(items, other.items, self.width, self.height, other.width)
return out
end
```
lib/matrix/matrix.nit:187,2--218,4