@@ -315,14 +315,18 @@ An iterator for generating monomial exponents for monomial
315315ordering `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+
318322See also [`monomials`](@ref).
319323
320324### Examples
321325
322326The following example shows how to generate all exponents of
323327monomials 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))
3263306-element Vector{Tuple{Int64, Int64}}:
327331 (0, 0)
328332 (0, 1)
@@ -334,7 +338,7 @@ julia> collect(ExponentsIterator((0, 0), maxdegree = 2))
334338Note that you can easily generate the tuple of exponents
335339of 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))
3383426-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
348352julia> collect(ExponentsIterator{LexOrder}(zeros(Int, 2), mindegree = 2, maxdegree = 3))
3493537-element Vector{Vector{Int64}}:
0 commit comments