Skip to content

Commit

Permalink
Unify and crossref docstrings for GF and finite_field (#1806)
Browse files Browse the repository at this point in the history
Co-authored-by: Max Horn <max@quendi.de>
  • Loading branch information
lgoettgens and fingolfin authored Jul 2, 2024
1 parent 39dea8b commit d8aeedc
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/flint/fq_default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -842,16 +842,19 @@ end
###############################################################################

@doc raw"""
finite_field(p::IntegerUnion, d::Int, s::VarName; cached = true, check = true)
finite_field(q::IntegerUnion, s::VarName; cached = true, check = true)
finite_field(f::FqPolyElem, s::VarName; cached = true, check = true)
finite_field(p::IntegerUnion, d::Int, s::VarName = :o; cached::Bool = true, check::Bool = true)
finite_field(q::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
finite_field(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, check::Bool = true)
Return a tuple $K, a$ consisting of a finite field $K$ of order $q = p^d$ and
algebra generator $x$. The string $s$ is used to designate how the finite field
generator will be printed.
Return a tuple $(K, x)$ of a finite field $K$ of order $q = p^d$, where $p$ is a prime,
and a generator $x$ of $K$ (see [`gen`](@ref) for a definition).
The identifier $s$ is used to designate how the finite field generator will be printed.
If a polynomial $f \in k[X]$ over a finite field $k$ is specified, the relative finite field
$K = k[X]/(f)$ will be constructed as a finite field with base field $k$.
If a polynomial $f \in k[X]$ over a finite field $k$ is specified,
the finite field $K = k[X]/(f)$ will be constructed as a finite
field with base field $k$.
See also [`GF`](@ref) which only returns $K$.
# Examples
Expand Down Expand Up @@ -893,17 +896,19 @@ function finite_field(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, c
end

@doc raw"""
GF(p::IntegerUnion, d::Int, s::String; cached::Bool, check::Bool)
GF(q::IntegerUnion, s::String; cached::Bool, check::Bool)
GF(f::FqPolyRingElem; s::String; cached::Bool, check::Bool)
GF(p::IntegerUnion, d::Int, s::VarName = :o; cached::Bool = true, check::Bool = true)
GF(q::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
GF(f::FqPolyRingElem, s::VarName = :o; cached::Bool = true, check::Bool = true)
Return a finite field $K$ of order $q = p^d$. The string $s$ is
used to designate how the finite field generator will be printed.
Return a finite field $K$ of order $q = p^d$, where $p$ is a prime.
The identifier $s$ is used to designate how the finite field generator will be printed.
If a polynomial $f \in k[X]$ over a finite field $k$ is specified,
the finite field $K = k[X]/(f)$ will be constructed as a finite
field with base field $k$.
See also [`finite_field`](@ref) which additionally returns a finite field generator of $K$.
# Examples
```jldoctest
Expand All @@ -921,8 +926,8 @@ Finite field of degree 3 over GF(3, 2)
"""
GF

function GF(a::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
return finite_field(a, s; cached = cached, check = check)[1]
function GF(q::IntegerUnion, s::VarName = :o; cached::Bool = true, check::Bool = true)
return finite_field(q, s; cached = cached, check = check)[1]
end

function GF(p::IntegerUnion, d::Int, s::VarName = :o; cached::Bool = true, check::Bool = true)
Expand Down

0 comments on commit d8aeedc

Please sign in to comment.