本文整理汇总了C++中par函数的典型用法代码示例。如果您正苦于以下问题:C++ par函数的具体用法?C++ par怎么用?C++ par使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了par函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Z3_tactic_par_or
Z3_tactic Z3_API Z3_tactic_par_or(Z3_context c, unsigned num, Z3_tactic const ts[]) {
Z3_TRY;
LOG_Z3_tactic_par_or(c, num, ts);
RESET_ERROR_CODE();
ptr_buffer<tactic> _ts;
for (unsigned i = 0; i < num; i++) {
_ts.push_back(to_tactic_ref(ts[i]));
}
tactic * new_t = par(num, _ts.c_ptr());
RETURN_TACTIC(new_t);
Z3_CATCH_RETURN(0);
}
示例2: miConst
void Compilador::InsertaConst(string constante, int tipo){
//Checa si existe
unordered_map<string,Variable>::const_iterator it = tablaConsts.find(constante);
if(it == tablaConsts.end()){
int dir = (rangoMemoria[0][2][tipo-10000]) + (ctes[tipo-10000]);
Variable miConst(constante, tipo, dir);
ctes[tipo-10000]++;
std::pair<std::string,Variable> par (constante, miConst);
tablaConsts.insert(par);
}
//Si ya existia no hace nada
}
示例3: par
void Dropper::initialize() {
faulty = par("faulty");
// Register Hook
inet::IPv4* ipLayer = check_and_cast<inet::IPv4*>(
getModuleByPath("^.networkLayer.ip"));
// TODO check the priority that should have
ipLayer->registerHook(1, this);
inPackets = 0;
outPackets = 0;
droppedPackets = 0;
dataOverhead.setName("DataOverhead");
}
示例4: getNamer
void CLIPSInstructionBuilder::addFields(Instruction* instruction, KnowledgeConstruction *kc, char* parent, bool addDestinationRegisters) {
User* tmp = (User*)instruction;
CLIPSUserBuilder::addFields(tmp, kc, parent);
FunctionNamer& namer = getNamer();
std::string par (parent);
PointerAddress pa = namer.registerInstructionWithBasicBlock(par);
addField("TimeIndex", pa);
addField("Operation", (char*) instruction->getOpcodeName());
if(instruction->mayWriteToMemory()) addTrueField("MayWriteToMemory");
if(instruction->mayReadFromMemory()) addTrueField("MayReadFromMemory");
if(instruction->mayReadOrWriteMemory()) addTrueField("MayReadOrWriteMemory");
if(instruction->mayHaveSideEffects()) addTrueField("MayHaveSideEffects");
if(instruction->isBinaryOp()) addTrueField("IsBinaryOp");
if(instruction->isTerminator()) addTrueField("IsTerminator");
if(instruction->isShift()) addTrueField("IsShift");
if(instruction->isCast()) addTrueField("IsCast");
if(instruction->isArithmeticShift()) addTrueField("IsArithmeticShift");
if(instruction->isLogicalShift()) addTrueField("IsLogicalShift");
if(instruction->isAssociative()) addTrueField("IsAssociative");
if(instruction->isCommutative()) addTrueField("IsCommutative");
if(!instruction->getType()->isVoidTy() && instruction->hasName() && addDestinationRegisters) {
addField("DestinationRegisters", instruction->getName());
}
if(!instruction->use_empty()) {
// DenseMap<BasicBlock*,unsigned> counterArgument;
//BasicBlock* directParent = instruction->getParent();
//we could have an instruction not used in the block it's created :D
openField("Consumers");
for(Value::use_iterator i = instruction->use_begin(),
e = instruction->use_end(); i != e; ++i) {
User* target = *i;
PointerAddress ptr = (PointerAddress)target;
if(namer.pointerRegistered(ptr)) {
appendValue(namer.nameFromPointer(ptr));
} else if(isa<Function>(target) || isa<Instruction>(target)) {
appendValue(target->getName());
} else {
appendValue(kc->route(target, namer));
}
}
closeField();
/*
openField("BlocksUsedIn");
for(DenseMap<BasicBlock*, unsigned>::iterator a = counterArgument.begin(), b = counterArgument.end(); a != b; ++a) {
BasicBlock* bb = a->first;
appendValue(bb->getName()); //the name of the basic block
appendValue(a->second); //the number of iterations
}
closeField();
*/
}
}
示例5: getParentModule
void Detector::initialize(int stage) {
if (stage == inet::INITSTAGE_LAST) {
// Initialize local variables
IP = inet::L3AddressResolver().addressOf(
getParentModule()->getParentModule(),
inet::L3AddressResolver::ADDR_IPv4).toIPv4();
faulty = par("faulty");
monitor = check_and_cast<TrafficMonitor*>(
getParentModule()->getSubmodule("monitor"));
WATCH_VECTOR(thresholds);
WATCH_VECTOR(evaluateNextIter);
}
}
示例6: writeToStream
void CLinearMapping::writeParamsToStream(ostream& out) const
{
writeToStream(out, "baseType", getBaseType());
writeToStream(out, "type", getType());
writeToStream(out, "numData", getNumData());
writeToStream(out, "outputDim", getOutputDim());
writeToStream(out, "inputDim", getInputDim());
writeToStream(out, "numParams", getOptNumParams());
CMatrix par(1, getOptNumParams());
getOptParams(par);
par.toStream(out);
}
示例7: grid
__host__ __device__
async_launch<
parallel_group<
concurrent_group<
bulk::agent<grainsize>,
groupsize
>
>
>
grid(size_t num_groups, size_t heap_size, cudaStream_t stream)
{
return par(stream, con<groupsize,grainsize>(heap_size), num_groups);
}
示例8: e
void AssetTemplateItem::setup( const Record & rec, const QModelIndex & self ) {
r = rec;
Element e(r);
_flags = Qt::ItemFlags(0);
isRecurseTemplate = false;
isGhostItem = false;
QModelIndex parent = self.parent();
QModelIndex par(parent);
while( par.isValid() ) {
Element p(AssetTemplateTranslator::getRecordStatic(par));
if( p.assetTemplate().isRecord() ) {
isGhostItem = true;
break;
}
par = par.parent();
}
// Set it if we are a recurse template ourselves
isRecurseTemplate = e.assetTemplate().isRecord();
if( e.isRecord() ) {
col1 = e.displayName();
icon = ElementUi(e).image();
// If we have an asset template, then overlay the icon
if( isRecurseTemplate ) {
QImage over( ":/images/plus_overlay.png" );
QPainter p( &icon );
p.drawImage( QPoint(6,6), over );
}
if( isGhostItem )
{
QPixmap cur(icon.size());
cur.fill( QColor( 180, 180, 180, 200 ) );
QPainter p( &icon );
p.setCompositionMode( QPainter::CompositionMode_SourceAtop );
p.drawPixmap(QPoint(),cur);
}
if( isRecurseTemplate )
_flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
else if( isGhostItem )
_flags = 0;
else
_flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
}
FileTracker ft(r);
if( ft.isRecord() ) {
col1 = ft.name();
icon = QPixmap( ":/images/tracker.png" );
_flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
}
}
示例9: main
int main()
{
setlocale(LC_CTYPE,"Russian");
TransportnoeSredstvo t("a","b"), t1("1","2"), *tt;
Parohod par(1234,"a","b",5,4,"a","a");
tt = ∥
t.add();
t1.add();
tt->add();
AAA::show();
return 0;
}
示例10: mfcn
MnUserParameterState MnHesse::operator()(const FCNBase& fcn, const MnUserParameterState& state, unsigned int maxcalls) const {
unsigned int n = state.variableParameters();
MnUserFcn mfcn(fcn, state.trafo());
MnAlgebraicVector x(n);
for(unsigned int i = 0; i < n; i++) x(i) = state.intParameters()[i];
double amin = mfcn(x);
Numerical2PGradientCalculator gc(mfcn, state.trafo(), theStrategy);
MinimumParameters par(x, amin);
FunctionGradient gra = gc(par);
MinimumState tmp = (*this)(mfcn, MinimumState(par, MinimumError(MnAlgebraicSymMatrix(n), 1.), gra, state.edm(), state.nfcn()), state.trafo(), maxcalls);
return MnUserParameterState(tmp, fcn.up(), state.trafo());
}
示例11: main
int main(int argc, char **argv)
{
printf("yield: the yield function\n");
initialize(0x40000000, 8192); // 1 GB total allocatable memory
code_p children[] = { child1, child2 };
void *args[] = { NULL, NULL };
uint stacksize[] = { 2000, 2000 };
par(children, args, stacksize, 2);
printf("After par\n");
return 0;
}
示例12: func
bool Compilador::InsertaFunc(string nomFunc, int tipo) {
if(ExisteFunc(nomFunc))
return false; //Ya existia, por lo tanto no inserto
//No existia la funcion, entonces la creo e inserto en la tabla
int direccion = vectorCuadruplos.size();
Funcion func(contFunciones, nomFunc, tipo, direccion);
contFunciones++;
std::pair<std::string,Funcion> par (nomFunc, func);
tablaFuncs.insert(par);
funcionActual = nomFunc;
return true;
}
示例13: bio
SEXP SP::func(SEXP biomass)
{
FLQuant bio(biomass);
FLQuant rtn(1,1,par.minyr(),par.maxyr(),par.nareas(),par.nseasons(),par.nunits(),par.niters());
int i, j, k, l, m;
int i, j, k, l, m;
for(m=1; m <= bio.niters(); m++) {
for (l = 1; l <= bio.nareas(); l++) {
for (k = 1; k <= bio.nseasons(); k++) {
for (j = 1; j <= bio.nunits(); j++) {
for (i = bio.minyr(); i <= bio.maxyr(); i++) {
switch(getSP(model)) {
case FLRConst_fletcher:
rtn(1,i,j,k,l,m) = spFletcher(bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m),par(3,i,j,k,l,m));
break;
case FLRConst_fox:
rtn(1,i,j,k,l,m) = spFox( bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m));
break;
case FLRConst_genfit:
rtn(1,i,j,k,l,m) = spGenfit( bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m),par(3,i,j,k,l,m));
break;
case FLRConst_gulland:
rtn(1,i,j,k,l,m) = spGulland( bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m));
break;
case FLRConst_logistic:
rtn(1,i,j,k,l,m) = spLogistic(bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m));
break;
case FLRConst_pellat:
rtn(1,i,j,k,l,m) = spPellaT( bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m),par(3,i,j,k,l,m));
break;
case FLRConst_schaefer:
rtn(1,i,j,k,l,m) = spSchaefer(bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m));
break;
case FLRConst_shepherd:
rtn(1,i,j,k,l,m) = spShepherd(bio(1,i,j,k,l,m),par(1,i,j,k,l,m),par(2,i,j,k,l,m),par(3,i,j,k,l,m));
break;
}
}
}
}
}
}
return rtn;
}
示例14: page_item
void
bridge_ornamented_rep::insert_ornament (box b) {
/*
ttt->insert_marker (st, ip);
array<page_item> l2= array<page_item> (1);
l2[0]= page_item (b);
ttt->insert_stack (l2, stack_border ());
*/
lazy_paragraph par (env, ip);
par->a= copy (ttt->a);
par->a << line_item (STD_ITEM, env->mode_op, b, HYPH_INVALID);
par->a << ttt->b;
par->format_paragraph ();
ttt->insert_stack (par->sss->l, par->sss->sb);
}
示例15: if
Parameters CalibratorKriging::train(const std::vector<ObsEns>& iData) const {
double timeStart = Util::clock();
float totalObs = 0;
float totalFcst = 0;
int counter = 0;
// Compute predictors in model
for(int i = 0; i < iData.size(); i++) {
float obs = iData[i].first;
std::vector<float> ens = iData[i].second;
float mean = Util::calculateStat(ens, Util::StatTypeMean);
if(Util::isValid(obs) && Util::isValid(mean)) {
totalObs += obs;
totalFcst += mean;
counter++;
}
}
float bias = Util::MV;
if(counter <= 0) {
std::stringstream ss;
ss << "CalibratorKriging: No valid data, no correction will be made.";
Util::warning(ss.str());
bias = 0;
}
else {
if(mOperator == Util::OperatorAdd) {
bias = (totalObs - totalFcst)/counter;
}
else if(mOperator == Util::OperatorSubtract) {
bias = (totalFcst - totalObs)/counter;
}
else if(mOperator == Util::OperatorMultiply) {
bias = totalObs / totalFcst;
}
else if(mOperator == Util::OperatorDivide) {
bias = totalFcst / totalObs;
}
else {
Util::error("CalibratorKriging: 'operator' not recognized");
}
}
std::vector<float> values(1, bias);
Parameters par(values);
double timeEnd = Util::clock();
std::cout << "Time: " << timeEnd - timeStart << std::endl;
return par;
}