summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-11-16 20:33:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-11-16 20:33:37 -0800
commitc0379ca87158d3ea015cfb88a9968ab460368f83 (patch)
treee56c72a67fec77ba448f52abb8810fc8ebf6fcb1
parent30c88cc17203d07b1806453cadf30db2e0d0caa1 (diff)
downloadtxr-c0379ca87158d3ea015cfb88a9968ab460368f83.tar.gz
txr-c0379ca87158d3ea015cfb88a9968ab460368f83.tar.bz2
txr-c0379ca87158d3ea015cfb88a9968ab460368f83.zip
doc: pos-max, find-max: notes about multiple maxima.
* txr.1: mention that the rightmost maximum can be found by manipulating the comparison function. (Hence, this is why we don't provide rpos-max and rfind-max).
-rw-r--r--txr.125
1 files changed, 25 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 26bc2051..4ca6929a 100644
--- a/txr.1
+++ b/txr.1
@@ -26808,6 +26808,23 @@ from
is passed through this one-argument function, and
the resulting value is used in its place.
+If a sequence contains multiple equivalent maxima,
+whether the position of the leftmost or rightmost such maximum is reported
+depends on whether
+.meta testfun
+compares for strict inequality, or whether it reports true for
+equal arguments also. Under the default
+.metn testfun ,
+which is
+.codn less ,
+the
+.code pos-max
+function will return the position leftmost of a duplicate set of maximum
+elements. To find the rightmost of the maxima, the
+.code lequal
+function can be substituted. Analogous reasoning applies to other
+test functions.
+
.coNP Function @ mismatch
.synb
.mets (mismatch < left-seq < right-seq >> [ testfun <> [ keyfun ]])
@@ -27605,6 +27622,14 @@ To find the entry holding the maximum value, the
.code cdr
function can be specified.
+If there are multiple equivalent maxima, then under the default
+.metn testfun ,
+that being
+.codn less ,
+the leftmost one is reported. See the notes under
+.code pos-max
+regarding duplicate maxima.
+
.coNP Functions @, uni @ isec and @ diff
.synb
.mets (uni < seq1 < seq2 >> [ testfun <> [ keyfun ]])