Skip to content

Commit

Permalink
Change "partial" to "weak" (part of PR #48363)
Browse files Browse the repository at this point in the history
Thanks @knuesel
  • Loading branch information
LilithHafner authored and Lilith Hafner committed Jan 28, 2023
1 parent 582eb2e commit 49c7c3a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/src/base/sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ julia> sort(v, alg=InsertionSort)
```

All the sorting and order related functions rely on a "less than" relation defining a
[strict partial order](https://en.wikipedia.org/wiki/Partially_ordered_set#Strict_partial_order)
[strict weak order](https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings)
on the values to be manipulated. The `isless` function is invoked by default, but the relation
can be specified via the `lt` keyword, a function that takes two array elements and returns true
if and only if the first argument is "less than" the second. See [Alternate orderings](@ref) for
Expand Down Expand Up @@ -171,12 +171,12 @@ By default, `sort`, `searchsorted`, and related functions use [`isless`](@ref) t
two elements in order to determine which should come first. The
[`Base.Order.Ordering`](@ref) abstract type provides a mechanism for defining alternate
orderings on the same set of elements. Instances of `Ordering` define a
[strict partial order](https://en.wikipedia.org/wiki/Partially_ordered_set#Strict_partial_order).
To be a strict partial order, for any elements `a`, `b`, `c` the following hold:
[strict weak order](https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings).
To be a strict weak order, for any elements `a`, `b`, `c` the following hold:

* if `a == b`, then `lt(a, b) == false`;
* `lt(a, b) && lt(b, a) == false`; and
* if `lt(a, b) && lt(b, c) == true`, then `lt(a, c) == true`
* `lt(a, b) && lt(b, a) === false`;
* if `lt(a, b) && lt(b, c)`, then `lt(a, c)`; and
* if `!lt(a, b) && !lt(b, c)`, then `!lt(a, c)`

The [`Base.Order.lt`](@ref) function works as a generalization of `isless` to
test whether `a` is less than `b` according to a given order.
Expand Down

0 comments on commit 49c7c3a

Please sign in to comment.