本文整理汇总了C++中ActionFrame::TrajoutNum方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionFrame::TrajoutNum方法的具体用法?C++ ActionFrame::TrajoutNum怎么用?C++ ActionFrame::TrajoutNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionFrame
的用法示例。
在下文中一共展示了ActionFrame::TrajoutNum方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoAction
// Action_CreateReservoir::DoAction()
Action::RetType Action_CreateReservoir::DoAction(int frameNum, ActionFrame& frm) {
int bin = -1;
if (bin_ != 0) bin = (int)bin_->Dval(frm.TrajoutNum());
if (reservoir_.WriteReservoir(nframes_++, frm.Frm(), ene_->Dval(frm.TrajoutNum()), bin))
return Action::ERR;
return Action::OK;
}
示例2: DoAction
/** If a dataset was specified for maxmin, check if this structure
* satisfies the criteria; if so, write. Otherwise just write.
*/
Action::RetType Action_Outtraj::DoAction(int frameNum, ActionFrame& frm) {
// If dataset defined, check if frame is within max/min
if (!Dsets_.empty()) {
for (unsigned int ds = 0; ds < Dsets_.size(); ++ds)
{
double dVal = Dsets_[ds]->Dval(frameNum);
//mprintf("DBG: maxmin[%u]: dVal = %f, min = %f, max = %f\n",ds,dVal,Min_[ds],Max_[ds]);
// If value from dataset not within min/max, exit now.
if (dVal < Min_[ds] || dVal > Max_[ds]) return Action::OK;
}
}
if (outtraj_.WriteSingle(frm.TrajoutNum(), frm.Frm())) return Action::ERR;
return Action::OK;
}
示例3: DoAction
// Action_FilterByData::DoAction()
Action::RetType Action_FilterByData::DoAction(int frameNum, ActionFrame& frm)
{
static int ONE = 1;
static int ZERO = 0;
// Check if frame is within max/min
for (unsigned int ds = 0; ds < Dsets_.size(); ++ds)
{
double dVal = Dsets_[ds]->Dval(frm.TrajoutNum());
//mprintf("DBG: maxmin[%u]: dVal = %f, min = %f, max = %f\n",ds,dVal,Min_[ds],Max_[ds]);
// If value from dataset not within min/max, exit now.
if (dVal < Min_[ds] || dVal > Max_[ds]) {
maxmin_->Add( frameNum, &ZERO );
return Action::SUPPRESS_COORD_OUTPUT;
}
}
maxmin_->Add( frameNum, &ONE );
return Action::OK;
}
示例4: DoAction
// Action_Matrix::DoAction()
Action::RetType Action_Matrix::DoAction(int frameNum, ActionFrame& frm) {
// Check if this frame should be processed
if ( CheckFrameCounter( frm.TrajoutNum() ) ) return Action::OK;
// Increment number of snapshots
Mat_->IncrementSnapshots();
switch (Mat_->Meta().ScalarType()) {
case MetaData::DIST : CalcDistanceMatrix(frm.Frm()); break;
case MetaData::COVAR :
case MetaData::MWCOVAR : CalcCovarianceMatrix(frm.Frm()); break;
case MetaData::CORREL : CalcCorrelationMatrix(frm.Frm()); break;
case MetaData::DIHCOVAR : CalcDihedralCovariance(frameNum); break;
case MetaData::DISTCOVAR: CalcDistanceCovarianceMatrix(frm.Frm()); break;
case MetaData::IDEA : CalcIdeaMatrix(frm.Frm()); break;
case MetaData::IREDMAT : CalcIredMatrix(frameNum); break;
default: return Action::ERR; // Sanity check
}
return Action::OK;
}
示例5: DoAction
// Action_ReplicateCell::DoAction()
Action::RetType Action_ReplicateCell::DoAction(int frameNum, ActionFrame& frm) {
int idx, newFrameIdx;
unsigned int id;
Vec3 frac, t2;
frm.Frm().BoxCrd().ToRecip(ucell_, recip_);
int shift = Mask1_.Nselected() * 3;
# ifdef _OPENMP
# pragma omp parallel private(idx, newFrameIdx, id) firstprivate(frac, t2)
{
# pragma omp for
# endif
for (idx = 0; idx < Mask1_.Nselected(); idx++) {
// Convert to fractional coords
frac = recip_ * Vec3(frm.Frm().XYZ( Mask1_[idx] ));
//mprintf("DEBUG: Atom %i frac={ %g %g %g }\n", Mask1_[idx]+1, frac[0], frac[1], frac[2]);
// replicate in each direction
newFrameIdx = idx * 3;
for (id = 0; id != directionArray_.size(); id+=3, newFrameIdx += shift)
{
// Convert back to Cartesian coords.
t2 = ucell_.TransposeMult(frac + Vec3(directionArray_[id ],
directionArray_[id+1],
directionArray_[id+2]));
combinedFrame_[newFrameIdx ] = t2[0];
combinedFrame_[newFrameIdx+1] = t2[1];
combinedFrame_[newFrameIdx+2] = t2[2];
}
}
# ifdef _OPENMP
}
# endif
if (writeTraj_) {
if (outtraj_.WriteSingle(frm.TrajoutNum(), combinedFrame_) !=0 )
return Action::ERR;
}
if (coords_ != 0)
coords_->AddFrame( combinedFrame_ );
return Action::OK;
}