当前位置: 首页>>代码示例>>C++>>正文


C++ GPSTK_THROW函数代码示例

本文整理汇总了C++中GPSTK_THROW函数的典型用法代码示例。如果您正苦于以下问题:C++ GPSTK_THROW函数的具体用法?C++ GPSTK_THROW怎么用?C++ GPSTK_THROW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GPSTK_THROW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: throw

      /* Computes the quantile function ( cdf^-1() )
       *
       * @param p    Probability value
       *
       * \ warning Value "p" must be in the range (0, 1)
       */
   double GaussianDistribution::invcdf(double p)
      throw(InvalidParameter)
   {

      double inf( 9.0e+99 );

         // Check limits
      if( ( p < 0.0 ) ||
          ( p > 1.0 ) )
      {
         InvalidParameter e( "Invalid input value for 'p'." );
         GPSTK_THROW(e);
      }

      if( p == 0.0 ) return -inf;
      if( p == 1.0 ) return inf;

         // Compute invcdf
      return ( mean
             + 1.4142135623730951 * sigma * gpstk::inverf( 2.0 * p - 1.0 ) );

   }  // End of method 'GaussianDistribution::invcdf()'
开发者ID:JC5005,项目名称:GPSTk,代码行数:28,代码来源:GaussianDistribution.cpp

示例2: throw

      /* Returns a reference to a gnnsRinex object after solving
       * the previously defined equation system.
       *
       * @param gData     Data object holding the data.
       */
   gnssRinex& SolverPPPFB::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         SolverPPP::Process(gData);


            // Before returning, store the results for a future iteration
         if(firstIteration)
         {

               // Create a new gnssRinex structure with just the data we need
            gnssRinex gBak(gData.extractTypeID(keepTypeSet));

               // Store observation data
            ObsData.push_back(gBak);

            // Update the number of processed measurements
            processedMeasurements += gData.numSats();

         }

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'SolverPPPFB::Process()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:44,代码来源:SolverPPPFB.cpp

示例3: throw

   FileSpec::FileSpecType FileSpec::convertFileSpecType(const string& fst)
      throw(FileSpecException)
   {
      if (fst == string("n"))        return station;
      else if (fst == string("r"))   return receiver;
      else if (fst == string("p"))   return prn;
      else if (fst == string("t"))   return selected;
      else if (fst == string("I"))   return sequence;
      else if (fst == string("v"))   return version;
      else if (fst == string("k"))   return clock;
      else if (fst == string("x"))   return text;

      else if (fst == string("Y") || 
               fst == string("y"))   return year;
      else if (fst == string("m"))   return month;
      else if (fst == string("d"))   return dayofmonth;
      else if (fst == string("H"))   return hour;
      else if (fst == string("M"))   return minute;
      else if (fst == string("S"))   return second;
      else if (fst == string("f"))   return fsecond;
      else if (fst == string("G"))   return gpsweek;
      else if (fst == string("F"))   return fullgpsweek;
      else if (fst == string("g"))   return gpssecond;
      else if (fst == string("Q"))   return mjd;
      else if (fst == string("w"))   return dayofweek;
      else if (fst == string("j"))   return day;
      else if (fst == string("s"))   return doysecond;
      else if (fst == string("Z"))   return zcount;
      else if (fst == string("z"))   return zcountfloor;
      else if (fst == string("U"))   return unixsec;
      else if (fst == string("u"))   return unixusec;
      else if (fst == string("C") ||
               fst == string("c"))   return fullzcount;
      else
      {
         FileSpecException fse("Unknown FileSpecType: " + fst);
         GPSTK_THROW(fse);
      }
   }
开发者ID:JC5005,项目名称:GPSTk,代码行数:39,代码来源:FileSpec.cpp

示例4: throw

      /* Set the number of degrees of freedom.
       *
       * @param n       Degrees of freedom
       *
       * \warning "n" must be > 0.0, otherwise n = |n|.
       */
   StudentDistribution& StudentDistribution::setNDF(int n)
      throw(InvalidParameter)
   {

      if( n == 0 )
      {
         InvalidParameter e( "Invalid value for NDF." );
         GPSTK_THROW(e);
      }

      if( n < 0 )
      {
         ndf = -n;
      }
      else
      {
         ndf = n;
      }

      return (*this);

   }  // End of method 'StudentDistribution::setNDF()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:28,代码来源:StudentDistribution.cpp

示例5: throw

   void RinexNavData::getBroadcastOrbit6(const string& currentLine)
      throw(StringException, FFStreamError)
   {
      try
      {
         double SV_health;

         accuracy = gpstk::StringUtils::for2doub(currentLine.substr(3,19));
         SV_health = gpstk::StringUtils::for2doub(currentLine.substr(22,19));
         Tgd = gpstk::StringUtils::for2doub(currentLine.substr(41,19));
         IODC = gpstk::StringUtils::for2doub(currentLine.substr(60,19));


         health = (short) SV_health;
      }
      catch (std::exception &e)
      {
         FFStreamError err("std::exception: " +
                           string(e.what()));
         GPSTK_THROW(err);
      }
   }
开发者ID:vestuto,项目名称:GPSTk,代码行数:22,代码来源:RinexNavData.cpp

示例6: fromString

      void fromString(const std::string str)
      {
         std::string STR(gpstk::StringUtils::upperCase(str));
         if(STR == std::string("GPUT"))
            { type = GPUT; frTS = TimeSystem::GPS; toTS = TimeSystem::UTC; }

         else if(STR == std::string("GAUT"))
            { type = GAUT; frTS = TimeSystem::GAL; toTS = TimeSystem::UTC; }

         else if(STR == std::string("SBUT"))
            // TD ??
            { type = SBUT; frTS = TimeSystem::GPS; toTS = TimeSystem::UTC; }

         else if(STR == std::string("GLUT"))
            { type = GLUT; frTS = TimeSystem::GLO; toTS = TimeSystem::UTC; }
            
         else if(STR == std::string("GPGA"))
            { type = GPGA; frTS = TimeSystem::GPS; toTS = TimeSystem::GAL; }
            
         else if(STR == std::string("GLGP"))
            { type = GLGP; frTS = TimeSystem::GLO; toTS = TimeSystem::GPS; }
            
         else if(STR == std::string("QZGP"))
            { type = QZGP; frTS = TimeSystem::QZS; toTS = TimeSystem::GPS; }
            
         else if(STR == std::string("QZUT"))
            { type = QZUT; frTS = TimeSystem::QZS; toTS = TimeSystem::UTC; }
            
         else if(STR == std::string("BDUT"))
            { type = BDUT; frTS = TimeSystem::BDT; toTS = TimeSystem::UTC; }
            
         else if(STR == std::string("BDGP"))
            { type = BDGP; frTS = TimeSystem::BDT; toTS = TimeSystem::GPS; }
            
         else {
            Exception e("Unknown TimeSystemCorrection type: " + str);
            GPSTK_THROW(e);
         }
      }
开发者ID:Milfhunter,项目名称:gpstk,代码行数:39,代码来源:TimeSystemCorr.hpp

示例7: MEstimate

   T MEstimate(const T *xd, int nd, const T& M, const T& MAD, T *w=NULL)
      throw(Exception)
   {
      try {
         T tv, m, mold, sum, sumw, *wt, weight, *t;
         T tol=0.000001;
         int i, n, N=10;      // N is the max number of iterations

         if(!xd || nd < 2) {
            Exception e("Invalid input");
            GPSTK_THROW(e);
         }

         tv = T(RobustTuningT)*MAD;
         n = 0;
         m = M;
         do {
            mold = m;
            n++;
            sum = sumw = T();
            for(i=0; i<nd; i++) {
               if(w) wt=&w[i];
               else wt=&weight;
               *wt = T(1);
               if(xd[i]<m-tv)      *wt = -tv/(xd[i]-m);
               else if(xd[i]>m+tv) *wt =  tv/(xd[i]-m);
               sumw += (*wt);
               sum += (*wt)*xd[i];
            }
            m = sum / sumw;

         } while(T(ABSOLUTE((m-mold)/m)) > tol && n < N);

         return m;
      }
      catch(Exception& e) { GPSTK_RETHROW(e); }

   }  // end MEstimate
开发者ID:ianmartin,项目名称:GPSTk,代码行数:38,代码来源:RobustStats.hpp

示例8: throw

   // Compute the pressure and temperature at height, and the undulation,
   // for the given position and time.
   void GlobalTropModel::getGPT(double& P, double& T, double& U)
      throw(InvalidTropModel)
   {
      try { testValidity(); }
      catch(InvalidTropModel& e) { GPSTK_RETHROW(e); }
      
      int i;

      // undulation and orthometric height
      U = 0.0;
      for(i=0; i<55; i++) U += (Ageoid[i]*aP[i] + Bgeoid[i]*bP[i]);
      double orthoht(height - U);
      if(orthoht > 44247.) GPSTK_THROW(InvalidTropModel(
                           "Invalid Global trop model: Rx Height is too large"));

      // press at geoid
      double am(0.0),aa(0.0),v0;
      for(i=0; i<55; i++) {
         am += (APressMean[i]*aP[i] + BPressMean[i]*bP[i]);
         aa += (APressAmp[i]*aP[i] + BPressAmp[i]*bP[i]);
      }
      v0 = am + aa * ::cos(dayfactor);
      
      // pressure at height
      // NB this implies any orthoht > 1/2.26e-5 == 44247.78m is invalid!
      P = v0 * ::pow(1.0-2.26e-5*orthoht,5.225);

      // temper on geoid
      am = aa = 0.0;
      for(i=0; i<55; i++) {
         am += (ATempMean[i]*aP[i] + BTempMean[i]*bP[i]);
         aa += (ATempAmp[i]*aP[i] + BTempAmp[i]*bP[i]);
      }
      v0 = am + aa * ::cos(dayfactor);

      // temp at height
      T = v0 - 6.5e-3 * orthoht;
   }
开发者ID:SGL-UT,项目名称:GPSTk,代码行数:40,代码来源:GlobalTropModel.cpp

示例9: cfIBeta

 // Compute continued fractions portion of incomplete beta function I_x(a,b)
 /// Routine used internally for Incomplete beta function I_x(a,b)
 double cfIBeta(const double& x, const double& a, const double& b) throw(Exception)
 {
    static const int imax(100);
    static const double eps(10*std::numeric_limits<double>().epsilon());
    static const double fpmin(10*std::numeric_limits<double>().min());
    const double qab(a+b);
    const double qap(a+1.0);
    const double qam(a-1.0);
    double c(1),d(1-qab*x/qap),aa,del;
    if(::fabs(d) < fpmin) d=fpmin;
    d = 1.0/d;
    double h(d);
    int i,i2;
    for(i=1; i<=imax; i++) {
       i2 = 2*i;
       aa = i*(b-i)*x/((qam+i2)*(a+i2));
       d = 1.0 + aa*d;
       if(::fabs(d) < fpmin) d=fpmin;
       c = 1.0 + aa/c;
       if(::fabs(c) < fpmin) c=fpmin;
       d = 1.0/d;
       h *= d*c;
       aa = -(a+i)*(qab+i)*x/((a+i2)*(qap+i2));
       d = 1.0 + aa*d;
       if(::fabs(d) < fpmin) d=fpmin;
       c = 1.0 + aa/c;
       if(::fabs(c) < fpmin) c=fpmin;
       d = 1.0/d;
       del = d*c;
       h *= del;
       if(::fabs(del-1.0) < eps) break;
    }
    if(i > imax) {
       Exception e("Overflow in cfIBeta(); a or b too big");
       GPSTK_THROW(e);
    }
    return h;
 }
开发者ID:JC5005,项目名称:GPSTk,代码行数:40,代码来源:SpecialFunctions.hpp

示例10: throw

      /* Dumps data from a satTypeValueMap object.
       *
       * @param gData     Data object holding the data.
       */
   satTypeValueMap& Dumper::Process( satTypeValueMap& gData )
      throw(ProcessingException)
   {

      try
      {

            // Iterate through all items in the GNSS Data Structure
         for( satTypeValueMap::const_iterator it = gData.begin();
              it!= gData.end();
              it++ )
         {

               // First, print satellite (system and PRN)
            *outStr << (*it).first << " ";

               // Now, print TypeIDs
            printTypeID( (*it).second );

               // Print end of line
            *outStr << std::endl;

         }  // End of 'for( satTypeValueMap::const_iterator it = ...'

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'Dumper::Process()'
开发者ID:rwpenney,项目名称:GPSTk,代码行数:42,代码来源:Dumper.cpp

示例11: throw

      /* Returns a gnnsSatTypeValue object, adding the new data generated
       *  when calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssSatTypeValue& PhaseCodeAlignment::Process(gnssSatTypeValue& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of 'PhaseCodeAlignment::Process()'
开发者ID:etschneider,项目名称:GPSTk,代码行数:28,代码来源:PhaseCodeAlignment.cpp

示例12: throw

      /* Returns a gnnsRinex object, adding the new data generated when
       * calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssRinex& LICSDetector::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body, gData.header.epochFlag);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'LICSDetector::Process()'
开发者ID:Milfhunter,项目名称:gpstk,代码行数:28,代码来源:LICSDetector.cpp

示例13: throw

      /* Returns a gnnsRinex object, adding the new data generated
       * when calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssRinex& ComputeSimpleWeights::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of method 'ComputeSimpleWeightsWeights::Process()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:28,代码来源:ComputeSimpleWeights.cpp

示例14: throw

      /* Returns a gnnsRinex object, adding the new data generated when
       *  calling this object.
       *
       * @param gData    Data object holding the data.
       */
   gnssRinex& EclipsedSatFilter::Process(gnssRinex& gData)
      throw(ProcessingException)
   {

      try
      {

         Process(gData.header.epoch, gData.body);

         return gData;

      }
      catch(Exception& u)
      {
            // Throw an exception if something unexpected happens
         ProcessingException e( getClassName() + ":"
                                + u.what() );

         GPSTK_THROW(e);

      }

   }  // End of 'EclipsedSatFilter::Process()'
开发者ID:PPNav,项目名称:GPSTk,代码行数:28,代码来源:EclipsedSatFilter.cpp

示例15: GPSTK_THROW

 // Dump the overhead information as a string containing a single line.
 // @throw Invalid Request if the required data has not been stored.
 string GPSEphemeris::asString(void) const
 {
    if(!dataLoadedFlag)
       GPSTK_THROW(InvalidRequest("Data not loaded"));
    try {
       ostringstream os;
       CivilTime ct;
       os << "EPH G" << setfill('0') << setw(2) << satID.id << setfill(' ');
       ct = CivilTime(beginValid);
       os << printTime(ct," | %4Y %3j %02H:%02M:%02S |");
       ct = CivilTime(ctToe);
       os << printTime(ct," %3j %02H:%02M:%02S |");
       ct = CivilTime(ctToc);
       os << printTime(ct," %3j %02H:%02M:%02S |");
       ct = CivilTime(endValid);
       os << printTime(ct," %3j %02H:%02M:%02S |");
       ct = CivilTime(transmitTime);
       os << printTime(ct," %3j %02H:%02M:%02S | ");
       os << setw(3) << IODE << " | " << setw(3) << IODC << " | " << health;
       return os.str();
    }
    catch(Exception& e) { GPSTK_RETHROW(e);
    }
 }
开发者ID:JC5005,项目名称:GPSTk,代码行数:26,代码来源:GPSEphemeris.cpp


注:本文中的GPSTK_THROW函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。