Example #1
0
SSACalculator::Def* SSACalculator::newDef(Variable* variable, BasicBlock* block, Node* value)
{
    Def* def = m_defs.add(Def(variable, block, value));
    auto result = m_data[block].m_defs.add(variable, def);
    if (result.isNewEntry)
        variable->m_blocksWithDefs.append(block);
    else
        result.iterator->value = def;
    return def;
}
Example #2
0
/////////////////////////////////////////////////
// Model-Yahoo-Bayes
TMdYBayes::TMdYBayes(
 const TYNegDsType& _YNegDsType, const TYPriorType& _YPriorType,
 const PYBs& _YBs, const PYDsBs& _YDsBs,
 const PYFSelBs& _YFSelBs, const PYInvIx& _YInvIx):
  TMd(PDmHd(new TYDmHd(_YBs, _YDsBs))),
  YNegDsType(_YNegDsType), YPriorType(_YPriorType),
  YBs(_YBs), YDsBs(_YDsBs),
  YFSelBs(_YFSelBs), YInvIx(_YInvIx),
  NegWordDs(TYDmDs::GetNegWordDs(YNegDsType, YBs, YDsBs)){
  Def();
}
Example #3
0
File: ts.cpp Project: Accio/snap
/////////////////////////////////////////////////
// Test-Model-Generator-With-Hold-Out
void TTsMgHO::GetTsMdV(const int& Trials, const double& TrnPrc, const PMg& Mg,
 const PDm& Dm, const int& ClassN){
  PExSet DmExSet=Dm()->GetExSet();
  for (int TrialN=0; TrialN<Trials; TrialN++){
    PExSet TrExSet, TsExSet;
    DmExSet->SplitPerPrb(TrnPrc/100, TrExSet, TsExSet);
    PMd Md=Mg->GetMd(TrExSet);
    PTsMd TsMd=TTsMd::GetTsMd(Md, Dm, ClassN, TsExSet);
    TsMdV.Add(TsMd);
  }
  Def();
}
Example #4
0
  const ValueSet& Variables::Values::GetValue (int type) const
  {
    CS_ASSERT ((type >= valueFirst) && (type <= valueLast));
    if (valueFlags & (1 << type))
    {
      uint index = GetValueIndex (type);
      if (index < inlinedSets)
	return inlineValues[index];
      else
	return GetMultiValue (index - inlinedSets);
    }
    else
      return Def();
  }
Example #5
0
File: ts.cpp Project: Accio/snap
/////////////////////////////////////////////////
// Test-Model-Generator-With-Cross-Validation
void TTsMgCV::GetTsMdV(const int& Folds, const PMg& Mg,
 const PDm& Dm, const int& ClassN){
  PExSet DmExSet=Dm->GetExSet();
  TVec<PExSet> FoldV(Folds, 0);        
  DmExSet->SplitToFolds(Folds, FoldV);
  for (int TsFoldN=0; TsFoldN<Folds; TsFoldN++){
    PExSet TrExSet=TExSet::New(GetTypeNm(*DmExSet));
    for (int TrFoldN=0; TrFoldN<Folds; TrFoldN++){
      if (TrFoldN!=TsFoldN){TrExSet->AddExSet(FoldV[TrFoldN]);}}
    TrExSet->Def();
    PMd Md=Mg->GetMd(TrExSet);
    PTsMd TsMd=TTsMd::GetTsMd(Md, Dm, ClassN, FoldV[TsFoldN]);
    TsMdV.Add(TsMd);
  }
  Def();
}
TOptional<FExpressionError> FTokenDefinitions::ConsumeToken(FExpressionTokenConsumer& Consumer) const
{
	auto& Stream = Consumer.GetStream();
	
	// Skip over whitespace
	if (bIgnoreWhitespace)
	{
		TOptional<FStringToken> Whitespace = Stream.ParseWhitespace();
		if (Whitespace.IsSet())
		{
			Stream.SetReadPos(Whitespace.GetValue());
		}
	}

	if (Stream.IsEmpty())
	{
		// Trailing whitespace in the expression.
		return TOptional<FExpressionError>();
	}

	const auto* Pos = Stream.GetRead();

	// Try each token in turn. First come first served.
	for (const auto& Def : Definitions)
	{
		// Call the token definition
		auto Error = Def(Consumer);
		if (Error.IsSet())
		{
			return Error;
		}
		// If the stream has moved on, the definition added one or more tokens, so 
		else if (Stream.GetRead() != Pos)
		{
			return TOptional<FExpressionError>();
		}
	}

	// No token definition matched the stream at its current position - fatal error
	FFormatOrderedArguments Args;
	Args.Add(FText::FromString(Consumer.GetStream().GetErrorContext()));
	Args.Add(Consumer.GetStream().GetPosition());
	return FExpressionError(FText::Format(LOCTEXT("LexicalError", "Unrecognized token '{0}' at character {1}"), Args));
}
Example #7
0
void make( char *maker ) {
    static char make_opt[ _MAX_PATH ];
//  static char *args[3];
    int err;

    sprintf( make_opt,
" -%cMAP -%cDEBUG -%cNODEFLIB -%cKEEP_SRC -%cKEEP_LST -%cLINK -%cASSEMBLE -%cCOMPILE",
        Def( _map_file), Def( _debug), Def( _nodef_lib),
        Def( _keep_gen ), Def( _dump_lst ),
        Def( _link), Def( _assemble ), Def( _compile ) );
    if ( _keep_rsp )
        strcat( make_opt, " -K" );
    if ( _build_all )
        strcat( make_opt, " -B" );
    printf( "%s%s\n", maker, make_opt );
    err = spawnlp( P_OVERLAY, maker, maker, make_opt, NULL );

    if ( err <  0 )
        error( ERR_RUNTIME, maker );
    else if ( err > 0 )
        error( err, maker );
}
TAlignPair::TAlignPair(TSIn& SIn) { 
    Lang1.Load(SIn); Lang2.Load(SIn);
    BowDocBs1 = TBowDocBs::Load(SIn); BowDocBs1->SaveTxtStat(Lang1 + Lang2 + ".txt");
    BowDocBs2 = TBowDocBs::Load(SIn); BowDocBs2->SaveTxtStat(Lang1 + Lang2 + ".txt");
    Def();
}