Skip to content

Commit d6e24a0

Browse files
committed
Add some documentation
1 parent ef3b593 commit d6e24a0

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/MPoly.jl

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,21 +511,29 @@ end
511511
###############################################################################
512512

513513
@doc raw"""
514-
coefficients(a::MPolyRingElem{T}) where T <: RingElement
514+
coefficients(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
515515
516516
Return an iterator for the coefficients of the given polynomial. To retrieve
517517
an array of the coefficients, use `collect(coefficients(a))`.
518+
519+
If `inplace` is `true`, the elements of the iterator may share their memory. This
520+
means that an element returned by the iterator may be overwritten 'in place' in
521+
the next iteration step. This may result in significantly fewer memory allocations.
518522
"""
519523
function coefficients(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
520524
return Generic.MPolyCoeffs(a, inplace=inplace)
521525
end
522526

523527
@doc raw"""
524-
exponent_vectors(a::MPolyRingElem{T}) where T <: RingElement
528+
exponent_vectors(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
525529
526530
Return an iterator for the exponent vectors of the given polynomial. To
527531
retrieve an array of the exponent vectors, use
528532
`collect(exponent_vectors(a))`.
533+
534+
If `inplace` is `true`, the elements of the iterator may share their memory. This
535+
means that an element returned by the iterator may be overwritten 'in place' in
536+
the next iteration step. This may result in significantly fewer memory allocations.
529537
"""
530538
function exponent_vectors(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
531539
return Generic.MPolyExponentVectors(a, inplace=inplace)
@@ -536,20 +544,28 @@ function exponent_vectors(::Type{Vector{S}}, a::MPolyRingElem{T}; inplace::Bool
536544
end
537545

538546
@doc raw"""
539-
monomials(a::MPolyRingElem{T}) where T <: RingElement
547+
monomials(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
540548
541549
Return an iterator for the monomials of the given polynomial. To retrieve
542550
an array of the monomials, use `collect(monomials(a))`.
551+
552+
If `inplace` is `true`, the elements of the iterator may share their memory. This
553+
means that an element returned by the iterator may be overwritten 'in place' in
554+
the next iteration step. This may result in significantly fewer memory allocations.
543555
"""
544556
function monomials(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
545557
return Generic.MPolyMonomials(a, inplace=inplace)
546558
end
547559

548560
@doc raw"""
549-
terms(a::MPolyRingElem{T}) where T <: RingElement
561+
terms(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
550562
551563
Return an iterator for the terms of the given polynomial. To retrieve
552564
an array of the terms, use `collect(terms(a))`.
565+
566+
If `inplace` is `true`, the elements of the iterator may share their memory. This
567+
means that an element returned by the iterator may be overwritten 'in place' in
568+
the next iteration step. This may result in significantly fewer memory allocations.
553569
"""
554570
function terms(a::MPolyRingElem{T}; inplace::Bool = false) where T <: RingElement
555571
return Generic.MPolyTerms(a, inplace=inplace)

0 commit comments

Comments
 (0)