当前位置: 首页>>代码示例>>Java>>正文


Java Tree.IS_CLEAN属性代码示例

本文整理汇总了Java中beast.evolution.tree.Tree.IS_CLEAN属性的典型用法代码示例。如果您正苦于以下问题:Java Tree.IS_CLEAN属性的具体用法?Java Tree.IS_CLEAN怎么用?Java Tree.IS_CLEAN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在beast.evolution.tree.Tree的用法示例。


在下文中一共展示了Tree.IS_CLEAN属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateLogP

@Override
    public double calculateLogP() {
        if (beagle != null) {
            logP = beagle.calculateLogP();
            return logP;
        }
        final TreeInterface tree = treeInput.get();

        try {
        	if (traverse(tree.getRoot()) != Tree.IS_CLEAN)
        		calcLogP();
        }
        catch (ArithmeticException e) {
        	return Double.NEGATIVE_INFINITY;
        }
        m_nScale++;
        if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
//            System.err.println("Switch off scaling");
//            m_likelihoodCore.setUseScaling(1.0);
//            m_likelihoodCore.unstore();
//            m_nHasDirt = Tree.IS_FILTHY;
//            X *= 2;
//            traverse(tree.getRoot());
//            calcLogP();
//            return logP;
        } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10 && !scaling.get().equals(Scaling.none)) { // && !m_likelihoodCore.getUseScaling()) {
            m_nScale = 0;
            m_fScale *= 1.01;
            Log.warning.println("Turning on scaling to prevent numeric instability " + m_fScale);
            likelihoodCore.setUseScaling(m_fScale);
            likelihoodCore.unstore();
            hasDirt = Tree.IS_FILTHY;
            traverse(tree.getRoot());
            calcLogP();
            return logP;
        }
        return logP;
    }
 
开发者ID:CompEvol,项目名称:beast2,代码行数:38,代码来源:TreeLikelihood.java

示例2: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    if (beagle != null) {
        return beagle.requiresRecalculation();
    }
    hasDirt = Tree.IS_CLEAN;

    if (dataInput.get().isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        return true;
    }
    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        //m_nHasDirt = Tree.IS_DIRTY;
        return true;
    }
    return treeInput.get().somethingIsDirty();
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:24,代码来源:TreeLikelihood.java

示例3: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    if (beagle != null) {
        return beagle.requiresRecalculation();
    }
    hasDirt = Tree.IS_CLEAN;

    if (data.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        return true;
    }
    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    return tree.somethingIsDirty();
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:24,代码来源:QuietTreeLikelihood.java

示例4: isDirtyBranch

@Override
public boolean isDirtyBranch(Node speciesNode) {
    if (needsUpdate) {
        final RealParameter tipPopSizes = tipPopSizesInput.get();
        final RealParameter topPopSizes = topPopSizesInput.get();

        Arrays.fill(speciesBranchStatus, false);
        Node[] speciesNodes = speciesTree.getNodesAsArray();

        // non-root nodes (linear population sizes)
        for (int nodeI = 0; nodeI < speciesNodes.length; nodeI++) {
            // if the "top" population is dirty, no need to check the tip
            if (nodeI < rootNodeNumber && topPopSizes.isDirty(nodeI)) { // not the root node
                speciesBranchStatus[nodeI] = true;
                continue;
            }

            if (nodeI < leafNodeCount) { // is a leaf node
                speciesBranchStatus[nodeI] = tipPopSizes.isDirty(nodeI);
            } else { // is an internal node
                final Node leftChild = speciesNodes[nodeI].getLeft();
                final Node rightChild = speciesNodes[nodeI].getRight();
                final int leftChildTopI = leftChild.getNr();
                final int rightChildTopI = rightChild.getNr();
                speciesBranchStatus[nodeI] = topPopSizes.isDirty(leftChildTopI) ||
                        topPopSizes.isDirty(rightChildTopI) ||
                        leftChild.isDirty() != Tree.IS_CLEAN ||
                        rightChild.isDirty() != Tree.IS_CLEAN;
            }
        }

        //Arrays.fill(speciesBranchStatus, true);
        needsUpdate = false;
    }

    return speciesBranchStatus[speciesNode.getNr()];
}
 
开发者ID:genomescale,项目名称:starbeast2,代码行数:37,代码来源:LinearWithConstantRoot.java

示例5: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    //System.err.println("flag1");
	/*if (m_beagle != null) {
		return m_beagle.requiresRecalculation();
	} */
    hasDirt = Tree.IS_CLEAN;

    if(weightsChanged){
        hasDirt = -1;
        //System.err.println("flag2");
        return true;            
    }

    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.err.println("flag3");
        return true;
    }

    if (dataInput.get().isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.err.println("flag4");
        return true;
    }

    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        //System.err.println("flag5");
        return true;
    }

    return treeInput.get().somethingIsDirty();
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:37,代码来源:WVTreeLikelihood.java

示例6: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    hasDirt = Tree.IS_CLEAN;
    
    double[] categoryRates = m_siteModel.getCategoryRates(null);
    if (constantPattern != null) {
        double [] tmp = new double [categoryRates.length - 1];
        for (int k = 0; k < invariantCategory; k++) {
        	tmp[k] = categoryRates[k];
        }
        for (int k = invariantCategory + 1; k < categoryRates.length; k++) {
        	tmp[k-1] = categoryRates[k];
        }
        categoryRates = tmp;
    }
    for (int i = 0; i < categoryRates.length; i++) {
    	if (categoryRates[i] != currentCategoryRates[i]) {
    		updateSiteModel = true;
    		break;
    	}
    }
    //updateSiteModel |= m_siteModel.isDirtyCalculation();

    if (substitutionModel instanceof CalculationNode) {
    	updateSubstitutionModel |= ((CalculationNode) substitutionModel).isDirtyCalculation();
    }
    
    if (dataInput.get().isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        return true;
    }
    if (m_siteModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_DIRTY;
        return true;
    }
    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        //m_nHasDirt = Tree.IS_FILTHY;
        return true;
    }

    return treeInput.get().somethingIsDirty();
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:45,代码来源:BeagleTreeLikelihood.java

示例7: requiresRecalculation

/**
 * check state for changed variables and update temp results if necessary *
 */
@Override
protected boolean requiresRecalculation() {
    //printThings();

    hasDirt = Tree.IS_CLEAN;

    if(weightsChanged){

        if(addedPatternIdCount > 0){
            hasDirt = Tree.IS_FILTHY;
        }else{
            hasDirt = -1;
        }

        if (m_siteModel.isDirtyCalculation()) {
             hasDirt = Tree.IS_DIRTY;
            valueChanged = true;
        }
        //System.out.println("flag2");
        return true;
    }

    if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.out.println("flag3");
        return true;
    }

    if (data.isDirtyCalculation()) {
        hasDirt = Tree.IS_FILTHY;
        //System.out.println("flag4");
        return true;
    }

    if (m_siteModel.isDirtyCalculation()) {
        valueChanged = true;
        hasDirt = Tree.IS_DIRTY;
        //System.out.println("flag5");
        return true;
    }

    return tree.somethingIsDirty();
}
 
开发者ID:jessiewu,项目名称:substBMA,代码行数:46,代码来源:NewWVTreeLikelihood.java


注:本文中的beast.evolution.tree.Tree.IS_CLEAN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。