@@ -204,13 +204,14 @@ void ContainerBasePrivate::copyState(Interface::iterator external, const Interfa
204204}
205205
206206void ContainerBasePrivate::liftSolution (const SolutionBasePtr& solution, const InterfaceState* internal_from,
207- const InterfaceState* internal_to, const InterfaceState* new_external) {
207+ const InterfaceState* internal_to, InterfaceState* new_from,
208+ InterfaceState* new_to) {
208209 const bool create_from{ requiredInterface ().testFlag (WRITES_PREV_END) };
209210 const bool create_to{ requiredInterface ().testFlag (WRITES_NEXT_START) };
210211
211212 // external states, nullptr if they don't exist yet
212- const InterfaceState* external_from{ create_from ? new_external : internalToExternalMap ().at (internal_from) };
213- const InterfaceState* external_to{ create_to ? new_external : internalToExternalMap ().at (internal_to) };
213+ const InterfaceState* external_from{ create_from ? new_from : internalToExternalMap ().at (internal_from) };
214+ const InterfaceState* external_to{ create_to ? new_to : internalToExternalMap ().at (internal_to) };
214215
215216 // computeCost
216217 // we can pass intern_{from/to} here because in this case the lifted states that might be created later
@@ -222,17 +223,16 @@ void ContainerBasePrivate::liftSolution(const SolutionBasePtr& solution, const I
222223 return ;
223224 }
224225
225- auto create_state = [this , new_external](const InterfaceState& internal) {
226- InterfaceState* external{ storeState (new_external ? InterfaceState{ *new_external } :
227- InterfaceState{ internal }) };
226+ auto create_state = [this ](const InterfaceState& internal, InterfaceState* new_external) {
227+ InterfaceState* external{ storeState (new_external ? std::move (*new_external) : InterfaceState{ internal }) };
228228 internalToExternalMap ().insert (std::make_pair (&internal, external));
229229 return external;
230230 };
231231
232232 if (create_from)
233- external_from = create_state (*internal_from);
233+ external_from = create_state (*internal_from, new_from );
234234 if (create_to)
235- external_to = create_state (*internal_to);
235+ external_to = create_state (*internal_to, new_to );
236236
237237 assert (external_from);
238238 assert (external_to);
@@ -749,7 +749,7 @@ void ParallelContainerBase::liftSolution(const SolutionBase& solution, double co
749749 solution.start (), solution.end ());
750750}
751751
752- void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& modified_solution, const SolutionBase & child_solution) {
752+ void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& modified_solution, const SolutionBase& child_solution) {
753753 // child_solution is correctly prepared by a child of this container
754754 assert (child_solution.creator ());
755755 assert (child_solution.creator ()->parent () == this );
@@ -758,13 +758,22 @@ void ParallelContainerBase::liftModifiedSolution(SolutionBasePtr&& modified_solu
758758 child_solution.start (), child_solution.end ());
759759}
760760
761- void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr && new_solution, InterfaceState && new_propagated_state, const SolutionBase & child_solution) {
761+ void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& new_solution, InterfaceState&& new_propagated_state, const SolutionBase& child_solution) {
762762 assert (child_solution.creator ());
763763 assert (child_solution.creator ()->parent () == this );
764+ assert (pimpl ()->requiredInterface () == PROPAGATE_FORWARDS || pimpl ()->requiredInterface () == PROPAGATE_BACKWARDS);
764765
765- pimpl ()->liftSolution (std::move (new_solution), child_solution.start (), child_solution.end (), &new_propagated_state);
766+ pimpl ()->liftSolution (std::move (new_solution), child_solution.start (), child_solution.end (), &new_propagated_state, &new_propagated_state );
766767}
767768
769+ void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& new_solution, InterfaceState&& new_from, InterfaceState&& new_to, const SolutionBase& child_solution) {
770+ assert (child_solution.creator ());
771+ assert (child_solution.creator ()->parent () == this );
772+
773+ pimpl ()->liftSolution (std::move (new_solution), child_solution.start (), child_solution.end (), &new_from, &new_to);
774+ }
775+
776+
768777WrapperBasePrivate::WrapperBasePrivate (WrapperBase* me, const std::string& name)
769778 : ParallelContainerBasePrivate(me, name) {}
770779
0 commit comments