Max, Min, Sort, Find

For several matrix classes, the comparison operators "</<=/>/>=/==/!=" are overloaded for matrix to matrix comparisons within the same matrix class and for matrix to scalar or scalar to matrix relations. They all work in the same elementwise sense; we explain this for the "<" relation on matrices A, B (of the same size) and scalar d:

For (almost all) matrix classes the following routines are available for max and min, which we explain for max:

A sorting of the values of a matrix A is returned in the form of an index vector ind, so that the vector A(ind) is sorted in nondecreasing order:

Likewise, routines for finding elements in a matrix A return an Indexmatrix, that gives the indices to all elements satisfying the find condition: