Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#28633 closed enhancement (fixed)

Add __copy__ method to backend normaliz of Polyhedron

Reported by: gh-kliem Owned by:
Priority: minor Milestone: sage-9.0
Component: geometry Keywords: polyhedra, normaliz
Cc: Jean-Philippe Labbé Merged in:
Authors: Jonathan Kliem Reviewers: Jean-Philippe Labbé, Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: d30c087 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jean-Philippe Labbé)

Currently, when copying a normaliz polyhedron, the _normaliz_cone is not copied appropriately:

sage: p = polytopes.hypercube(7,backend='normaliz')
sage: pcopy = copy(p)
sage: p == pcopy
True
sage: p is pcopy
False
sage: pcone = p._normaliz_cone
sage: pcopycone = pcopy._normaliz_cone
sage: pcone == pcopycone
True
sage: pcone is pcopycone
True

This ticket implements the __copy__ method in the normaliz backend by making use of the method NmzConeCopy of PyNormaliz. This way, a copy of a polyhedron with backend Normaliz contains a true copy of the normaliz cone.

Change History (10)

comment:1 Changed 3 years ago by gh-kliem

Branch: public/28633
Commit: ed7bfd2273c5c33cdd0be4eb92ada02f82e5790b
Status: newneeds_review

New commits:

ed7bfd2polyhedra with backend normaliz make a copy of the cone when copying

comment:2 Changed 3 years ago by Jean-Philippe Labbé

Cc: Jean-Philippe Labbé added

comment:3 Changed 3 years ago by Jean-Philippe Labbé

Description: modified (diff)
Summary: Make a true copy of normaliz coneAdd __copy__ method to backend normaliz of Polyhedron

comment:4 Changed 3 years ago by Jean-Philippe Labbé

Description: modified (diff)

comment:5 Changed 3 years ago by Jean-Philippe Labbé

Status: needs_reviewneeds_work

Optional flags are missing.

comment:6 Changed 3 years ago by git

Commit: ed7bfd2273c5c33cdd0be4eb92ada02f82e5790bd30c08770deb29882a05fc0c49223696fed92cdc

Branch pushed to git repo; I updated commit sha1. New commits:

d30c087added `# optional -pynormaliz`

comment:7 Changed 3 years ago by gh-kliem

Status: needs_workneeds_review

comment:8 Changed 3 years ago by Travis Scrimshaw

Reviewers: Jean-Philippe Labbé, Travis Scrimshaw
Status: needs_reviewpositive_review

LGTM. JP, I added you as a reviewer for comment:5.

comment:9 Changed 3 years ago by Volker Braun

Branch: public/28633d30c08770deb29882a05fc0c49223696fed92cdc
Resolution: fixed
Status: positive_reviewclosed

comment:10 in reply to:  8 Changed 3 years ago by Jean-Philippe Labbé

Commit: d30c08770deb29882a05fc0c49223696fed92cdc

Replying to tscrim:

LGTM. JP, I added you as a reviewer for comment:5.

LGTM too.

Note: See TracTickets for help on using tickets.