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


C++ Ensemble::getOffset方法代码示例

本文整理汇总了C++中Ensemble::getOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ Ensemble::getOffset方法的具体用法?C++ Ensemble::getOffset怎么用?C++ Ensemble::getOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ensemble的用法示例。


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

示例1: qc

bool Qc::qc(Ensemble& iEnsemble) const {
   bool anyChanges = false;
   for(int i = 0; i < iEnsemble.size(); i++) {
      if(!check(Value(iEnsemble[i], iEnsemble.getDate(), iEnsemble.getInit(), iEnsemble.getOffset(), iEnsemble.getLocation(), iEnsemble.getVariable()))) {
         anyChanges = true;
         iEnsemble[i] = Global::MV;
      }
   }
   return anyChanges;
}
开发者ID:WFRT,项目名称:Comps,代码行数:10,代码来源:Qc.cpp

示例2: correctCore

void CorrectorClim::correctCore(const Parameters& iParameters, Ensemble& iEnsemble) const {
   float climWeight = iParameters[0];
   float ensWeight = 1 - climWeight;
   float clim;
   if(mComputeClim) {
      assert(iParameters.size() == 2);
      clim = iParameters[1];
   }
   else
      clim = mData.getClim(iEnsemble.getDate(), iEnsemble.getInit(), iEnsemble.getOffset(),
            iEnsemble.getLocation(), iEnsemble.getVariable());
   if(Global::isValid(clim) && Global::isValid(ensWeight) && Global::isValid(climWeight)) {
      for(int n = 0; n < iEnsemble.size(); n++) {
         float currValue = iEnsemble[n];
         if(Global::isValid(currValue)) {
            iEnsemble[n] = currValue * ensWeight + clim * climWeight;
         }
      }
   }
}
开发者ID:WFRT,项目名称:Comps,代码行数:20,代码来源:Clim.cpp

示例3: measureCore

float MeasureLocalGradient::measureCore(const Ensemble& iEnsemble) const {
   int   date   = iEnsemble.getDate();
   int init     = iEnsemble.getInit();
   float offset = iEnsemble.getOffset();
   Location loc = iEnsemble.getLocation();

   // Determine which variable to use
   std::string var = mVariable;
   if(mVariable == "") {
      var = iEnsemble.getVariable();
   }

   std::string dataset = loc.getDataset();
   float centerValue = iEnsemble.getMoment(1);

   // Get nearby locations
   Input* input = mData.getInput(dataset);
   std::vector<Location> nearbyLocations;
   input->getSurroundingLocations(loc, nearbyLocations, 4);

   // Compute gradient
   float grad;
   int counter = 0;
   for(int i = 0; i < (int) nearbyLocations.size(); i++) {
      Ensemble ens;
      mData.getEnsemble(date, init, offset, nearbyLocations[i], dataset, var, ens);
      float mean = ens.getMoment(1);
      if(Global::isValid(mean)) {
         // TODO
         float dist = 0;
         float dvdx = 0;
         float dydy = 0;
         counter++;
      }
   }

   return iEnsemble.getMoment(2);
}
开发者ID:WFRT,项目名称:Comps,代码行数:38,代码来源:LocalGradient.cpp


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