VariableSet GeneralConstraint::getVariables( const SatID& sat ) { VariableSet vset; VariableSet unkSet( getVariables() ); if(sat==Variable::noSats) return vset; for( VariableSet::const_iterator itv = unkSet.begin(); itv != unkSet.end(); ++itv ) { if( !(!itv->getSourceIndexed() && itv->getSatIndexed()) ) { continue; } if(sat==Variable::allSats) { vset.insert(*itv); } else if(sat==Variable::allGPSSats) { if(itv->getSatellite().system==SatID::systemGPS) vset.insert(*itv); } else if(sat==Variable::allGlonassSats) { if(itv->getSatellite().system==SatID::systemGlonass) vset.insert(*itv); } else if(sat==Variable::allGalileoSats) { if(itv->getSatellite().system==SatID::systemGalileo) vset.insert(*itv); } else { if(itv->getSatellite()==sat) vset.insert(*itv); } } return vset; } // End of method 'GeneralConstraint::getVariables(const SatID& sat)'
inline std::string asString(const VariableSet& vset) { std::ostringstream oss; for( VariableSet::const_iterator it = vset.begin(); it != vset.end(); ++it ) { oss << it->getType() << " " << it->getSource() << " " << it->getSatellite() << " " << it->getTypeIndexed() << " " << it->getSourceIndexed() << " " << it->getSatIndexed()<< std::endl; } return oss.str(); }