Skip to content

Commit 4cc904b

Browse files
committed
Fix docstring
1 parent 5950b4a commit 4cc904b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/comparison.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,18 @@ An iterator for generating monomial exponents for monomial
315315
ordering `M`. The type of the vector of exponents is the type of
316316
`object` and is length (i.e., the number of variables) is `length(object)`.
317317
318+
Note that `object` does not have to be zero, it just needs to implement
319+
`copy` and `setindex!` methods (except for `Tuple` which we handle with a
320+
special case).
321+
318322
See also [`monomials`](@ref).
319323
320324
### Examples
321325
322326
The following example shows how to generate all exponents of
323327
monomials of 2 variables up to degree 2.
324328
```jldoctest
325-
julia> collect(ExponentsIterator((0, 0), maxdegree = 2))
329+
julia> collect(ExponentsIterator{Graded{LexOrder}}((0, 0), maxdegree = 2))
326330
6-element Vector{Tuple{Int64, Int64}}:
327331
(0, 0)
328332
(0, 1)
@@ -334,7 +338,7 @@ julia> collect(ExponentsIterator((0, 0), maxdegree = 2))
334338
Note that you can easily generate the tuple of exponents
335339
of arbitrary length using `ntuple` as follows:
336340
```jldoctest
337-
julia> collect(ExponentsIterator(ntuple(zero, 3), mindegree = 2, maxdegree = 2))
341+
julia> collect(ExponentsIterator{Graded{LexOrder}}(ntuple(zero, 3), mindegree = 2, maxdegree = 2))
338342
6-element Vector{Tuple{Int64, Int64, Int64}}:
339343
(0, 0, 2)
340344
(0, 1, 1)
@@ -343,7 +347,7 @@ julia> collect(ExponentsIterator(ntuple(zero, 3), mindegree = 2, maxdegree = 2))
343347
(1, 1, 0)
344348
(2, 0, 0)
345349
```
346-
You can also change the monomial ordering as follows:
350+
You can also change the monomial ordering and use `Vector` instead of `Tuple` as follows:
347351
```jldoctest
348352
julia> collect(ExponentsIterator{LexOrder}(zeros(Int, 2), mindegree = 2, maxdegree = 3))
349353
7-element Vector{Vector{Int64}}:

0 commit comments

Comments
 (0)