local SciMax Toolbox log

SciMax Toolbox >> locate_matrix_entry

locate_matrix_entry

Maxima Function

Calling Sequence

locate_matrix_entry (M, r_1, c_1, r_2, c_2, f, rel)

Description

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:

(1) 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 false.

(2) rel = 'max and f real-valued:

Scan the sub-matrix looking for an entry that maximizes f. Return the index of a maximizing entry.

(3) rel = 'min and f real-valued:

Scan the sub-matrix looking for an entry that minimizes f. Return the index of a minimizing entry.

local SciMax Toolbox log