Opened 18 months ago

Closed 18 months ago

Last modified 18 months 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: jipilab 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 jipilab)

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 18 months ago by gh-kliem

  • Branch set to public/28633
  • Commit set to ed7bfd2273c5c33cdd0be4eb92ada02f82e5790b
  • Status changed from new to needs_review

New commits:

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

comment:2 Changed 18 months ago by jipilab

  • Cc jipilab added

comment:3 Changed 18 months ago by jipilab

  • Description modified (diff)
  • Summary changed from Make a true copy of normaliz cone to Add __copy__ method to backend normaliz of Polyhedron

comment:4 Changed 18 months ago by jipilab

  • Description modified (diff)

comment:5 Changed 18 months ago by jipilab

  • Status changed from needs_review to needs_work

Optional flags are missing.

comment:6 Changed 18 months ago by git

  • Commit changed from ed7bfd2273c5c33cdd0be4eb92ada02f82e5790b to d30c08770deb29882a05fc0c49223696fed92cdc

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

d30c087added `# optional -pynormaliz`

comment:7 Changed 18 months ago by gh-kliem

  • Status changed from needs_work to needs_review

comment:8 follow-up: Changed 18 months ago by tscrim

  • Reviewers set to Jean-Philippe Labbé, Travis Scrimshaw
  • Status changed from needs_review to positive_review

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

comment:9 Changed 18 months ago by vbraun

  • Branch changed from public/28633 to d30c08770deb29882a05fc0c49223696fed92cdc
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:10 in reply to: ↑ 8 Changed 18 months ago by jipilab

  • Commit d30c08770deb29882a05fc0c49223696fed92cdc deleted

Replying to tscrim:

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

LGTM too.

Note: See TracTickets for help on using tickets.