Exemplo n.º 1
0
void  FinishDeferredSF (void)
{
    if (deferSetFormula->lLength) {
        SortLists (deferSetFormula, &deferIsConstant);
        _SimpleList tcache;
        long        iv,
                    i = variableNames.Traverser (tcache,iv,variableNames.GetRoot());

        for (; i >= 0; i = variableNames.Traverser (tcache,iv)) {
            _Variable* theV = FetchVar(i);
            if (theV->IsContainer()) {
                ((_VariableContainer*)theV)->SetMDependance (*deferSetFormula);
            }
        }

        for (long j = 0; j<likeFuncList.lLength; j++)
            if (((_String*)likeFuncNamesList(j))->sLength) {
                _LikelihoodFunction * lf = (_LikelihoodFunction*)likeFuncList(j);
                for (long k = 0; k < deferSetFormula->lLength; k++) {
                    lf->UpdateIndependent(deferSetFormula->lData[k],deferIsConstant.lData[k]);
                }
            }
    }
    DeleteObject (deferSetFormula);
    deferSetFormula = nil;
    deferIsConstant.Clear();
}
Exemplo n.º 2
0
void InitializeQTExporters(void)
{
    if (!graphicsFormats.lLength)
    {
    	qtGrexComponents.Clear();
    	findGraphicsExporterComponents (graphicsFormats, qtGrexComponents);
    }
} 
Exemplo n.º 3
0
void			_LikelihoodFunction::ComputeSiteLikelihoodsForABlock	(long index, _Parameter* results, _SimpleList& scalers, long branchIndex, _SimpleList* branchValues, char mpiRunMode)
// assumes that results is at least blockLength slots long
{
	if (blockDependancies.lData[index])
		PopulateConditionalProbabilities(index, mpiRunMode == _hyphyLFMPIModeREL ?_hyphyLFConditionMPIIterate:_hyphyLFConditionProbsWeightedSum, results, scalers, branchIndex, branchValues);	
	else
	{
		ComputeBlock		(index, results, -1, branchIndex, branchValues);
		scalers.Clear		();
		scalers.Duplicate   (siteCorrections(index));
	}
}
Exemplo n.º 4
0
//__________________________________________________________________
long		ComputeHashMarkPlacement  (_HYRect line, _Parameter min, _Parameter max, _Parameter& tickStep, 
									                  _Parameter&minLabel, _SimpleList& offsets, _List& labels,
									                  int count, _HYFont& f)
{
	if (max>min)
	{
		offsets.Clear();
		labels.Clear();

		long			w = line.right-line.left,
						h = line.bottom-line.top,
						t = 0;
		_Parameter 		scalingFactor = (w>h)?w/(max-min):h/(max-min);
		
		
		tickStep 		= log(max-min)/log(10.);
		tickStep		= pow (10.,floor (tickStep))*2.;
		minLabel		= min;
		
		t = count-1;
		while (t<count)
		{
			tickStep/=2.;
			if (tickStep>1.)
				tickStep = floor (tickStep);
			if (min)
				minLabel = ceil(min/tickStep)*tickStep;
			t = ceil((max-minLabel)/tickStep);
			if (min)
				minLabel = ceil(min/tickStep)*tickStep;
		}
						
		if (h>w)
		{
			_Parameter tracer = minLabel;
			long res  = 0,
				 last = -100000,
				 k,
				 sw;
				 
			w = h;
			
			for (h=0; h<=t; h++,tracer+=tickStep)
			{
				_String buffer (tracer);
				sw = GetVisibleStringWidth (buffer,f);
				k  = (tracer-min)*scalingFactor;
				if (k>w)
					break;
				if (k-last>f.size)
				{
					offsets << k;
					offsets << sw;
					labels  && & buffer;
					last = k;
				}
				if (sw>res)
					res = sw;
			}
			return res;
		}
		else
		{
			_Parameter tracer = minLabel;
			long res  = 0,
				 last = -100000,
				 k,
				 sw;
				 
			for (h=0; h<=t; h++,tracer+=tickStep)
			{
				_String buffer (tracer);
				sw = GetVisibleStringWidth (buffer,f);
				k  = (tracer-min)*scalingFactor;
				if (k>w)
					break;
				if (k-last>sw)
				{
					offsets << k;
					offsets << sw;
					labels  && & buffer;
					last = k;
				}
			}
		}
		
		return f.size;		
		
	}
	return 0;
	
}