Opened 9 months ago
Last modified 6 weeks ago
#27448 needs_work enhancement
compute normal vectors of surface faces of polyhedron
Reported by:  dkrenn  Owned by:  

Priority:  major  Milestone:  sage8.9 
Component:  geometry  Keywords:  
Cc:  Merged in:  
Authors:  Daniel Krenn  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  u/dkrenn/surfacenormal (Commits)  Commit:  8f23aa949086e9cb358a2d50b67ad85f2efb7fdd 
Dependencies:  Stopgaps: 
Description
Change History (26)
comment:1 Changed 9 months ago by
 Branch set to u/dkrenn/surfacenormal
comment:2 Changed 9 months ago by
 Commit set to 297ff0033b0e6a568e50d9466ac4fccc2cd60805
 Status changed from new to needs_review
comment:3 Changed 9 months ago by
 Commit changed from 297ff0033b0e6a568e50d9466ac4fccc2cd60805 to d0b6b79ae32affd6124af88e4a37ad0047f84713
Branch pushed to git repo; I updated commit sha1. New commits:
d0b6b79  Trac #27448: simplify methods and restrict to one algorithm for all

comment:4 followup: ↓ 6 Changed 9 months ago by
Invalid Python 3 syntax found: invalid syntax (face.py, line 587)
comment:5 Changed 9 months ago by
 Commit changed from d0b6b79ae32affd6124af88e4a37ad0047f84713 to acb48f667435c8e76cc82383da878b4f1ebfca3a
Branch pushed to git repo; I updated commit sha1. New commits:
acb48f6  Trac #27448: Py3 exception

comment:6 in reply to: ↑ 4 Changed 9 months ago by
Replying to chapoton:
Invalid Python 3 syntax found: invalid syntax (face.py, line 587)
Indeed, missed this one. Thanks, is now corrected.
comment:7 followup: ↓ 14 Changed 9 months ago by
please add one example with vertices in AA
comment:8 followup: ↓ 15 Changed 9 months ago by
Why is it cached!?
comment:9 followup: ↓ 16 Changed 9 months ago by
 Status changed from needs_review to needs_info
What is that intended for?
if T.base_ring() in (AA, QQbar): def exactify(c): c.exactify() try: return QQ(c) except (ValueError, TypeError): return c T = T.apply_map(lambda c: exactify(c))
If it is of any use, it should be carefully explained in the code.
comment:10 followup: ↓ 17 Changed 9 months ago by
Isn't it a big waste to compute the matrix T
each time you ask for a normal vector. Wouldn't it make more sense to compute it once and for all?
comment:11 followup: ↓ 18 Changed 9 months ago by
Documentation must include examples with unbounded faces. Especially the degenerate case where the polyhedron is a vector space.
comment:12 Changed 9 months ago by
 Milestone changed from sage8.7 to sage8.8
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)
comment:13 Changed 8 months ago by
 Commit changed from acb48f667435c8e76cc82383da878b4f1ebfca3a to 8f23aa949086e9cb358a2d50b67ad85f2efb7fdd
Branch pushed to git repo; I updated commit sha1. New commits:
4b7a774  Trac #27448: cache matrix

53e3b14  Trac #27448: refactor imports

82e7613  Trac #27448: more careful use of exactify

0c359ce  Trac #27448: move more code around (fixup caching)

919bebf  Trac #27448: explain purpose of exactifycode

769ba63  Trac #27448 doctest for unbounded polyhedron

8f23aa9  Trac #27448: doctest for polyhedron with vertices in AA

comment:14 in reply to: ↑ 7 Changed 8 months ago by
comment:15 in reply to: ↑ 8 Changed 8 months ago by
Replying to vdelecroix:
Why is it cached!?
Because for my computation (related to #27447) it reduced the computation time by a factor 7 or 8.
comment:16 in reply to: ↑ 9 Changed 8 months ago by
Replying to vdelecroix:
Code commented inWhat is that intended for?
if T.base_ring() in (AA, QQbar): def exactify(c): c.exactify() try: return QQ(c) except (ValueError, TypeError): return c T = T.apply_map(lambda c: exactify(c))If it is of any use, it should be carefully explained in the code.
919bebf  Trac #27448: explain purpose of exactifycode

comment:17 in reply to: ↑ 10 Changed 8 months ago by
Replying to vdelecroix:
Indeed. Done inIsn't it a big waste to compute the matrix
T
each time you ask for a normal vector. Wouldn't it make more sense to compute it once and for all?
4b7a774  Trac #27448: cache matrix

but also see the other commits (some more changes were done).
comment:18 in reply to: ↑ 11 Changed 8 months ago by
Replying to vdelecroix:
Done inDocumentation must include examples with unbounded faces. Especially the degenerate case where the polyhedron is a vector space.
769ba63  Trac #27448 doctest for unbounded polyhedron

comment:19 Changed 8 months ago by
 Status changed from needs_info to needs_review
comment:20 Changed 8 months ago by
All comments are incorporated, so please review again.
comment:21 Changed 8 months ago by
I don't understand something. According to the comment When the polyhedron is rational, ... We correct this below.
the following should not fail
c.exactify() try: return QQ(c)
comment:22 Changed 8 months ago by
There is no example of polyhedra defined over a number field such as QuadraticField(2)
or NumberField(x^3  2, 'a', embedding=AA(2)^(1/3))
.
comment:23 Changed 8 months ago by
If the matrix T
is supposed to belong to the ground field, isn't there a more direct way to compute it wihtout going through A
that might involve a lot of different square roots?
comment:24 Changed 8 months ago by
 Reviewers set to Vincent Delecroix
 Status changed from needs_review to needs_work
comment:25 Changed 6 months ago by
 Milestone changed from sage8.8 to sage8.9
Tickets still needing working or clarification should be moved to the next release milestone at the soonest (please feel free to revert if you think the ticket is close to being resolved).
comment:26 Changed 6 weeks ago by
Please have a look at the related #17215.
Also, it seems that in the doctests, the older version of the repr
for faces is used... This should be updated.
New commits:
Trac #27448: compute normal vectors of face