本文整理汇总了C++中ParameterSet类的典型用法代码示例。如果您正苦于以下问题:C++ ParameterSet类的具体用法?C++ ParameterSet怎么用?C++ ParameterSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParameterSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadParams
void DynamicsStepCostEstimator::loadParams(const ParameterSet& params)
{
params.getParam("dynamic_step_cost_estimator/lower_step_limit", lower_step_limit);
params.getParam("dynamic_step_cost_estimator/upper_step_limit", upper_step_limit);
params.getParam("dynamic_step_cost_estimator/max_near_distance", max_near_distance_sq);
max_near_distance_sq = max_near_distance_sq*max_near_distance_sq;
}
示例2: findParameterSet
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ParameterSet* Config::findParameterSet(const std::string& publicID) const {
ParameterSet* object = ParameterSet::Cast(PublicObject::Find(publicID));
if ( object != NULL && object->parent() == this )
return object;
return NULL;
}
示例3: put
bool singleRPAJastrowBuilder::put(xmlNodePtr cur, int addOrbital)
{
MyName="Jep";
string rpafunc="RPA";
OhmmsAttributeSet a;
a.add(MyName,"name");
a.add(rpafunc,"function");
a.put(cur);
ParameterSet params;
RealType Rs(-1.0);
RealType Kc(-1.0);
params.add(Rs,"rs","double");
params.add(Kc,"kc","double");
params.put(cur);
if(Rs<0) {
Rs=tlen;
}
if(Kc<0){
Kc = 1e-6 ;
};
if (rpafunc=="RPA"){
myHandler= new LRRPAHandlerTemp<EPRPABreakup<RealType>,LPQHIBasis>(targetPtcl,Kc);
app_log()<<" using e-p RPA"<<endl;
}
else if (rpafunc=="dRPA") {
myHandler= new LRRPAHandlerTemp<derivEPRPABreakup<RealType>,LPQHIBasis>(targetPtcl,Kc);
app_log()<<" using e-p derivRPA"<<endl;
}
myHandler->Breakup(targetPtcl,Rs);
// app_log() << " Maximum K shell " << myHandler->MaxKshell << endl;
// app_log() << " Number of k vectors " << myHandler->Fk.size() << endl;
//Add short range part
Rcut = myHandler->get_rc()-0.1;
GridType* myGrid = new GridType;
int npts=static_cast<int>(Rcut/0.01)+1;
myGrid->set(0,Rcut,npts);
//create the numerical functor
nfunc = new FuncType;
SRA = new ShortRangePartAdapter<RealType>(myHandler);
SRA->setRmax(Rcut);
nfunc->initialize(SRA, myGrid);
J1s = new JneType (*sourcePtcl,targetPtcl);
for(int ig=0; ig<ng; ig++) {
J1s->addFunc(ig,nfunc);
}
app_log()<<" Only Short range part of E-I RPA is implemented"<<endl;
if (addOrbital) targetPsi.addOrbital(J1s,MyName);
return true;
}
示例4: ParameterSet
ParameterSet* VectoredFeldmanCousins::getParameterSet( ParameterSet* inputSet, ResultParameterSet* inputResult )
{
// Model 1 nuisence parameters are not changed
if( nuisenceModel == 0 )
{
return new ParameterSet( *inputSet );
}
// Model 2 nuisence parameters are varied within 1 sigma of their true value
else if( nuisenceModel == 1 )
{
ParameterSet* tempSet = new ParameterSet( *inputSet );
vector<string> all_params = tempSet->GetAllNames();
for( vector<string>::iterator param_i = all_params.begin(); param_i != all_params.end(); ++param_i )
{
PhysicsParameter* thisParameter = tempSet->GetPhysicsParameter( *param_i );
ResultParameter* thisResult = inputResult->GetResultParameter( *param_i );
if( thisParameter->GetType() != "Fixed" && !thisResult->GetScanStatus() )
{
TRandom3* rand_gen = RapidFitRandom::GetRandomFunction();
double new_value = rand_gen->Gaus( thisResult->GetValue(), thisResult->GetError() );
thisParameter->SetBlindedValue( new_value );
thisParameter->SetStepSize( thisResult->GetError() );
}
}
return tempSet;
}
else
{
cout << endl << "\t\tUNKNOWN NUICENCE MODEL, NOT DOING ANTYTHING!!!!" << endl << endl;
nuisenceModel = 0;
return this->getParameterSet( inputSet, inputResult );
}
}
示例5: TestCalculateScore_Dynamic_Rules
void TestCalculateScore_Dynamic_Rules()
{
HRESULT hr;
IplImage* img = cvLoadImage("TestLine.png",0);
SimpleFingerDetectionResultSet DRset = LoaderAndWriter::LoadDetectionResultSetFromFile("DR_20.00_12.00_50.00_160.00.txt");
MeasurementByRulesSet* measurementSet = new MeasurementByRulesSet();
CalculateScore_Dynamic myCal;
myCal.Init(img,20);
myCal.SetDetectionResult(DRset);
//myCal.DoCalculateScore(measurementSet);
//hr = myCal.RuleGetDiffAmongDRandGT_Set(1,DRset,*measurementSet);
//hr = myCal.RuleGetDistToTrace_Set(DRset,*measurementSet);
//hr = myCal.RuleCheckContinuous_Set(181,264,2,DRset,*measurementSet);
LoaderAndWriter::WriteMeasurementByRulesSetToFile(*measurementSet,"MeasurementByRulesSet.txt");
measurementSet->SetStartAndEndFrameNo(181,264);
float rate = measurementSet->GetGoodFrameRate();
ParameterSet paramSet;
paramSet.AddParameter("A",0);
paramSet.AddParameter("B",1);
paramSet.AddParameter("C",2);
ParamSetAndMeasurementByRulesSet tmp;
tmp.AddParamSetAndMeasurementSetPair(paramSet,*measurementSet);
LoaderAndWriter::WriteParameterSetAndMeasurementByRulesSetToFile(tmp,"ParamSetAndMeasurementByRulesSet.txt");
}
示例6: TestNewMethod
void TestNewMethod()
{
HRESULT hr;
//IplImage* img = cvLoadImage("TestLine.png",0);
IplImage *img = cvLoadImage("imgCenterLine_draw.png",0);
SimpleFingerDetectionResultSet DRset = LoaderAndWriter::LoadDetectionResultSetFromFile("DR_17.16_10.42_13.42_93.41.txt"); // multi-result
CalculateScore_Dynamic myCal;
//myCal.Init(img,5);
myCal.Init(img,10,1000);
myCal.SetDetectionResult(DRset);
MeasurementByTraceSet* msByTraceSet = new MeasurementByTraceSet();
myCal.DoCalculateScore(msByTraceSet);
LoaderAndWriter::WriteMeasurementByTraceSetToFile_new(*msByTraceSet,"newMeasurementByTraceSet.txt");
ParameterSet paramSet;
paramSet.AddParameter("A",0);
paramSet.AddParameter("B",1);
paramSet.AddParameter("C",2);
ParamSetAndMeasurementByTraceSet tmp;
tmp.AddParamSetAndMeasurementSetAndWeightPair(paramSet,*msByTraceSet,0.5);
LoaderAndWriter::WriteParameterSetAndMeasurementByTraceSetToFile_new(tmp,"newParaAndMeasurementByTraceSet.txt",1);
int x=0;
}
示例7: Init
HRESULT NextParametersGenerator::Init(const ParameterSet& paramSet, const ParameterSetRange& paramSetRange)
{
if(paramSet.GetParamNum() != paramSetRange.GetParamNum())
return E_FAIL;
int nParamNum = paramSet.GetParamNum();
m_currParamSet = paramSet;
m_paramSetRange = paramSetRange;
for(int x=0; x<nParamNum; x++)
{
m_currParamSet.SetParameterByIndex(x,m_paramSetRange.GetParameterLow(x));
}
m_nextParamSet = m_currParamSet;
//--- calculate total iteration ---
double low,high,step;
int times = 1;
int currTimes = 1;
for(int x=0; x<m_paramSetRange.GetParamNum(); x++)
{
m_paramSetRange.GetParameterRange(x,&low,&high,&step);
currTimes = (int)((high-low)/step) +1;
times *= currTimes;
}
m_nTotalIteration = times;
m_nCurrIteration = 0;
return S_OK;
}
示例8: SEISCOMP_DEBUG
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Parameter::detachFrom(PublicObject* object) {
if ( object == NULL ) return false;
// check all possible parents
ParameterSet* parameterSet = ParameterSet::Cast(object);
if ( parameterSet != NULL ) {
// If the object has been added already to the parent locally
// just remove it by pointer
if ( object == parent() )
return parameterSet->remove(this);
// The object has not been added locally so it must be looked up
else {
Parameter* child = parameterSet->findParameter(publicID());
if ( child != NULL )
return parameterSet->remove(child);
else {
SEISCOMP_DEBUG("Parameter::detachFrom(ParameterSet): parameter has not been found");
return false;
}
}
}
SEISCOMP_ERROR("Parameter::detachFrom(%s) -> wrong class type", object->className());
return false;
}
示例9: updateChild
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Config::updateChild(Object* child) {
ParameterSet* parameterSetChild = ParameterSet::Cast(child);
if ( parameterSetChild != NULL ) {
ParameterSet* parameterSetElement
= ParameterSet::Cast(PublicObject::Find(parameterSetChild->publicID()));
if ( parameterSetElement && parameterSetElement->parent() == this ) {
*parameterSetElement = *parameterSetChild;
return true;
}
return false;
}
ConfigModule* configModuleChild = ConfigModule::Cast(child);
if ( configModuleChild != NULL ) {
ConfigModule* configModuleElement
= ConfigModule::Cast(PublicObject::Find(configModuleChild->publicID()));
if ( configModuleElement && configModuleElement->parent() == this ) {
*configModuleElement = *configModuleChild;
return true;
}
return false;
}
return false;
}
示例10: ToString
/*--------------------------------------------------------------------------------*/
std::string AudioObjectParameters::ToString(bool pretty) const
{
ParameterSet params;
GetAll(params);
return params.ToString(pretty);
}
示例11: setParameters
//..........................
//To take the current value of a parameter into the instance
void TripleFixedResModel::setParameters( ParameterSet & parameters )
{
eventResolution = parameters.GetPhysicsParameter( eventResolutionName )->GetValue();
resScale = parameters.GetPhysicsParameter( resScaleName )->GetValue();
resScale2 = parameters.GetPhysicsParameter( resScale2Name )->GetValue();
resScale3 = parameters.GetPhysicsParameter( resScale3Name )->GetValue();
resFrac2 = parameters.GetPhysicsParameter( timeResFrac2Name )->GetValue();
resFrac3 = parameters.GetPhysicsParameter( timeResFrac3Name )->GetValue();
return;
}
示例12: add_parameters
void ParameterSet::add_parameters(ParameterSet ¶ms, bool replace_existing)
{
for (unsigned int i = 0; i < params.size(); i++)
{
EParameter *param = params.get_parameter(i);
if (param != nullptr)
add_parameter(*param, replace_existing);
else
LOG(WARNING) << __FILE__ << "(" << __LINE__ << ") : Null pointer";
}
}
示例13: attachTo
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Parameter::attachTo(PublicObject* parent) {
if ( parent == NULL ) return false;
// check all possible parents
ParameterSet* parameterSet = ParameterSet::Cast(parent);
if ( parameterSet != NULL )
return parameterSet->add(this);
SEISCOMP_ERROR("Parameter::attachTo(%s) -> wrong class type", parent->className());
return false;
}
示例14: LOG
ParameterSet::ParameterSet(ParameterSet ¶ms)
{
for (unsigned int i = 0; i<params.size(); i++)
{
EParameter *p = params.get_parameter(i);
if (p != nullptr)
add_parameter(*p, true);
else
LOG(WARNING) << __FILE__ << "(" << __LINE__ << ") : Null pointer";
delete p;
}
}
示例15: testLargeReply
// ENG-2553. Connection shouldn't timeout.
void testLargeReply() {
(m_client)->createConnection("localhost");
std::vector<Parameter> signature;
signature.push_back(Parameter(WIRE_TYPE_STRING));
signature.push_back(Parameter(WIRE_TYPE_STRING));
signature.push_back(Parameter(WIRE_TYPE_STRING));
Procedure proc("Insert", signature);
ParameterSet *params = proc.params();
params->addString("Hello").addString("World").addString("English");
m_voltdb->filenameForNextResponse("mimicLargeReply");
InvocationResponse response = (m_client)->invoke(proc);
CPPUNIT_ASSERT(response.success());
}