本文整理汇总了C++中Array1D::setAllTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Array1D::setAllTo方法的具体用法?C++ Array1D::setAllTo怎么用?C++ Array1D::setAllTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Array1D
的用法示例。
在下文中一共展示了Array1D::setAllTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processInternalChild
double processInternalChild(Symbol parentSymbol,int parentID,int child,
NthOrdSubstMatrix &noPt) {
AlignmentSeq &track=A.getIthTrack(parentID);
AlignmentSeq &childTrack=A.getIthTrack(child);
int contextBegin=column-order;
if(contextBegin<0) contextBegin=0;
int contextLen=column-contextBegin;
Sequence context;
track.getSeq().getSubsequence(contextBegin,contextLen,context);//ACO
//A.getIthTrack(root->getID()).getSeq().getSubsequence(contextBegin,contextLen,context);//TRCO
int pos=MultSeqAlignment::rightmostGapPos(context,gapSymbols);
if(pos>=0) {
throw "this should not happen (FitchFelsenstein)::processInternalChild";
Sequence temp;
context.getSubsequence(pos+1,contextLen-pos-1,temp);
context=temp;
}
SubstitutionMatrix &Pt=*noPt.lookup(context,0,-1);
Array2D<double>::RowIn2DArray<double> row=L[child];
Symbol childSym=childTrack.getSeq()[column];
double ll;
if(gapSymbols.isMember(childSym)){
V.setAllTo(NEGATIVE_INFINITY);
for(Symbol a=0 ; a<numAlpha ; ++a) {
if(!gapSymbols.isMember(a)) {
V[(int)a]=safeAdd(row[a],Pt(parentSymbol,a));
}
}
ll=sumLogProbs(V);
}
else {
ll=safeAdd(row[childSym],Pt(parentSymbol,childSym));
}
return ll;
}
示例2: FitchLikelihooder
FitchLikelihooder(int numNodes,int numAlpha,Alphabet &alpha,
MultSeqAlignment &A,int column,RootNode *root,int order)
: A(A), numNodes(numNodes), numAlpha(numAlpha),
alpha(alpha), L(numNodes,numAlpha), column(column),
order(order), root(root), likelihood(NEGATIVE_INFINITY),
gapSymbols(A.getGapSymbols()), V(numAlpha)
{
L.setAllTo(NEGATIVE_INFINITY);
V.setAllTo(NEGATIVE_INFINITY);
}