本文整理汇总了C++中Peak::getMz方法的典型用法代码示例。如果您正苦于以下问题:C++ Peak::getMz方法的具体用法?C++ Peak::getMz怎么用?C++ Peak::getMz使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Peak
的用法示例。
在下文中一共展示了Peak::getMz方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
double MahalanobisDistance::operator()(const Peak& A, const Peak& B, double drt, double dmz, double dz=0., double dint=0.)
{
if(drt <= 0 || dmz <= 0){
MSPP_LOG(logERROR) << "MahalanobisDistance::operator(): drt and dmz have to be positive." << std::endl;
}
mspp_precondition(drt > 0. && dmz > 0. , "MahalanobisDistance::operator(): drt and dmz have to be positive.");
if(A.getAbundance() < dint || B.getAbundance() < dint){
// low abundance peak --> high distance
return DBL_MAX;
}
if(dz == 0.){
// only calculate distance if peaks have same charge
if(A.getCharge() != B.getCharge()){
// charge differs and dz == 0: max. distance
return DBL_MAX;
}else{
// charge equal: normal distance
double rt = (A.getRt()-B.getRt());
double mz = (A.getMz()-B.getMz());
return sqrt(rt*rt/(drt*drt) + mz*mz/(dmz*dmz));
}
}else{
// return normal distance
double rt = (A.getRt()-B.getRt());
double mz = (A.getMz()-B.getMz());
double z = A.getCharge() - B.getCharge();
return sqrt(rt*rt/(drt*drt) + mz*mz/(dmz*dmz) + z*z/(dz*dz));
}
}