## typelocked-rw-matrix.api
#
# Typelocked two-dimensional matrices.
#
# See also:
#
#
src/lib/std/src/rw-matrix.api
# Compiled by:
#
src/lib/std/src/standard-core.sublib# Generic interface for typelocked rw_matrix packages.
api Typelocked_Rw_Matrix {
#
eqtype Rw_Matrix;
Element;
Vector;
Region # Specify an ROI ("Region Of Interest") within a matrix.
=
{ rw_matrix: Rw_Matrix, # Matrix containing the ROI.
row: Int, # Low corner of ROI is (row, col). ("col" == "column".)
col: Int, #
rows: Null_Or( Int ), # Number of rows in ROI. Defaults to max possible given 'row' value.
cols: Null_Or( Int ) # Number of columns in ROI. Defaults to max possible given 'col' value.
};
make_rw_matrix: ((Int,Int), Element) -> Rw_Matrix;
from_list: (Int,Int) -> List(Element) -> Rw_Matrix;
from_lists: List( List(Element) ) -> Rw_Matrix;
from_fn: ((Int,Int), (Int,Int) -> Element) -> Rw_Matrix;
get: (Rw_Matrix, (Int,Int)) -> Element;
(_[]): (Rw_Matrix, (Int,Int)) -> Element; # Synonym for previous; supports foo = matrix[i,j]; syntax.
set: (Rw_Matrix, (Int,Int), Element) -> Void;
(_[]:=): (Rw_Matrix, (Int,Int), Element) -> Void; # Synonym for previous; supports matrix[i,j] := foo; syntax.
rowscols: Rw_Matrix -> (Int, Int);
cols: Rw_Matrix -> Int;
rows: Rw_Matrix -> Int;
row: (Rw_Matrix, Int) -> Vector;
col: (Rw_Matrix, Int) -> Vector;
copy_region:
{ region: Region, # Copy contents of this region
to: Rw_Matrix, # to this matrix, with low corner at (to_row, to_col).
#
to_row: Int, #
to_col: Int #
}
->
Void;
apply: (Element -> Void) -> Rw_Matrix -> Void;
region_apply: ((Int, Int, Element) -> Void) -> Region -> Void;
map_in_place: (Element -> Element) -> Rw_Matrix -> Void;
region_map_in_place: ((Int, Int, Element) -> Element) -> Region -> Void;
fold_forward: ((Element, Y) -> Y) -> Y -> Rw_Matrix -> Y;
region_fold_forward: ((Int, Int, Element, Y) -> Y) -> Y -> Region -> Y;
};
## COPYRIGHT (c) 1994 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.