本文整理汇总了C++中ParameterMap类的典型用法代码示例。如果您正苦于以下问题:C++ ParameterMap类的具体用法?C++ ParameterMap怎么用?C++ ParameterMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParameterMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_M_0_sq_ob_Xpression
ex get_M_0_sq_ob_Xpression(ParameterMap &pm,bool withFS){
static ex xi_0 = M0_sq/ pow( 4. * Pi * f , 2 );
static ex fse_log_corr_M0 = gtilde1( sqrt( M0_sq ) * L );
static ex log_M0_L3 = log( M0_sq / pow( Lambda3 , 2 ) ) ;
static ex xi_pm = Mpm_sq/ pow( 4. * Pi * f , 2 );
static ex fse_log_corr_Mpm = gtilde1( sqrt( Mpm_sq ) * L );
static ex log_Mpm_L3 = log( Mpm_sq / pow( Lambda3 , 2 ) ) ;
static ex log_M0_X3 = log( M0_sq / pow( Xi3 , 2 ) ) ;
static ex X_FSE = Mpm_sq * ( 1. +2.*xi_pm * ( log_Mpm_L3 + fse_log_corr_Mpm ) - xi_0 * ( log_M0_L3 + fse_log_corr_M0 ))
+ 2 * c2 *( 1 - 4. * xi_0 * ( log_M0_X3 + fse_log_corr_M0) + CM0);
static ex X = Mpm_sq * ( 1. +2.*xi_pm * log_Mpm_L3 - xi_0 * log_M0_L3 )
+ 2 * c2 *( 1 - 4. * xi_0 * log_M0_X3 + CM0);
pm.add( B );
pm.add( f );
pm.add( c2 );
pm.add( Lambda3 );
pm.add( Xi3 );
pm.add( CM0 );
if( withFS )
return X_FSE;
else
return X;
}
示例2: while
void ConfigFileWriter::writeRouterModelFile(std::string filename,
NodeSet& ns)
{
std::fstream out;
std::set<std::string>::iterator it = ns.modelsUsed().begin();
if (it != ns.modelsUsed().end())
{
out.open(filename.c_str(), std::fstream::out | std::fstream::trunc);
}
while (it != ns.modelsUsed().end())
{
ParameterMap* parameters = Config::instance().getModelParameterList(*it);
const Parameter& model = parameters->getParameter("ROUTER-MODEL");
if (model != Parameter::unknownParameter)
{
out << model << std::endl;
ParameterMap::iterator pit = parameters->begin();
while (pit != parameters->end())
{
if (pit->first != "ROUTER-MODEL")
out << pit->second << std::endl;
pit++;
}
out << std::endl;
}
it++;
}
}
示例3: init
bool CSVWriter::init(const ParameterMap& params, const Ports<StreamInfo>& inp)
{
assert(inp.size()==1);
const StreamInfo& in = inp[0].data;
string outputFile = getStringParam("File", params);
m_precision = getIntParam("Precision",params);
if (m_precision > (BUFSIZE-10)) {
cerr << "WARNING: precision is too large ! use precision " << BUFSIZE - 10 << endl;
m_precision = BUFSIZE - 10;
}
int res = preparedirs(outputFile.c_str());
if (res!=0)
return false;
m_fout.open(outputFile.c_str(), ios_base::trunc);
if (!m_fout.is_open() || m_fout.bad())
return false;
if (getStringParam("Metadata",params)=="True") {
// write metadata at the beginnig of the file
string paramStr = getStringParam("Attrs",params);
map<string,string> params = decodeAttributeStr(paramStr);
ostringstream oss;
for (map<string,string>::const_iterator it=params.begin();it!=params.end();it++)
oss << "% " << it->first << "=" << it->second << endl;
m_fout.write(oss.str().c_str(),oss.str().size());
}
return true;
}
示例4: printf
bool SpecificWorker::setParametersAndPossibleActivation(const ParameterMap &prs, bool &reactivated)
{
printf("<<< setParametersAndPossibleActivation\n");
// We didn't reactivate the component
reactivated = false;
// Update parameters
params.clear();
for (ParameterMap::const_iterator it=prs.begin(); it!=prs.end(); it++)
{
printf("param:%s value:%s\n", it->first.c_str(), it->second.value.c_str());
params[it->first] = it->second;
}
printf("----\n");
try
{
action = "";
for (uint i=0; i<params["action"].value.size(); i++)
{
action += params["action"].value[i];
if (i+2<params["action"].value.size())
{
if (params["action"].value[i+1] == '_' and params["action"].value[i+2] == '_')
break;
}
}
std::transform(action.begin(), action.end(), action.begin(), ::tolower);
//
// action = params["action"].value;
if (action == "graspobject")
{
active = true;
}
else
{
active = true;
}
}
catch (...)
{
printf("exception in setParametersAndPossibleActivation %d\n", __LINE__);
return false;
}
// Check if we should reactivate the component
if (active)
{
active = true;
reactivated = true;
}
printf("setParametersAndPossibleActivation >>>\n");
return true;
}
示例5: DistanceFunction
ForceIdentityDistance::ForceIdentityDistance(const PointLayout& layout,
const ParameterMap& params)
: DistanceFunction(layout, params) {
validParams = QStringList() << "distance" << "params";
_dist = MetricFactory::create(params.value("distance"),
layout,
params.value("params", ParameterMap()).toParameterMap());
}
示例6: parseOptions
ParameterMap parseOptions(int argc, char* argv[]) {
if (argc < 3) {
usage();
}
QStringList args;
for (int i=0; i<argc; i++) args << argv[i];
ParameterMap options;
options.insert("inputFiles", args[1]);
options.insert("dataset", args[2]);
// this is ugly, but works...
for (int i=0; i<args.size(); i++) {
if (args[i].startsWith("--select=")) {
descs_select = args[i].mid(9).split(",");
args.removeAt(i);
i--;
}
if (args[i].startsWith("--exclude=")) {
descs_exclude = args[i].mid(10).split(",");
args.removeAt(i);
i--;
}
if (args[i].startsWith("--reflayout=")) {
layout = new PointLayout();
Point refp; refp.load(args[i].mid(12));
*layout = refp.layout();
args.removeAt(i);
i--;
}
if (args[i].startsWith("--nthreads=")) {
QThreadPool::globalInstance()->setMaxThreadCount(args[i].mid(11).toInt());
args.removeAt(i);
i--;
}
}
int start = 0, end = 10000000;
if (args.size() > 3) start = args[3].toInt();
if (args.size() > 4) end = args[4].toInt();
if (args.size() > 5) usage();
options.insert("start", start);
options.insert("end", end);
return options;
}
示例7: this
int Scenario::loadMapBuf(string mapn) {
mapname=mapn;
ifstream mapfile;
string tmpline;
string loadfile=config.datadir+mapname;
mapfile.open(loadfile.c_str());
if (mapfile) {
cout << "Loading new map: " << loadfile << endl;
} else {
cout << "Map loading failed: " << loadfile << " not found!\n";
return 2;
}
mapbuf.clear();
/* We parse the parameters to add a name if it was missing
This whole file reading looks much more complicated because
of this (otherwise there would only be mapbuf.push_back(tmpline) */
string cname;
Uint16 x,y;
ParameterMap parameters;
bool header=true;
std::map<string,Uint16> namecount;
while (getline(mapfile,tmpline)) {
if (header) {
mapbuf.push_back(tmpline);
std::istringstream tmpstream(tmpline);
tmpstream >> cname;
if (cname[0]=='#') {
if (cname=="#ENDHEADER") header=false;
continue;
}
} else {
cname.erase();
x=y=0;
std::istringstream tmpstream(tmpline);
tmpstream >> cname >> x >> y;
if (cname.empty() || cname[0]=='#') {
mapbuf.push_back(tmpline);
continue;
} else {
namecount[cname]++;
}
string parameterlist((istreambuf_iterator<char>(tmpstream)), istreambuf_iterator<char>());
parameters=getParameters(parameterlist);
if (!hasParam(parameters,"name")) {
if (parameters.empty()) tmpline+=" name="+cname+itos(namecount[cname]);
else tmpline+=", name="+cname+itos(namecount[cname]);
}
mapbuf.push_back(tmpline);
}
}
示例8: ParseValue
// Called to parse a RCSS keyword declaration.
bool PropertyParserKeyword::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
{
ParameterMap::const_iterator iterator = parameters.find(value);
if (iterator == parameters.end())
return false;
property.value = Variant((*iterator).second);
property.unit = Property::KEYWORD;
return true;
}
示例9: get_M_pm_sq_ob_FSE_Xpression
ex get_M_pm_sq_ob_FSE_Xpression(ParameterMap & pm ){
static ex X_FSE = Mpm_sq * M0_sq / pow( 4. * Pi * f , 2 ) * gtilde1( sqrt( M0_sq ) * L ) ;
pm.add( B );
pm.add( f );
pm.add( c2 );
return X_FSE;
}
示例10: ParameterMap
ParameterMap Driver::parameters() {
if(!isValid()) {
return ParameterMap();
}
ParameterMap parameterMap;
const JSList *parameters = jackctl_driver_get_parameters(_jackDriver);
while(parameters) {
Parameter p = Parameter((jackctl_parameter_t*)parameters->data);
parameterMap.insert(p.name(), p);
parameters = parameters->next;
}
return parameterMap;
}
示例11: get_f_pm_ob_FSE_Xpression
ex get_f_pm_ob_FSE_Xpression(ParameterMap & pm ){
static ex xi_pm = Mpm_sq/ pow( 4. * Pi * f , 2 );
static ex xi_0 = M0_sq/ pow( 4. * Pi * f , 2 );
static ex fse_log_corr_Mpm = gtilde1( sqrt( Mpm_sq ) * L );
static ex fse_log_corr_M0 = gtilde1( sqrt( M0_sq ) * L );
static ex X_FSE = f * ( - ( xi_pm * fse_log_corr_Mpm + xi_0 * fse_log_corr_M0 ) ) ;
pm.add( B );
pm.add( f );
pm.add( c2 );
return X_FSE;
}
示例12: DeleteMessageException
DeleteMessageResponse*
SQSConnection::deleteMessage(const std::string &aQueueUrl, const std::string &aReceiptHandle)
{
ParameterMap lMap;
lMap.insert ( ParameterPair ( "ReceiptHandle", aReceiptHandle ) );
DeleteMessageHandler lHandler;
makeQueryRequest ( aQueueUrl, "DeleteMessage", &lMap, &lHandler );
if (lHandler.isSuccessful()) {
setCommons(lHandler, lHandler.theDeleteMessageResponse);
return lHandler.theDeleteMessageResponse;
} else {
throw DeleteMessageException( lHandler.getQueryErrorResponse() );
}
}
示例13: get_M_0_sq_ob_FSE_Xpression
ex get_M_0_sq_ob_FSE_Xpression(ParameterMap & pm ){
static ex xi_0 = M0_sq/ pow( 4. * Pi * f , 2 );
static ex fse_log_corr_M0 = gtilde1( sqrt( M0_sq ) * L );
static ex xi_pm = Mpm_sq/ pow( 4. * Pi * f , 2 );
static ex fse_log_corr_Mpm = gtilde1( sqrt( Mpm_sq ) * L );
static ex X_FSE = Mpm_sq * ( 2.*xi_pm * fse_log_corr_Mpm - xi_0 * fse_log_corr_M0 )
+ 2 * c2 *( - 4. * xi_0 * fse_log_corr_M0 );
pm.add( B );
pm.add( f );
pm.add( c2 );
return X_FSE;
}
示例14: rotateComponent
/**
* Add/modify an entry in the parameter map for the given component
* to update its rotation. The component is const
* as the move doesn't actually change the object
* @param comp A reference to the component to move
* @param pmap A reference to the ParameterMap that will hold the new position
* @param rot The rotation quaternion
* @param rotType Defines how the given rotation should be interpreted @see
* TransformType enumeration
*/
void rotateComponent(const IComponent &comp, ParameterMap &pmap,
const Kernel::Quat &rot, const TransformType rotType) {
//
// This behaviour was copied from how RotateInstrumentComponent worked
//
Quat newRot = rot;
if (rotType == Absolute) {
// Find the corresponding relative position
auto parent = comp.getParent();
if (parent) {
Quat rot0 = parent->getRelativeRot();
rot0.inverse();
newRot = rot * rot0;
}
} else if (rotType == Relative) {
const Quat &Rot0 = comp.getRelativeRot();
newRot = Rot0 * rot;
} else {
throw std::invalid_argument("rotateComponent - Unknown rotType: " +
boost::lexical_cast<std::string>(rotType));
}
// Add a parameter for the new rotation
pmap.addQuat(comp.getComponentID(), "rot", newRot);
}
示例15: getParameters
void OutputFormat::setParameters(const std::string& outDir,
const ParameterMap& formatParams)
{
m_outDir = outDir;
m_params.clear();
ParameterDescriptorList pList = getParameters();
for (ParameterDescriptorList::iterator it=pList.begin();
it!=pList.end(); it++) {
ParameterMap::const_iterator pIt = formatParams.find(it->m_identifier);
if (pIt!=formatParams.end()) {
m_params[it->m_identifier] = pIt->second;
} else {
m_params[it->m_identifier] = it->m_defaultValue;
}
}
}