matrix :: MatrixIndexIterator :: _key
matrix :: MatrixIndexIterator :: _matrix
matrix :: MatrixIndexIterator :: key=
matrix :: MatrixIndexIterator :: matrix
matrix :: MatrixIndexIterator :: matrix=
matrix $ MatrixIndexIterator :: SELF
Type of this instance, automatically specialized in every classmatrix :: MatrixIndexIterator :: _key
matrix :: MatrixIndexIterator :: _matrix
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: MapIterator :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
matrix :: MatrixIndexIterator :: key=
matrix :: MatrixIndexIterator :: matrix
matrix :: MatrixIndexIterator :: matrix=
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).core :: MapIterator
Iterators for Map.
private class MatrixIndexIterator
super MapIterator[MatrixCoordinate, Float]
var matrix: Matrix
redef var key = new MatrixCoordinate(0, 0)
redef fun is_ok do return key.y < matrix.height
redef fun item
do
assert is_ok
return matrix[key.y, key.x]
end
redef fun next
do
assert is_ok
var key = key
if key.x == matrix.width - 1 then
key.x = 0
key.y += 1
else
key.x += 1
end
end
end
lib/matrix/matrix.nit:262,1--288,3