[doc] link max <--> argmax

This commit is contained in:
Ben Greenman 2017-03-11 13:38:23 -05:00
parent faa385b337
commit 10aaff692b
2 changed files with 8 additions and 5 deletions

View File

@ -5,7 +5,8 @@
racket/fixnum
racket/unsafe/ops
racket/require
racket/random))
racket/random
racket/list))
@(define math-eval (make-base-eval))
@examples[#:hidden #:eval math-eval (require racket/math)]
@ -352,7 +353,7 @@ If @racket[m] is exact @racket[0], the
Returns the largest of the @racket[x]s, or @racket[+nan.0] if any
@racket[x] is @racket[+nan.0]. If any @racket[x] is inexact, the
result is coerced to inexact.
result is coerced to inexact. See also @racket[argmax].
@mz-examples[(max 1 3 2) (max 1 3 2.0)]}
@ -361,7 +362,7 @@ Returns the largest of the @racket[x]s, or @racket[+nan.0] if any
Returns the smallest of the @racket[x]s, or @racket[+nan.0] if any
@racket[x] is @racket[+nan.0]. If any @racket[x] is inexact, the
result is coerced to inexact.
result is coerced to inexact. See also @racket[argmin].
@mz-examples[(min 1 3 2) (min 1 3 2.0)]}

View File

@ -1,6 +1,7 @@
#lang scribble/doc
@(require "mz.rkt" scribble/scheme racket/generator racket/list
(for-syntax racket/base))
(for-syntax racket/base)
(for-label racket/list))
@(define (generate-c_r-example proc)
(define (make-it start n)
@ -1358,6 +1359,7 @@ it builds the permutations one-by-one on each iteration}
Returns the first element in the list @racket[lst] that minimizes the
result of @racket[proc]. Signals an error on an empty list.
See also @racket[min].
@mz-examples[#:eval list-eval
(argmin car '((3 pears) (1 banana) (2 apples)))
@ -1369,12 +1371,12 @@ result of @racket[proc]. Signals an error on an empty list.
Returns the first element in the list @racket[lst] that maximizes the
result of @racket[proc]. Signals an error on an empty list.
See also @racket[max].
@mz-examples[#:eval list-eval
(argmax car '((3 pears) (1 banana) (2 apples)))
(argmax car '((3 pears) (3 oranges)))]}
@defproc[(group-by [key (-> any/c any/c)]
[lst list?]
[same? (any/c any/c . -> . any/c) equal?])