Skip to content

Commit

Permalink
Add Solve.kernel(::Ring, ::MatElem)
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt committed Feb 8, 2024
1 parent 238c3c8 commit f4b7207
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function can_solve_with_solution_and_kernel(A::Union{MatElem{T}, SolveCtx{T}}, b
end

@doc raw"""
kernel(A::MatElem; side::Symbol = :right)
kernel([R::Ring], A::MatElem; side::Symbol = :right)
kernel(C::SolveCtx; side::Symbol = :right)
Return a matrix $K$ whose columns give a basis for the right kernel of $A$, that
Expand All @@ -292,6 +292,8 @@ is, $AK$ is the zero matrix.
If `side == :left`, the rows of $K$ give a basis for the left kernel of $A$, that
is, $KA$ is the zero matrix.
If a ring $R$ is supplied as a first argument, the kernel is computed over $R$.
If a context object `C` is supplied, then the above applies for `A = matrix(C)`.
"""
function kernel(A::MatElem{<:FieldElement}; side::Symbol = :right)
Expand Down Expand Up @@ -348,6 +350,11 @@ function kernel(C::SolveCtx{<:RingElement}; side::Symbol = :right)
end
end

function kernel(R::Ring, A::MatElem; side::Symbol = :right)
AR = change_base_ring(R, A)
return kernel(AR; side)

Check warning on line 355 in src/Solve.jl

View check run for this annotation

Codecov / codecov/patch

src/Solve.jl#L353-L355

Added lines #L353 - L355 were not covered by tests
end

################################################################################
#
# Internal functionality
Expand Down

0 comments on commit f4b7207

Please sign in to comment.