Skip to content

Commit

Permalink
Better test coverage for linear algebra stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniedie committed Mar 30, 2022
1 parent cf6dd6e commit ea80ac9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/linear_algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ function ArrayInterface.lu_instance(x::ComponentMatrix)
end

# Helpers for dealing with adjoints and such
_first_axis(x) = FlatAxis()
_first_axis(x::AbstractComponentVecOrMat) = getaxes(x)[1]

_second_axis(x::AbstractMatrix) = FlatAxis()
Expand Down Expand Up @@ -38,9 +37,6 @@ for op in [:*, :\, :/]
ax2 = _out_axes($op, aᵀ, B)[2]
return $adj(ComponentArray(cᵀ', ax2))
end
function Base.$op(A::$Adj{T,<:CV}, B::CV) where {T<:Number, CV<:ComponentVector{T}}
return $op(getdata(A), getdata(B))
end
function Base.$op(A::$Adj{T,<:CV}, B::CV) where {T<:Real, CV<:ComponentVector{T}}
return $op(getdata(A), getdata(B))
end
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ end
@test getaxes(ab_cd' \ cd) == (AB,)
@test getaxes(cd' / ab_cd) == (FlatAxis(), AB)
@test getaxes(ab' / ab_cd') == (FlatAxis(), CD)
@test getaxes(ab_cd \ ab_cd) == (CD, CD)
end

# Issue #33
Expand All @@ -536,6 +537,9 @@ end
@test getaxes((s1_D * s2_D) * in2) == getaxes(s1_D * (s2_D * in2)) == (Axis(y1 = 1),)
@test getaxes((s2_D * s1_D) * in1) == getaxes(s2_D * (s1_D * in1)) == (Axis(y2 = 1),)
@test getaxes(out1' * (s1_D * s2_D)) == getaxes(transpose(out1) * (s1_D * s2_D)) == (FlatAxis(), Axis(u2 = 1))

@test ComponentArrays.ArrayInterface.lu_instance(cmat).factors isa ComponentMatrix
@test ComponentArrays.ArrayInterface.parent_type(cmat) === Matrix{Float64}
end

@testset "Plot Utilities" begin
Expand Down

2 comments on commit ea80ac9

@jonniedie
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/57629

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.14 -m "<description of version>" ea80ac958d3cc5f14b9ed3b3a0906cb5beec1dec
git push origin v0.11.14

Please sign in to comment.