VariableSet GeneralConstraint::getVariables( const SourceID& source )
   {
      VariableSet vset;

      VariableSet unkSet( getVariables() );

      if(source==Variable::allSources) return unkSet; 
      
      for( VariableSet::const_iterator itv = unkSet.begin();
         itv != unkSet.end();
         ++itv )
      {
         if( (itv->getSource() == source) && itv->getSourceIndexed() ) 
         {
            vset.insert( *itv );
         }
      }
      
      return vset;

   }  // End of method 'GeneralConstraint::getVariables(const SourceID& source)'
   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)'
Exemple #3
0
 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();
 }