Function: locate_matrix_entry (<M>, <r_1>, <c_1>, <r_2>, <c_2>, <f>, <rel>) The first argument must be a matrix; the arguments <r_1> through <c_2> determine a sub-matrix of <M> that consists of rows <r_1> through <r_2> and columns <c_1> through <c_2>.
Find a entry in the sub-matrix <M> that satisfies some property. Three cases:
<rel> = bool and <f> a predicate:
Scan the sub-matrix from left to right then top to bottom, and return the index of the first entry that satisfies the predicate <f>. If no matrix entry satisfies <f>, return
<rel> = max and <f> real-valued:
Scan the sub-matrix looking for an entry that maximizes <f>. Return the index of a maximizing entry.
<rel> = min and <f> real-valued:
Scan the sub-matrix looking for an entry that minimizes <f>. Return the index of a minimizing entry.
(%o1) true (%i2)