本文整理汇总了C++中Col::at方法的典型用法代码示例。如果您正苦于以下问题:C++ Col::at方法的具体用法?C++ Col::at怎么用?C++ Col::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Col
的用法示例。
在下文中一共展示了Col::at方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: expectedColVecAtDivide
void expectedColVecAtDivide() {
if (_elemInd >= _genColVec.n_elem) {
return;
}
_genColVec.at(_elemInd) /= _genDouble;
cout << "- Compute expectedColVecAtDivide() ... ";
save<double>("Col.atDivide", _genColVec);
cout << "done." << endl;
}
示例2: expectedRowsDivide
void expectedRowsDivide() {
for(int n = 0; n < _elemInds.n_elem; n++) {
if(!_genColVec.in_range(_elemInds.at(n))) {
return;
}
}
cout << "- Compute expectedRowsDivide() ... ";
_genColVec.rows(_elemInds) /= _genDouble;
save<double>("Col.rowsDivide", _genColVec);
cout << "done." << endl;
}
示例3: expectedElemTimes
void expectedElemTimes() {
for(int n = 0; n < _elemInds.n_elem; n++) {
if(!_genColVec.in_range(_elemInds.at(n))) {
return;
}
}
cout << "- Compute expectedElemTimes() ... ";
_genColVec.elem(_elemInds) *= _genDouble;
save<double>("Col.elemTimes", _genColVec);
cout << "done." << endl;
}
示例4: expectedElemDivide
void expectedElemDivide() {
for(int n = 0; n < _elemInds.n_elem; n++) {
if(!_genMat.in_range(_elemInds.at(n))) {
return;
}
}
cout << "- Compute expectedElemDivide() ... ";
_genMat.elem(_elemInds) /= _genDouble;
save<double>("Mat.elemDivide", _genMat);
cout << "done." << endl;
}
示例5: expectedRowsElemTimes
void expectedRowsElemTimes() {
for(int n = 0; n < _elemInds.n_elem; n++) {
if(!_genColVec.in_range(_elemInds.at(n))) {
return;
}
}
if(_genRowVec.n_elem != _elemInds.n_elem) {
return;
}
cout << "- Compute expectedElemElemTimes() ... ";
_genColVec.rows(_elemInds) %= _genRowVec;
save<double>("Col.rowsElemTimes", _genColVec);
cout << "done." << endl;
}
示例6: ClassifyKnownTauE
void KeyClassifier::ClassifyKnownTauE(std::vector<KeySeq> &keys,
ZeromerModelBulk<double> &bg,
Mat<double> &wellFlows,
Mat<double> &refFlows,
Col<double> &time,
const Col<double> &incorp,
double minSnr,
double tauE,
KeyFit &fit,
TraceStore<double> &store,
Mat<double> &predicted) {
param.set_size(2);// << 0 << 0;
param[0] = 0;
param[1] = 0;
fit.keyIndex = -1;
fit.snr = 0;
fit.sd = 0;
fit.mad = -1;
signal.set_size(wellFlows.n_cols);
projSignal.set_size(wellFlows.n_cols);
Col<double> weights = ones<vec>(store.GetNumFrames());
if (fit.bestKey >= 0) {
fit.bestKey = -1;
}
fit.ok = -1;
size_t frameStart = min(FRAME_START,wellFlows.n_rows);
size_t frameEnd = min(FRAME_END,wellFlows.n_rows);
for (size_t keyIx = 0; keyIx < keys.size(); keyIx++) {
double keyMinSnr = std::max(minSnr, keys[keyIx].minSnr);
double tauB = 0;
bg.FitWell(fit.wellIdx, store, keys[keyIx], weights, mDist, mValues);
param.at(0) = tauB;
param.at(1) = tauE;
onemerIncorpMad.Clear();
onemerProjMax.Init(10);
onemerProjMax.Clear();
onemerSig.Clear();
zeromerSig.Clear();
zeroStats.Clear();
traceSd.Clear();
sigVar.Clear();
onemerProj.Clear();
for (size_t flowIx = 0; flowIx < wellFlows.n_cols; flowIx++) {
bg.ZeromerPrediction(fit.wellIdx, flowIx, store, refFlows.unsafe_col(flowIx),p);
double sig = 0;
SampleStats<double> mad;
diff = wellFlows.unsafe_col(flowIx) - p;
for (size_t frameIx = frameStart; frameIx < frameEnd; frameIx++) {
sig += diff.at(frameIx);
}
signal.at(flowIx) = sig;
/* uvec indices; */
double pSig = std::numeric_limits<double>::quiet_NaN();
if (incorp.n_rows == diff.n_rows) {
pSig = GetProjection(diff, incorp);
}
projSignal.at(flowIx) = pSig;
sigVar.AddValue(sig);
if (keys[keyIx].flows[flowIx] == 0) {
for (size_t frameIx = frameStart; frameIx < frameEnd; frameIx++) {
mad.AddValue(fabs(diff.at(frameIx)));
}
zeroStats.AddValue(mad.GetMean());
zeromerSig.AddValue(sig);
}
else if (keys[keyIx].flows[flowIx] == 1 && flowIx < keys[keyIx].usableKeyFlows) {
onemerSig.AddValue(sig);
// double maxValue = 0;
// for (size_t fIx = frameStart; fIx < frameEnd-1; fIx++) {
// maxValue = max(maxValue, (diff.at(fIx)+diff.at(fIx+1))/2);
// }
// projSignal.at(flowIx) = maxValue;
// onemerProjMax.AddValue(maxValue);
if (isfinite(pSig) && incorp.n_rows == p.n_rows) {
onemerProj.AddValue(pSig);
double maxSig = 0;
for (size_t frameIx = frameStart; frameIx < frameEnd; frameIx++) {
double projVal = pSig * incorp.at(frameIx);
maxSig = max(maxSig, projVal);
onemerIncorpMad.AddValue(fabs(projVal - (wellFlows.at(frameIx,flowIx) - p.at(frameIx))));
}
onemerProjMax.AddValue(maxSig);
}
}
}
double snr = (onemerSig.GetMedian() - zeromerSig.GetMedian()) / ((onemerSig.GetIqrSd() + zeromerSig.GetIqrSd() + SDFUDGE)/2);
float sd = sigVar.GetSD();
if (!isfinite(sd) || isnan(sd)) {
sd = 0;
}
if ((snr >= fit.snr || (isfinite(snr) && !isfinite(fit.snr))) && snr >= keyMinSnr ) {
fit.keyIndex = keyIx;
fit.bestKey = keyIx;
fit.mad = zeroStats.GetMean();
fit.snr = snr;
fit.param = param;
fit.sd = sd;
//.........这里部分代码省略.........