diff --git a/docs/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties.md b/docs/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties.md index ca5984b01cdf..58c85973cbb8 100644 --- a/docs/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties.md +++ b/docs/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties.md @@ -29,9 +29,7 @@ affine_normal_toric_variety(v::NormalToricVariety) ### Normal Toric Varieties ```@docs -normal_toric_variety(rays::AbstractCollection[RayVector], max_cones::Vector{Vector{Int64}}; non_redundant::Bool = false) -normal_toric_variety(PF::PolyhedralFan) -normal_toric_variety(P::Polyhedron) +normal_toric_variety ``` ### Famous Toric Vareties diff --git a/experimental/FTheoryTools/src/auxiliary.jl b/experimental/FTheoryTools/src/auxiliary.jl index 0defcf26df18..0cb3a1466595 100644 --- a/experimental/FTheoryTools/src/auxiliary.jl +++ b/experimental/FTheoryTools/src/auxiliary.jl @@ -22,7 +22,7 @@ function _auxiliary_base_space(auxiliary_base_variable_names::Vector{String}, au if dim(auxiliary_base_space) != d integral_rays = matrix(ZZ, rays(variety)) new_max_cones = IncidenceMatrix(cones(variety, d)) - auxiliary_base_space = normal_toric_variety(integral_rays, new_max_cones; non_redundant = true) + auxiliary_base_space = normal_toric_variety(new_max_cones, integral_rays; non_redundant = true) end # Set attributes of this base space and return it @@ -81,7 +81,7 @@ function _ambient_space(base::NormalToricVariety, fiber_ambient_space::NormalTor ambient_space_max_cones = IncidenceMatrix(vcat(ambient_space_max_cones...)) # Construct the ambient space - ambient_space = normal_toric_variety(ambient_space_rays, ambient_space_max_cones; non_redundant = true) + ambient_space = normal_toric_variety(ambient_space_max_cones, ambient_space_rays; non_redundant = true) # Compute torusinvariant weil divisor group and the class group ambient_space_torusinvariant_weil_divisor_group = free_abelian_group(nrows(ambient_space_rays)) @@ -198,7 +198,7 @@ function sample_toric_variety() [5, 11, 12], [5, 6, 32], [5, 6, 12], [4, 31, 32], [4, 10, 11], [4, 5, 32], [4, 5, 11], [3, 30, 31], [3, 9, 10], [3, 4, 31], [3, 4, 10], [2, 29, 30], [2, 8, 9], [2, 3, 30], [2, 3, 9], [1, 8, 29], [1, 2, 29], [1, 2, 8]]) - return normal_toric_variety(rays, cones) + return normal_toric_variety(cones, rays) end diff --git a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl index b93c3c3f15c5..d22947235b9f 100644 --- a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl @@ -27,7 +27,7 @@ true julia> ngens(chow_ring(p2)) 3 -julia> v = normal_toric_variety([[1, 0], [0, 1], [-1, -1]], [[1], [2], [3]]) +julia> v = normal_toric_variety(IncidenceMatrix([[1], [2], [3]]), [[1, 0], [0, 1], [-1, -1]]) Normal toric variety julia> is_complete(v) diff --git a/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/methods.jl b/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/methods.jl index 9157ac8310d9..0c169666f19c 100644 --- a/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/methods.jl +++ b/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/methods.jl @@ -58,9 +58,9 @@ julia> m = 2; julia> ray_generators = [e1, -e1, e2, e3, - e2 - e3 - m * e1]; -julia> max_cones = [[1,3,4], [1,3,5], [1,4,5], [2,3,4], [2,3,5], [2,4,5]]; +julia> max_cones = IncidenceMatrix([[1,3,4], [1,3,5], [1,4,5], [2,3,4], [2,3,5], [2,4,5]]); -julia> X = normal_toric_variety(ray_generators, max_cones; non_redundant = true) +julia> X = normal_toric_variety(max_cones, ray_generators; non_redundant = true) Normal toric variety julia> cox_ring(X) diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl index 71fd002ab242..cf324f25e453 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/constructors.jl @@ -63,7 +63,7 @@ end @doc raw""" - normal_toric_variety(rays::AbstractCollection[RayVector], max_cones::IncidenceMatrix; non_redundant::Bool = false) + normal_toric_variety(max_cones::IncidenceMatrix, rays::AbstractCollection[RayVector]; non_redundant::Bool = false) Construct a normal toric variety $X$ by providing the rays and maximal cones as vector of vectors. By default, this method assumes that the input is not @@ -82,23 +82,23 @@ julia> ray_generators = [[1,0], [0, 1], [-1, 5], [0, -1]] [-1, 5] [0, -1] -julia> max_cones = [[1, 2], [2, 3], [3, 4], [4, 1]] -4-element Vector{Vector{Int64}}: - [1, 2] - [2, 3] - [3, 4] - [4, 1] +julia> max_cones = IncidenceMatrix([[1, 2], [2, 3], [3, 4], [4, 1]]) +4×4 IncidenceMatrix +[1, 2] +[2, 3] +[3, 4] +[1, 4] -julia> normal_toric_variety(ray_generators, max_cones) +julia> normal_toric_variety(max_cones, ray_generators) Normal toric variety -julia> normal_toric_variety(ray_generators, max_cones; non_redundant = true) +julia> normal_toric_variety(max_cones, ray_generators; non_redundant = true) Normal toric variety ``` """ -normal_toric_variety(rays::AbstractCollection[RayVector], max_cones::Vector{Vector{Int64}}; non_redundant::Bool = false) = normal_toric_variety(rays, IncidenceMatrix(max_cones); non_redundant = non_redundant) -function normal_toric_variety(rays::AbstractCollection[RayVector], max_cones::IncidenceMatrix; non_redundant::Bool = false) - fan = polyhedral_fan(rays, max_cones; non_redundant=non_redundant) +normal_toric_variety(max_cones::Vector{Vector{Int64}}, rays::AbstractCollection[RayVector]; non_redundant::Bool = false) = normal_toric_variety(IncidenceMatrix(max_cones), rays; non_redundant) +function normal_toric_variety(max_cones::IncidenceMatrix, rays::AbstractCollection[RayVector]; non_redundant::Bool = false) + fan = polyhedral_fan(max_cones, rays; non_redundant) return normal_toric_variety(fan) end diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl index 57cb35846ff4..96ccbd317c33 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl @@ -80,8 +80,8 @@ Normal toric variety """ function hirzebruch_surface(::Type{NormalToricVariety}, r::Int) fan_rays = [1 0; 0 1; -1 r; 0 -1] - cones = [[1, 2], [2, 3], [3, 4], [4, 1]] - variety = normal_toric_variety(fan_rays, cones; non_redundant = true) + cones = IncidenceMatrix([[1, 2], [2, 3], [3, 4], [4, 1]]) + variety = normal_toric_variety(cones, fan_rays; non_redundant = true) set_attribute!(variety, :torusinvariant_weil_divisor_group, free_abelian_group(4)) set_attribute!(variety, :class_group, free_abelian_group(2)) weights = matrix(ZZ, [1 0; 0 1; 1 0; r 1]) @@ -126,7 +126,7 @@ function del_pezzo_surface(::Type{NormalToricVariety}, b::Int) fan_rays = [1 0; 0 1; -1 -1; 1 1; 0 -1; -1 0] cones = IncidenceMatrix([[1, 4], [2, 4], [1, 5], [5, 3], [2, 6], [6, 3]]) end - variety = normal_toric_variety(fan_rays, cones; non_redundant = true) + variety = normal_toric_variety(cones, fan_rays; non_redundant = true) set_attribute!(variety, :torusinvariant_weil_divisor_group, free_abelian_group(b+3)) set_attribute!(variety, :class_group, free_abelian_group(b+1)) if b == 1 @@ -245,7 +245,7 @@ function normal_toric_variety_from_star_triangulation(P::Polyhedron) integral_rays = vcat([pts[k,:] for k in 2:nrows(pts)]) # construct the variety - return normal_toric_variety(integral_rays, max_cones; non_redundant = true) + return normal_toric_variety(max_cones, integral_rays; non_redundant = true) end @@ -298,7 +298,7 @@ function normal_toric_varieties_from_star_triangulations(P::Polyhedron) max_cones = [IncidenceMatrix([[c[i]-1 for i in 2:length(c)] for c in t]) for t in trias] # construct the varieties - return [normal_toric_variety(integral_rays, cones; non_redundant = true) for cones in max_cones] + return [normal_toric_variety(cones, integral_rays; non_redundant = true) for cones in max_cones] end @@ -341,7 +341,7 @@ function normal_toric_variety_from_glsm(charges::ZZMatrix) # construct varieties triang = _find_full_star_triangulation(pts) max_cones = IncidenceMatrix([[c[i]-1 for i in 2:length(c)] for c in triang]) - variety = normal_toric_variety(integral_rays, max_cones; non_redundant = true) + variety = normal_toric_variety(max_cones, integral_rays; non_redundant = true) # set the attributes and return the variety set_attribute!(variety, :torusinvariant_weil_divisor_group, G1) @@ -408,7 +408,7 @@ function normal_toric_varieties_from_glsm(charges::ZZMatrix) # construct varieties integral_rays = vcat([pts[k,:] for k in 2:nrows(pts)]) max_cones = [IncidenceMatrix([[c[i]-1 for i in 2:length(c)] for c in t]) for t in star_triangulations(pts; full = true)] - varieties = [normal_toric_variety(integral_rays, cones; non_redundant = true) for cones in max_cones] + varieties = [normal_toric_variety(cones, integral_rays; non_redundant = true) for cones in max_cones] # set the map from Div_T -> Cl to the desired matrix for v in varieties diff --git a/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl index f7ac0894c643..5393f14fe5e2 100644 --- a/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/Proj/constructors.jl @@ -76,7 +76,7 @@ function _proj_and_total_space(is_proj::Bool, E::Vector{T}) where T <: Union{Tor total_rays_gens = vcat([modified_ray_gens[ray] for ray in rays(v)], [vcat(ray_vector(zeros(Int64, dim(v))), l[i]) for i in eachindex(E)]) - return normal_toric_variety(polyhedral_fan(total_rays_gens, IncidenceMatrix(new_maximal_cones))) + return normal_toric_variety(polyhedral_fan(IncidenceMatrix(new_maximal_cones), total_rays_gens)) end function _m_sigma(sigma::Cone{QQFieldElem}, pol_sigma::Cone{QQFieldElem}, D::Union{ToricDivisor, ToricLineBundle})::RayVector{QQFieldElem} diff --git a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/standard_constructions.jl b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/standard_constructions.jl index c9a279b07549..477ff17b340f 100644 --- a/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/standard_constructions.jl +++ b/src/AlgebraicGeometry/ToricVarieties/ToricMorphisms/standard_constructions.jl @@ -16,7 +16,7 @@ Toric morphism mapping_matrix = matrix(ZZ, rays(variety)) max_cones_for_cox_variety = ray_indices(maximal_cones(variety)) rays_for_cox_variety = matrix(ZZ, [[if i==j 1 else 0 end for j in 1:nrays(variety)] for i in 1:nrays(variety)]) - cox_variety = normal_toric_variety(polyhedral_fan(rays_for_cox_variety, max_cones_for_cox_variety)) + cox_variety = normal_toric_variety(polyhedral_fan(max_cones_for_cox_variety, rays_for_cox_variety)) return toric_morphism(cox_variety, mapping_matrix, variety) end diff --git a/src/PolyhedralGeometry/PolyhedralFan/constructors.jl b/src/PolyhedralGeometry/PolyhedralFan/constructors.jl index f95bc6671670..b60e4d0ddd6c 100644 --- a/src/PolyhedralGeometry/PolyhedralFan/constructors.jl +++ b/src/PolyhedralGeometry/PolyhedralFan/constructors.jl @@ -45,7 +45,7 @@ julia> R = [1 0; 1 1; 0 1; -1 0; 0 -1]; julia> IM=IncidenceMatrix([[1,2],[2,3],[3,4],[4,5],[1,5]]); -julia> PF=polyhedral_fan(R,IM) +julia> PF=polyhedral_fan(IM, R) Polyhedral fan in ambient dimension 2 ``` @@ -57,7 +57,7 @@ julia> L = [0 1 0]; julia> IM = IncidenceMatrix([[1],[2]]); -julia> PF=polyhedral_fan(R, L, IM) +julia> PF=polyhedral_fan(IM, R, L) Polyhedral fan in ambient dimension 3 julia> lineality_dim(PF) @@ -65,9 +65,9 @@ julia> lineality_dim(PF) ``` """ function polyhedral_fan(f::scalar_type_or_field, + Incidence::IncidenceMatrix, Rays::AbstractCollection[RayVector], - LS::Union{AbstractCollection[RayVector], Nothing}, - Incidence::IncidenceMatrix; + LS::Union{AbstractCollection[RayVector], Nothing}; non_redundant::Bool = false) parent_field, scalar_type = _determine_parent_and_scalar(f, Rays, LS) RM = unhomogenized_matrix(Rays) @@ -90,9 +90,9 @@ function polyhedral_fan(f::scalar_type_or_field, ), parent_field) end end -polyhedral_fan(f::scalar_type_or_field, Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) = polyhedral_fan(f, Rays, nothing, Incidence; non_redundant=non_redundant) -polyhedral_fan(Rays::AbstractCollection[RayVector], LS::Union{AbstractCollection[RayVector], Nothing}, Incidence::IncidenceMatrix; non_redundant::Bool = false) = polyhedral_fan(QQFieldElem, Rays, LS, Incidence; non_redundant = non_redundant) -polyhedral_fan(Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) = polyhedral_fan(QQFieldElem, Rays, Incidence; non_redundant = non_redundant) +polyhedral_fan(f::scalar_type_or_field, Incidence::IncidenceMatrix, Rays::AbstractCollection[RayVector]; non_redundant::Bool = false) = polyhedral_fan(f, Incidence, Rays, nothing; non_redundant) +polyhedral_fan(Incidence::IncidenceMatrix, Rays::AbstractCollection[RayVector], LS::Union{AbstractCollection[RayVector], Nothing}; non_redundant::Bool = false) = polyhedral_fan(QQFieldElem, Incidence, Rays, LS; non_redundant) +polyhedral_fan(Incidence::IncidenceMatrix, Rays::AbstractCollection[RayVector]; non_redundant::Bool = false) = polyhedral_fan(QQFieldElem, Incidence, Rays; non_redundant) """ pm_object(PF::PolyhedralFan) @@ -117,10 +117,10 @@ function polyhedral_fan(cones::AbstractVector{Cone{T}}; non_redundant::Bool=fals end #Same construction for when the user gives Matrix{Bool} as incidence matrix -polyhedral_fan(f::scalar_type_or_field, Rays::AbstractCollection[RayVector], LS::AbstractCollection[RayVector], Incidence::Matrix{Bool}) = - polyhedral_fan(f, Rays, LS, IncidenceMatrix(Polymake.IncidenceMatrix(Incidence))) -polyhedral_fan(f::scalar_type_or_field, Rays::AbstractCollection[RayVector], Incidence::Matrix{Bool}) = - polyhedral_fan(f, Rays, IncidenceMatrix(Polymake.IncidenceMatrix(Incidence))) +polyhedral_fan(f::scalar_type_or_field, Incidence::Matrix{Bool}, Rays::AbstractCollection[RayVector], LS::AbstractCollection[RayVector]) = + polyhedral_fan(f, IncidenceMatrix(Polymake.IncidenceMatrix(Incidence)), Rays, LS) +polyhedral_fan(f::scalar_type_or_field, Incidence::Matrix{Bool}, Rays::AbstractCollection[RayVector]) = + polyhedral_fan(f, IncidenceMatrix(Polymake.IncidenceMatrix(Incidence)), Rays) polyhedral_fan(C::Cone{T}) where T<:scalar_types = polyhedral_fan([C]) diff --git a/src/PolyhedralGeometry/PolyhedralFan/properties.jl b/src/PolyhedralGeometry/PolyhedralFan/properties.jl index 191c1a884a8e..03d688ab294e 100644 --- a/src/PolyhedralGeometry/PolyhedralFan/properties.jl +++ b/src/PolyhedralGeometry/PolyhedralFan/properties.jl @@ -230,7 +230,7 @@ Return the dimension of `PF`. This fan in the plane contains a 2-dimensional cone and is thus 2-dimensional itself. ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 -1], IncidenceMatrix([[1, 2], [3]])); +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [3]]), [1 0; 0 1; -1 -1]); julia> dim(PF) 2 @@ -247,7 +247,7 @@ Return the number of maximal cones of `PF`. The cones given in this construction are non-redundant. Thus there are two maximal cones. ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 -1], IncidenceMatrix([[1, 2], [3]])); +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [3]]), [1 0; 0 1; -1 -1]); julia> n_maximal_cones(PF) 2 @@ -264,7 +264,7 @@ Return the number of cones of `PF`. The cones given in this construction are non-redundant. There are six cones in this fan. ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 -1], IncidenceMatrix([[1, 2], [3]])) +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [3]]), [1 0; 0 1; -1 -1]) Polyhedral fan in ambient dimension 2 julia> n_cones(PF) @@ -386,7 +386,7 @@ This fan consists of two cones, one containing all the points with $y ≤ 0$ and one containing all the points with $y ≥ 0$. The fan's lineality is the common lineality of these two cones, i.e. in $x$-direction. ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 0; 0 -1], IncidenceMatrix([[1, 2, 3], [3, 4, 1]])) +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2, 3], [3, 4, 1]]), [1 0; 0 1; -1 0; 0 -1]) Polyhedral fan in ambient dimension 2 julia> lineality_space(PF) @@ -441,7 +441,7 @@ Determine whether `PF` is smooth. Even though the cones of this fan cover the positive orthant together, one of these und thus the whole fan is not smooth. ```jldoctest -julia> PF = polyhedral_fan([0 1; 2 1; 1 0], IncidenceMatrix([[1, 2], [2, 3]])); +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [2, 3]]), [0 1; 2 1; 1 0]); julia> is_smooth(PF) false @@ -457,7 +457,7 @@ Determine whether `PF` is regular, i.e. the normal fan of a polytope. # Examples This fan is not complete and thus not regular. ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 -1], IncidenceMatrix([[1, 2], [3]])); +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [3]]), [1 0; 0 1; -1 -1]); julia> is_regular(PF) false @@ -473,7 +473,7 @@ Determine whether `PF` is pure, i.e. all maximal cones have the same dimension. # Examples ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 -1], IncidenceMatrix([[1, 2], [3]])); +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [3]]), [1 0; 0 1; -1 -1]); julia> is_pure(PF) false @@ -490,7 +490,7 @@ dimension. # Examples ```jldoctest -julia> PF = polyhedral_fan([1 0; 0 1; -1 -1], IncidenceMatrix([[1, 2], [3]])); +julia> PF = polyhedral_fan(IncidenceMatrix([[1, 2], [3]]), [1 0; 0 1; -1 -1]); julia> is_fulldimensional(PF) true diff --git a/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl b/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl index ed45cbee5bdd..e25341dde4c2 100644 --- a/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl +++ b/src/PolyhedralGeometry/PolyhedralFan/standard_constructions.jl @@ -127,7 +127,7 @@ function star_subdivision(Sigma::_FanLikeType, new_ray::AbstractVector{<:Integer end end - return polyhedral_fan(coefficient_field(Sigma), new_rays, IncidenceMatrix([nc for nc in new_cones]); non_redundant=true) + return polyhedral_fan(coefficient_field(Sigma), IncidenceMatrix([nc for nc in new_cones]), new_rays; non_redundant=true) end function _get_refinable_facets(Sigma::_FanLikeType, new_ray::AbstractVector{<:IntegerUnion}, refinable_cones::Vector{Int}, facet_normals::AbstractMatrix, mc_old::IncidenceMatrix) diff --git a/src/deprecations.jl b/src/deprecations.jl index d9c83ef61995..78efe51c75e9 100644 --- a/src/deprecations.jl +++ b/src/deprecations.jl @@ -265,14 +265,14 @@ function PolyhedralFan{T}(Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) where T<:scalar_types Base.depwarn("'PolyhedralFan{$T}(x...)' is deprecated, use 'polyhedral_fan($T, x...)' instead.", :PolyhedralFan) - return polyhedral_fan(T, Rays, LS, Incidence; non_redundant=non_redundant) + return polyhedral_fan(T, Incidence, Rays, LS; non_redundant=non_redundant) end function PolyhedralFan{T}(Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) where T<:scalar_types Base.depwarn("'PolyhedralFan{$T}(x...)' is deprecated, use 'polyhedral_fan($T, x...)' instead.", :PolyhedralFan) - return polyhedral_fan(T, Rays, Incidence; non_redundant=non_redundant) + return polyhedral_fan(T, Incidence, Rays; non_redundant=non_redundant) end -@deprecate PolyhedralFan(Rays::AbstractCollection[RayVector], LS::Union{AbstractCollection[RayVector], Nothing}, Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(QQFieldElem, Rays, LS, Incidence; non_redundant = non_redundant) -@deprecate PolyhedralFan(Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(QQFieldElem, Rays, Incidence; non_redundant = non_redundant) +@deprecate PolyhedralFan(Rays::AbstractCollection[RayVector], LS::Union{AbstractCollection[RayVector], Nothing}, Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(QQFieldElem, Incidence, Rays, LS; non_redundant = non_redundant) +@deprecate PolyhedralFan(Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(QQFieldElem, Incidence, Rays; non_redundant = non_redundant) function PolyhedralFan(itr::AbstractVector{Cone{T}}) where T<:scalar_types Base.depwarn("'PolyhedralFan' is deprecated, use 'polyhedral_fan' instead.", :PolyhedralFan) return polyhedral_fan(itr) @@ -283,11 +283,11 @@ function PolyhedralFan(C::Cone{T}) where T<:scalar_types end function PolyhedralFan{T}(Rays::AbstractCollection[RayVector], LS::AbstractCollection[RayVector], Incidence::Matrix{Bool}) where T<:scalar_types Base.depwarn("'PolyhedralFan{$T}(x...)' is deprecated, use 'polyhedral_fan($T, x...)' instead.", :PolyhedralFan) - return polyhedral_fan(T, Rays, LS, Incidence) + return polyhedral_fan(T, Incidence, Rays, LS) end function PolyhedralFan{T}(Rays::AbstractCollection[RayVector], Incidence::Matrix{Bool}) where T<:scalar_types Base.depwarn("'PolyhedralFan{$T}(x...)' is deprecated, use 'polyhedral_fan($T, x...)' instead.", :PolyhedralFan) - return polyhedral_fan(T, Rays, Incidence) + return polyhedral_fan(T, Incidence, Rays) end # SubdivisionOfPoints -> subdivision_of_points @@ -494,3 +494,14 @@ end @deprecate revlex(v::AbstractVector{<:MPolyRingElem}) invlex(v::AbstractVector{<:MPolyRingElem}) @deprecate negrevlex(R::MPolyRing) ngeinvlex(R::MPolyRing) @deprecate negrevlex(v::AbstractVector{<:MPolyRingElem}) neginvlex(v::AbstractVector{<:MPolyRingElem}) +@deprecate polyhedral_fan(f::scalar_type_or_field, Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(f, Incidence, Rays, nothing; non_redundant) +@deprecate polyhedral_fan(Rays::AbstractCollection[RayVector], LS::Union{AbstractCollection[RayVector], Nothing}, Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(QQFieldElem, Incidence, Rays, LS; non_redundant) +@deprecate polyhedral_fan(Rays::AbstractCollection[RayVector], Incidence::IncidenceMatrix; non_redundant::Bool = false) polyhedral_fan(QQFieldElem, Incidence, Rays; non_redundant) +@deprecate polyhedral_fan(f::scalar_type_or_field, + Rays::AbstractCollection[RayVector], + LS::Union{AbstractCollection[RayVector], Nothing}, + Incidence::IncidenceMatrix; + non_redundant::Bool = false) polyhedral_fan(f, Incidence, Rays, LS; non_redundant) +@deprecate polyhedral_fan(f::scalar_type_or_field, Rays::AbstractCollection[RayVector], LS::AbstractCollection[RayVector], Incidence::Matrix{Bool}) polyhedral_fan(f, Rays, LS, IncidenceMatrix(Polymake.IncidenceMatrix(Incidence))) +@deprecate polyhedral_fan(f::scalar_type_or_field, Rays::AbstractCollection[RayVector], Incidence::Matrix{Bool}) polyhedral_fan(f, Rays, IncidenceMatrix(Polymake.IncidenceMatrix(Incidence))) +@deprecate normal_toric_variety(rays::AbstractCollection[RayVector], max_cones::IncidenceMatrix; non_redundant::Bool = false) normal_toric_variety(max_cones, rays; non_redundant) diff --git a/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl b/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl index e9296a3982ba..019216a78672 100644 --- a/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl +++ b/test/AlgebraicGeometry/ToricVarieties/affine_normal_varieties.jl @@ -5,7 +5,7 @@ antv3 = affine_normal_toric_variety(antv2) antv4 = affine_normal_toric_variety(Oscar.positive_hull([1 0])) antv5 = affine_space(NormalToricVariety, 2) - antv6 = normal_toric_variety([[1, 0, 0], [1, 0, 1], [1, 1, 1], [1, 1, 0]], [[1, 2, 3, 4]]) + antv6 = normal_toric_variety(IncidenceMatrix([[1,2,3,4]]), [[1, 0, 0], [1, 0, 1], [1, 1, 1], [1, 1, 0]]) @testset "Basic properties" begin @test is_smooth(antv) == false diff --git a/test/AlgebraicGeometry/ToricVarieties/direct_products.jl b/test/AlgebraicGeometry/ToricVarieties/direct_products.jl index f6b772b4a482..a617af339b27 100644 --- a/test/AlgebraicGeometry/ToricVarieties/direct_products.jl +++ b/test/AlgebraicGeometry/ToricVarieties/direct_products.jl @@ -1,6 +1,6 @@ @testset "Direct products" begin - F5 = normal_toric_variety([[1, 0], [0, 1], [-1, 5], [0, -1]], [[1, 2], [2, 3], [3, 4], [4, 1]]) + F5 = normal_toric_variety(IncidenceMatrix([[1, 2], [2, 3], [3, 4], [4, 1]]), [[1, 0], [0, 1], [-1, 5], [0, -1]]) P2 = normal_toric_variety(normal_fan(Oscar.simplex(2))) variety = F5 * P2 diff --git a/test/AlgebraicGeometry/ToricVarieties/intersection_numbers.jl b/test/AlgebraicGeometry/ToricVarieties/intersection_numbers.jl index e40bf985633c..e83d5a469cf9 100644 --- a/test/AlgebraicGeometry/ToricVarieties/intersection_numbers.jl +++ b/test/AlgebraicGeometry/ToricVarieties/intersection_numbers.jl @@ -2,9 +2,9 @@ antv = affine_normal_toric_variety(Oscar.positive_hull([1 1; -1 1])) - antv2 = normal_toric_variety([[1, 0, 0], [1, 0, 1], [1, 1, 1], [1, 1, 0]], [[1, 2, 3, 4]]) + antv2 = normal_toric_variety(IncidenceMatrix([[1,2,3,4]]), [[1, 0, 0], [1, 0, 1], [1, 1, 1], [1, 1, 0]]) - v = normal_toric_variety([[1, 0], [0, 1], [-1, -1]], [[1], [2], [3]]) + v = normal_toric_variety(IncidenceMatrix([[1], [2], [3]]), [[1, 0], [0, 1], [-1, -1]]) dP1 = del_pezzo_surface(NormalToricVariety, 1) c0 = cohomology_class(dP1, gens(cohomology_ring(dP1))[1]) diff --git a/test/AlgebraicGeometry/ToricVarieties/line_bundle_cohomologies.jl b/test/AlgebraicGeometry/ToricVarieties/line_bundle_cohomologies.jl index 977123ae3314..ec7bc5eed471 100644 --- a/test/AlgebraicGeometry/ToricVarieties/line_bundle_cohomologies.jl +++ b/test/AlgebraicGeometry/ToricVarieties/line_bundle_cohomologies.jl @@ -5,8 +5,8 @@ F5 = hirzebruch_surface(NormalToricVariety, 5) ray_generators = [[1, 0, 0,-2,-3], [0, 1, 0,-2,-3], [0, 0, 1,-2,-3], [-1,-1,-1,-2,-3], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1], [0, 0, 0,-2,-3]] - max_cones = [[1, 2, 3, 5, 6], [1, 2, 3, 5, 7], [1, 2, 3, 6, 7], [2, 3, 4, 5, 6], [2, 3, 4, 5, 7], [2, 3, 4, 6, 7], [1, 3, 4, 5, 6], [1, 3, 4, 5, 7], [1, 3, 4, 6, 7], [1, 2, 4, 5, 6], [1, 2, 4, 5, 7], [1, 2, 4, 6, 7]] - weierstrass_over_p3 = normal_toric_variety(ray_generators, max_cones; non_redundant = true) + max_cones = IncidenceMatrix([[1, 2, 3, 5, 6], [1, 2, 3, 5, 7], [1, 2, 3, 6, 7], [2, 3, 4, 5, 6], [2, 3, 4, 5, 7], [2, 3, 4, 6, 7], [1, 3, 4, 5, 6], [1, 3, 4, 5, 7], [1, 3, 4, 6, 7], [1, 2, 4, 5, 6], [1, 2, 4, 5, 7], [1, 2, 4, 6, 7]]) + weierstrass_over_p3 = normal_toric_variety(max_cones, ray_generators; non_redundant = true) l = toric_line_bundle(dP3, [1, 2, 3, 4]) l2 = toric_line_bundle(divisor_of_character(F5, [1, 2])) diff --git a/test/AlgebraicGeometry/ToricVarieties/subvarieties.jl b/test/AlgebraicGeometry/ToricVarieties/subvarieties.jl index e5c86655e995..d54d38dc197d 100644 --- a/test/AlgebraicGeometry/ToricVarieties/subvarieties.jl +++ b/test/AlgebraicGeometry/ToricVarieties/subvarieties.jl @@ -1,6 +1,6 @@ @testset "Closed subvarieties" begin - antv = normal_toric_variety([[1, 0, 0], [1, 0, 1], [1, 1, 1], [1, 1, 0]], [[1, 2, 3, 4]]) + antv = normal_toric_variety(IncidenceMatrix([[1,2,3,4]]), [[1, 0, 0], [1, 0, 1], [1, 1, 1], [1, 1, 0]]) ntv = normal_toric_variety(cube(2)) (x1, x2, y1, y2) = gens(cox_ring(ntv)); diff --git a/test/AlgebraicGeometry/ToricVarieties/toric_schemes.jl b/test/AlgebraicGeometry/ToricVarieties/toric_schemes.jl index 7fd4472bf64f..7dde63deddc6 100644 --- a/test/AlgebraicGeometry/ToricVarieties/toric_schemes.jl +++ b/test/AlgebraicGeometry/ToricVarieties/toric_schemes.jl @@ -97,7 +97,7 @@ end @testset "Lazy glueings" begin - f = polyhedral_fan([0 0 1; 1 0 1; 0 1 0; -1 0 1; -1 -1 1; 0 -1 1], IncidenceMatrix([[1, 2, 3],[1, 4, 5, 6]])) + f = polyhedral_fan(IncidenceMatrix([[1, 2, 3],[1, 4, 5, 6]]), [0 0 1; 1 0 1; 0 1 0; -1 0 1; -1 -1 1; 0 -1 1]) n_maximal_cones(f) ntv = normal_toric_variety(f) X = underlying_scheme(ntv) diff --git a/test/PolyhedralGeometry/extended.jl b/test/PolyhedralGeometry/extended.jl index 1d5b850e1c14..a61a90d78440 100644 --- a/test/PolyhedralGeometry/extended.jl +++ b/test/PolyhedralGeometry/extended.jl @@ -205,7 +205,7 @@ lincone = positive_hull([1 0 0], [0 1 0]) @test positive_hull(rays_modulo_lineality(lincone)...) == lincone - @test ambient_dim(polyhedral_fan(rays_modulo_lineality(lincone)..., IM)) == 3 + @test ambient_dim(polyhedral_fan(IM, rays_modulo_lineality(lincone)...)) == 3 end diff --git a/test/PolyhedralGeometry/polyhedral_fan.jl b/test/PolyhedralGeometry/polyhedral_fan.jl index e8edddc3ad98..9320a78d65b2 100644 --- a/test/PolyhedralGeometry/polyhedral_fan.jl +++ b/test/PolyhedralGeometry/polyhedral_fan.jl @@ -12,12 +12,12 @@ I3 = [1 0 0; 0 1 0; 0 0 1] incidence1 = IncidenceMatrix([[1,2],[2,3]]) incidence2 = IncidenceMatrix([[1,2]]) - @test polyhedral_fan(f, I3, incidence1) isa PolyhedralFan{T} - F1 = polyhedral_fan(f, I3, incidence1) - F1NR = polyhedral_fan(f, I3, incidence1; non_redundant = true) - @test polyhedral_fan(f, I3, incidence1) isa PolyhedralFan{T} - F2 = polyhedral_fan(f, R, L, incidence2) - F2NR = polyhedral_fan(f, R, L, incidence2; non_redundant = true) + @test polyhedral_fan(f, incidence1, I3) isa PolyhedralFan{T} + F1 = polyhedral_fan(f, incidence1, I3) + F1NR = polyhedral_fan(f, incidence1, I3; non_redundant = true) + @test polyhedral_fan(f, incidence1, I3) isa PolyhedralFan{T} + F2 = polyhedral_fan(f, incidence2, R, L) + F2NR = polyhedral_fan(f, incidence2, R, L; non_redundant = true) @test Polymake.exists(Oscar.pm_object(F2NR), "RAYS") @test !Polymake.exists(Oscar.pm_object(F2NR), "INPUT_RAYS") @@ -66,7 +66,7 @@ @test cones(IncidenceMatrix, F1, 2) == incidence1 II = ray_indices(maximal_cones(NFsquare)) - NF0 = polyhedral_fan(rays(NFsquare), II) + NF0 = polyhedral_fan(II, rays(NFsquare)) @test nrays(NF0) == 4 FF0 = face_fan(C0) @test nrays(FF0) == 4 @@ -141,7 +141,7 @@ end end @testset "Star Subdivision" begin - f = polyhedral_fan([1 0 0; 1 1 0; 1 1 1; 1 0 1], IncidenceMatrix([[1,2,3,4]])) + f = polyhedral_fan(IncidenceMatrix([[1,2,3,4]]), [1 0 0; 1 1 0; 1 1 1; 1 0 1]) @test is_pure(f) @test is_fulldimensional(f) v0 = [1;0;0] @@ -154,7 +154,7 @@ end @test n_maximal_cones(sf1) == 3 @test n_maximal_cones(sf2) == 4 - ff = polyhedral_fan([1 0 0; -1 0 0; 0 1 0], IncidenceMatrix([[1],[2,3]])) + ff = polyhedral_fan(IncidenceMatrix([[1],[2,3]]), [1 0 0; -1 0 0; 0 1 0]) @test !is_pure(ff) @test !is_fulldimensional(ff) w0 = [1;0;0] diff --git a/test/PolyhedralGeometry/scalar_types.jl b/test/PolyhedralGeometry/scalar_types.jl index 5a80bf028ba9..c2e9f3e19676 100644 --- a/test/PolyhedralGeometry/scalar_types.jl +++ b/test/PolyhedralGeometry/scalar_types.jl @@ -45,7 +45,7 @@ @test recession_cone(ms) == positive_hull(E, [0 0 0 1]) end nf = normal_fan(sd) - nfc = polyhedral_fan(E, rays(nf), maximal_cones(IncidenceMatrix,nf)) + nfc = polyhedral_fan(E, maximal_cones(IncidenceMatrix,nf), rays(nf)) @test is_regular(nfc) @testset "Scalar detection" begin