diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index fc59f0b785e827958ac38abf33c3855e2d133b25..8159273312baf92ec354f5a3c3e4d7f5b554b136 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -1088,16 +1088,24 @@ void Problem::print(int depth, std::ostream& stream, bool constr_by, bool metric for (auto c : f->getFactorList()) { stream << " Fac" << c->id() << " " << c->getType() << " -->"; - if (c->getFrameOther() == nullptr && c->getCaptureOther() == nullptr && c->getFeatureOther() == nullptr && c->getLandmarkOther() == nullptr) + if ( c->getFrameOtherList() .empty() + && c->getCaptureOtherList() .empty() + && c->getFeatureOtherList() .empty() + && c->getLandmarkOtherList().empty()) stream << " Abs"; - if (c->getFrameOther() != nullptr) - stream << " Frm" << c->getFrameOther()->id(); - if (c->getCaptureOther() != nullptr) - stream << " Cap" << c->getCaptureOther()->id(); - if (c->getFeatureOther() != nullptr) - stream << " Fac" << c->getFeatureOther()->id(); - if (c->getLandmarkOther() != nullptr) - stream << " Lmk" << c->getLandmarkOther()->id(); + + for (const auto& Fow : c->getFrameOtherList()) + if (!Fow.expired()) + stream << " Frm" << Fow.lock()->id(); + for (const auto& Cow : c->getCaptureOtherList()) + if (!Cow.expired()) + stream << " Cap" << Cow.lock()->id(); + for (const auto& fow : c->getFeatureOtherList()) + if (!fow.expired()) + stream << " Ftr" << fow.lock()->id(); + for (const auto& Low : c->getLandmarkOtherList()) + if (!Low.expired()) + stream << " Lmk" << Low.lock()->id(); stream << std::endl; } // for c }