In its current implementation, the translate function creates a new object for the translated polyhedron. In cases where a large number of translations are applied, this quickly becomes an unnecessary copy.
Can we implement an in-place version translate!(p::Polyhedron, v) that does not create a new object when the translation is applied? As an extension to my previous issue #245 , can we implement an in-place version of the hypothetical rotate function too?
One final point that is closely related to the translate function - this code from the source:
function translate(p::Polyhedron, v)
if hrepiscomputed(p)
htranslate(p, v)
else
vtranslate(p, v)
end
end
When a translation is applied to a Polyhedron that has both the H- and the V-representations computed, the V-representation is lost, incurring an expensive recomputation step needed every time translate is used. Can we preserve both representations? Thinking of the implementation, this would need to use the in-place version of translate for each representation, respectively.
In its current implementation, the
translate
function creates a new object for the translated polyhedron. In cases where a large number of translations are applied, this quickly becomes an unnecessary copy.Can we implement an in-place version
translate!(p::Polyhedron, v)
that does not create a new object when the translation is applied? As an extension to my previous issue #245 , can we implement an in-place version of the hypotheticalrotate
function too?One final point that is closely related to the
translate
function - this code from the source:When a translation is applied to a
Polyhedron
that has both the H- and the V-representations computed, the V-representation is lost, incurring an expensive recomputation step needed every timetranslate
is used. Can we preserve both representations? Thinking of the implementation, this would need to use the in-place version oftranslate
for each representation, respectively.