Skip to content

Commit

Permalink
various suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
danteluber committed Jul 15, 2024
1 parent d9b865d commit 8432424
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/TropicalGeometry/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,21 @@ function det(A::Matrix{TropicalSemiringElem{minOrMax}}) where {minOrMax<:Union{t
end

@doc raw"""
tropically_generic(A::Generic.MatSpaceElem{<: TropicalSemiringElem}, minOrMax)
Checks if a collection of vectors in the tropical torus (given as columns of a matrix `A`) are in tropical general position with respect to the `minOrMax` convention.
is_tropically_generic(A::MatrixElem{<:TropicalSemiringElem}, minOrMax)
Check if a collection of vectors in the tropical torus (given as columns of a matrix `A`) are in tropical general position with respect to the `minOrMax` convention.
# Examples
```jldoctest
julia> A = matrix(tropical_semiring(),[1 0;0 1])
[(1) (0)]
[(0) (1)]
julia> tropically_generic(A,min)
julia> is_tropically_generic(A,min)
true
```
"""
function tropically_generic(A::Generic.MatSpaceElem{<:TropicalSemiringElem}, minOrMax)
function is_tropically_generic(A::MatrixElem{<:TropicalSemiringElem}, minOrMax)
@req convention(A) == minOrMax "Semiring convention not as declared"
if ncols(A) == nrows(A)
return Polymake.tropical.tsgn(A) != 0
Expand Down
2 changes: 1 addition & 1 deletion src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ export is_total
export is_transitive
export is_transverse_intersection
export is_trivial
export is_tropically_generic
export is_two_sided
export is_unipotent
export is_unit
Expand Down Expand Up @@ -1447,7 +1448,6 @@ export tropical_median_consensus
export tropical_pluecker_vector
export tropical_polynomial
export tropical_variety
export tropically_generic
export truncate
export turn_denominator_into_polyhedron
export tutte_connectivity
Expand Down
4 changes: 2 additions & 2 deletions test/TropicalGeometry/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

@testset "tropical general position" begin
A = matrix(tropical_semiring(),[1 0;0 1])
@test tropically_generic(A,min) == true
@test is_tropically_generic(A,min) == true
A = matrix(tropical_semiring(max),[1 0;0 1])
@test_throws ArgumentError tropically_generic(A,min)
@test_throws ArgumentError is_tropically_generic(A,min)
end

0 comments on commit 8432424

Please sign in to comment.