本文整理汇总了C++中par函数的典型用法代码示例。如果您正苦于以下问题:C++ par函数的具体用法?C++ par怎么用?C++ par使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了par函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:EinNarr,项目名称:z3,代码行数:12,代码来源:api_tactic.cpp
示例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
}
开发者ID:trapoviejo,项目名称:GML,代码行数:12,代码来源:Compilador.cpp
示例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");
}
开发者ID:esterl,项目名称:kdet-omnetpp,代码行数:12,代码来源:Dropper.cpp
示例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();
*/
}
}
开发者ID:DrItanium,项目名称:LibExpertSystem,代码行数:52,代码来源:InstructionConstruction.cpp
示例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);
}
}
开发者ID:esterl,项目名称:kdet-omnetpp,代码行数:13,代码来源:Detector.cpp
示例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);
}
开发者ID:ArtisticCoding,项目名称:GPc,代码行数:13,代码来源:CMltools.cpp
示例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);
}
开发者ID:jaredhoberock,项目名称:bulk,代码行数:13,代码来源:execution_policy.hpp
示例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;
}
}
开发者ID:kurikaesu,项目名称:arsenalsuite,代码行数:51,代码来源:assettemplatedialog.cpp
示例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;
}
开发者ID:katerinabuts,项目名称:OOP_LAB,代码行数:14,代码来源:OOPLab4.cpp
示例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());
}
开发者ID:cdeil,项目名称:iminuit,代码行数:14,代码来源:MnHesse.cpp
示例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;
}
开发者ID:megoldsby,项目名称:cxp,代码行数:14,代码来源:yield.c
示例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;
}
开发者ID:trapoviejo,项目名称:GML,代码行数:14,代码来源:Compilador.cpp
示例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;
}
开发者ID:Gmerino,项目名称:biodyn,代码行数:47,代码来源:sp.cpp
示例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);
}
开发者ID:KarlHegbloom,项目名称:texmacs,代码行数:15,代码来源:bridge_gui.cpp
示例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;
}
开发者ID:cskarby,项目名称:gridpp,代码行数:48,代码来源:Kriging.cpp
示例16: main
int main(int argc,char **argv)
{
if(argc < 2){
HypherParameters::Error("Not enough parameters for cmd.");
}
string conf(argv[1]);
HypherParameters par(conf);
srand(par.CONF_random_seed);
Process *x;
switch(par.CONF_method){
case 4:
x = new M2_p2o1(conf);
break;
case 5:
x = new M2_p2o2(conf);
break;
case 6:
x = new M2_p2o3(conf);
break;
case 7:
x = new M3_pro2(conf);
break;
case 8:
x = new M3_pro3(conf);
break;
}
if(argc == 2){
//training
x->train();
if(par.CONF_test_file.length()>0 && par.CONF_gold_file.length()>0){
//test
string mach_best_name = par.CONF_mach_name+par.CONF_mach_best_suffix;
x->test(mach_best_name);
}
}
else if(argc == 3){
//only testing
x->test(string(argv[2]));
}
else if(argc == 5){
//check o1-filter
x->check_o1_filter(string(argv[2]),string(argv[3]),string(argv[4]));
}
else{
HypherParameters::Error("Wrong parameters for cmd.");
}
return 0;
}
开发者ID:zzzsss,项目名称:parsing3plus,代码行数:48,代码来源:main.cpp
示例17: par
void Detector::updateCores(CoresUpdate* update) {
cores = update->getCores();
boundaries = update->getBoundaries();
evaluateNextIter = std::vector<bool>(cores.size(), true);
double threshold = par("checkProbability").doubleValue() * double(UINT_MAX);
min_threshold = unsigned(threshold);
thresholds = std::vector<unsigned>(cores.size(), min_threshold);
randGenerators.clear();
std::vector<unsigned> secrets = update->getSecrets();
for (auto it = secrets.begin(); it < secrets.end(); it++) {
randGenerators.push_back(std::mt19937(*it));
}
monitor->setCores(cores);
monitor->setShareSummaries(evaluateNextIter);
delete update;
}
开发者ID:esterl,项目名称:kdet-omnetpp,代码行数:16,代码来源:Detector.cpp
示例18: par
Parameters KalmanParameters::toParameters() const {
std::vector<float> values;
for(int i = 0; i < x.size(); i++) {
values.push_back(x[i]);
}
for(int i = 0; i < k.size(); i++) {
values.push_back(k[i]);
}
for(int i = 0; i < P.size(); i++) {
for(int j = 0; j < P.size(); j++) {
values.push_back(P[i][j]);
}
}
Parameters par(values);
return par;
}
开发者ID:cskarby,项目名称:gridpp,代码行数:16,代码来源:KalmanFilter.cpp
示例19: main
int main(int argc, char* argv[])
{
std::signal(SIGINT, signal_handler);
std::signal(SIGTERM, signal_handler);
try {
Parameters par(argc, argv);
Application app(par, &signal_status);
app.run();
} catch (std::exception const& e) {
L_(fatal) << e.what();
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
开发者ID:Jiray,项目名称:flesnet,代码行数:16,代码来源:main.cpp
示例20:
inet::INetfilter::IHook::Result Dropper::datagramForwardHook(
inet::INetworkDatagram* datagram, const inet::InterfaceEntry* inIE,
const inet::InterfaceEntry*& outIE, inet::L3Address& nextHopAddr) {
// Drop with some prob.
if (datagram->getTransportProtocol() == DATA_PROTOCOL_NUMBER) {
inPackets++;
totalIn++;
if (std::rand() < double(par("dropProbability")) * double(RAND_MAX)) {
droppedPackets++;
totalDropped++;
return IHook::DROP;
}
outPackets++;
totalOut++;
}
return IHook::ACCEPT;
}
开发者ID:esterl,项目名称:kdet-omnetpp,代码行数:17,代码来源:Dropper.cpp
注:本文中的par函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论