value
at row y
and column x
Require: x >= 0 and x <= width and y >= 0 and y <= height
var matrix = new Matrix.identity(2)
matrix[0, 0] = 0.0
matrix[0, 1] = 0.1
matrix[1, 0] = 1.0
matrix[1, 1] = 1.1
assert matrix.to_s == """
0.0 0.1
1.0 1.1"""
# Set the `value` at row `y` and column `x`
#
# Require: `x >= 0 and x <= width and y >= 0 and y <= height`
#
# ~~~
# var matrix = new Matrix.identity(2)
#
# matrix[0, 0] = 0.0
# matrix[0, 1] = 0.1
# matrix[1, 0] = 1.0
# matrix[1, 1] = 1.1
#
# assert matrix.to_s == """
# 0.0 0.1
# 1.0 1.1"""
# ~~~
fun []=(y, x: Int, value: Float)
do
assert x >= 0 and x < width
assert y >= 0 and y < height
items[x + y*width] = value
end
lib/matrix/matrix.nit:163,2--185,4