本文整理汇总了C++中Ensemble::getLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ Ensemble::getLocation方法的具体用法?C++ Ensemble::getLocation怎么用?C++ Ensemble::getLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ensemble
的用法示例。
在下文中一共展示了Ensemble::getLocation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}
}
示例2: 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);
}
示例3: 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;
}