@@ -203,13 +203,14 @@ void ContainerBasePrivate::copyState(Interface::iterator external, const Interfa
203203}
204204
205205void ContainerBasePrivate::liftSolution (const SolutionBasePtr& solution, const InterfaceState* internal_from,
206- const InterfaceState* internal_to, const InterfaceState* new_external) {
206+ const InterfaceState* internal_to, InterfaceState* new_from,
207+ InterfaceState* new_to) {
207208 const bool create_from{ requiredInterface ().testFlag (WRITES_PREV_END) };
208209 const bool create_to{ requiredInterface ().testFlag (WRITES_NEXT_START) };
209210
210211 // external states, nullptr if they don't exist yet
211- const InterfaceState* external_from{ create_from ? new_external : internalToExternalMap ().at (internal_from) };
212- const InterfaceState* external_to{ create_to ? new_external : internalToExternalMap ().at (internal_to) };
212+ const InterfaceState* external_from{ create_from ? new_from : internalToExternalMap ().at (internal_from) };
213+ const InterfaceState* external_to{ create_to ? new_to : internalToExternalMap ().at (internal_to) };
213214
214215 // computeCost
215216 // we can pass intern_{from/to} here because in this case the lifted states that might be created later
@@ -221,17 +222,16 @@ void ContainerBasePrivate::liftSolution(const SolutionBasePtr& solution, const I
221222 return ;
222223 }
223224
224- auto create_state = [this , new_external](const InterfaceState& internal) {
225- InterfaceState* external{ storeState (new_external ? InterfaceState{ *new_external } :
226- InterfaceState{ internal }) };
225+ auto create_state = [this ](const InterfaceState& internal, InterfaceState* new_external) {
226+ InterfaceState* external{ storeState (new_external ? std::move (*new_external) : InterfaceState{ internal }) };
227227 internalToExternalMap ().insert (std::make_pair (&internal, external));
228228 return external;
229229 };
230230
231231 if (create_from)
232- external_from = create_state (*internal_from);
232+ external_from = create_state (*internal_from, new_from );
233233 if (create_to)
234- external_to = create_state (*internal_to);
234+ external_to = create_state (*internal_to, new_to );
235235
236236 assert (external_from);
237237 assert (external_to);
@@ -750,7 +750,7 @@ void ParallelContainerBase::liftSolution(const SolutionBase& solution, double co
750750 solution.start (), solution.end ());
751751}
752752
753- void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& modified_solution, const SolutionBase & child_solution) {
753+ void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& modified_solution, const SolutionBase& child_solution) {
754754 // child_solution is correctly prepared by a child of this container
755755 assert (child_solution.creator ());
756756 assert (child_solution.creator ()->parent () == this );
@@ -759,13 +759,23 @@ void ParallelContainerBase::liftModifiedSolution(SolutionBasePtr&& modified_solu
759759 child_solution.start (), child_solution.end ());
760760}
761761
762- void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr && new_solution, InterfaceState && new_propagated_state, const SolutionBase & child_solution) {
762+ void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& new_solution, InterfaceState&& new_propagated_state, const SolutionBase& child_solution) {
763763 assert (child_solution.creator ());
764764 assert (child_solution.creator ()->parent () == this );
765+ assert (pimpl ()->requiredInterface () == PROPAGATE_FORWARDS || pimpl ()->requiredInterface () == PROPAGATE_BACKWARDS);
765766
766- pimpl ()->liftSolution (std::move (new_solution), child_solution.start (), child_solution.end (), &new_propagated_state);
767+ pimpl ()->liftSolution (std::move (new_solution), child_solution.start (), child_solution.end (), &new_propagated_state, &new_propagated_state );
767768}
768769
770+ void ParallelContainerBase::liftModifiedSolution (SolutionBasePtr&& new_solution, InterfaceState&& new_from, InterfaceState&& new_to, const SolutionBase& child_solution) {
771+ assert (child_solution.creator ());
772+ assert (child_solution.creator ()->parent () == this );
773+ assert (pimpl ()->requiredInterface () == PROPAGATE_FORWARDS || pimpl ()->requiredInterface () == PROPAGATE_BACKWARDS);
774+
775+ pimpl ()->liftSolution (std::move (new_solution), child_solution.start (), child_solution.end (), &new_from, &new_to);
776+ }
777+
778+
769779WrapperBasePrivate::WrapperBasePrivate (WrapperBase* me, const std::string& name)
770780 : ParallelContainerBasePrivate(me, name) {}
771781
0 commit comments