Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizing of subdivision #163

Closed
saschatimme opened this issue Oct 16, 2019 · 1 comment
Closed

Visualizing of subdivision #163

saschatimme opened this issue Oct 16, 2019 · 1 comment

Comments

@saschatimme
Copy link
Collaborator

If I want to visualize a polyhedral subdivision I get a rather cryptic error.

julia> using Polymake

julia> A = [2 1 0; 0 0 2]'
3×2 LinearAlgebra.Adjoint{Int64,Array{Int64,2}}:
 2  0
 1  0
 0  2

julia> lift = Rational{Int64}[5//1, 3//1, 5//1]
3-element Array{Rational{Int64},1}:
 5//1
 3//1
 5//1

julia> subdiv = @pm Fan.SubdivisionOfPoints(POINTS=A, WEIGHTS=lift)
type: SubdivisionOfPoints<Rational>

POINTS
1 0
1 0
0 1


WEIGHTS
5 3 5


julia> Fan.visual(subdiv)
ERROR: Can't locate object method "code" via package "1" (perhaps you forgot to load "1"?) at /Users/sascha/.julia/dev/Polymake/deps/usr/share/polymake/perllib/Polymake/Core/ObjectType.pm line 1025.

Stacktrace:
 [1] internal_call_method at ./none:0 [inlined]
 [2] #`#42(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Polymake.Fan.visual), ::Polymake.pm_perl_ObjectAllocated) at /Users/sascha/.julia/dev/Polymake/src/meta.jl:213
 [3] visual(::Polymake.pm_perl_ObjectAllocated) at /Users/sascha/.julia/dev/Polymake/src/meta.jl:209
 [4] top-level scope at none:0

Visualizing our favourite 3-cube on the other hand works perfectly.

@benlorenz
Copy link
Member

benlorenz commented Oct 17, 2019

please homogenize your input:

julia> A = [1 1 1; 2 1 0; 0 0 2]'
3×3 LinearAlgebra.Adjoint{Int64,Array{Int64,2}}:
 1  2  0
 1  1  0
 1  0  2

julia> lift = Rational{Int64}[5//1, 3//1, 5//1]
3-element Array{Rational{Int64},1}:
 5//1
 3//1
 5//1

julia> subdiv = @pm Fan.SubdivisionOfPoints(POINTS=A, WEIGHTS=lift)
type: SubdivisionOfPoints<Rational>

POINTS
1 2 0
1 1 0
1 0 2


WEIGHTS
5 3 5


julia> Fan.visual(subdiv)

screenshot

edit: There might still be something wrong because I think technically your input is valid ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants