本文整理汇总了C++中updateParameters函数的典型用法代码示例。如果您正苦于以下问题:C++ updateParameters函数的具体用法?C++ updateParameters怎么用?C++ updateParameters使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updateParameters函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: updateParameters
/// Slot called on completion of the Fit algorithm.
/// @param error :: Set to true if Fit finishes with an error.
void MultiDatasetFit::finishFit(bool error) {
if (!error) {
m_plotController->clear();
m_plotController->update();
Mantid::API::IFunction_sptr fun;
auto algorithm = m_fitRunner->getAlgorithm();
if (m_fitOptionsBrowser->getCurrentFittingType() ==
MantidWidgets::FitOptionsBrowser::Simultaneous) {
// After a simultaneous fit
fun = algorithm->getProperty("Function");
updateParameters(*fun);
auto status =
QString::fromStdString(algorithm->getPropertyValue("OutputStatus"));
auto chiSquared = QString::fromStdString(
algorithm->getPropertyValue("OutputChi2overDoF"));
setFitStatusInfo(status, chiSquared);
formatParametersForPlotting(
*fun, algorithm->getPropertyValue("OutputParameters"));
} else {
// After a sequential fit
auto paramsWSName =
m_fitOptionsBrowser->getProperty("OutputWorkspace").toStdString();
if (!Mantid::API::AnalysisDataService::Instance().doesExist(paramsWSName))
return;
size_t nSpectra = getNumberOfSpectra();
if (nSpectra == 0)
return;
fun = m_functionBrowser->getGlobalFunction();
auto nParams = fun->nParams() / nSpectra;
auto params = Mantid::API::AnalysisDataService::Instance()
.retrieveWS<Mantid::API::ITableWorkspace>(paramsWSName);
if (nParams * 2 + 2 != params->columnCount()) {
throw std::logic_error(
"Output table workspace has unexpected number of columns.");
}
for (size_t index = 0; index < nSpectra; ++index) {
std::string prefix =
"f" + boost::lexical_cast<std::string>(index) + ".";
for (size_t ip = 0; ip < nParams; ++ip) {
auto colIndex = ip * 2 + 1;
auto column = params->getColumn(colIndex);
fun->setParameter(prefix + column->name(), column->toDouble(index));
}
}
updateParameters(*fun);
showParameterPlot();
clearFitStatusInfo();
}
}
m_uiForm.btnFit->setEnabled(true);
}
开发者ID:samueljackson92,项目名称:mantid,代码行数:53,代码来源:MultiDatasetFit.cpp
示例2: updateParameters
void GaussianBlurFilter::onKeyPressed(int key) {
// if (key==OF_KEY_LEFT) _blurSize--;
// else if (key==OF_KEY_RIGHT) _blurSize++;
// else if (key==OF_KEY_UP) _bloom += 0.1;
// else if (key==OF_KEY_DOWN) _bloom -= 0.1;
updateParameters();
}
开发者ID:chemabc,项目名称:ofxFilterLibrary,代码行数:7,代码来源:GaussianBlurFilter.cpp
示例3: parameterData
KBootParms::KBootParms(const void *bootData, uval32 partRef)
: parameterData(NULL), parameterDataLength(0), dataRef(partRef)
{
if (!updateParameters(bootData, false)) {
passertMsg(false, "Passed invalid data\n");
}
}
开发者ID:BillTheBest,项目名称:k42,代码行数:7,代码来源:KBootParms.C
示例4: updateParameters
//==============================================================================
void DrumSynthEnvelope::resized ()
{
xDelta = (getWidth ()) / MAX_ENVELOPE_LENGTH;
yDelta = (getHeight ()) / MAX_ENVELOPE_GAIN;
updateParameters (false);
开发者ID:alessandropetrolati,项目名称:juced,代码行数:7,代码来源:DrumSynthEnvelope.cpp
示例5: updateParameters
void UserSpecificQueryWrapperObject::setUserId(const QString &userId)
{
if (m_userId != userId) {
m_userId = userId;
updateParameters();
emit userIdChanged();
}
}
开发者ID:froksen,项目名称:harbour-twablet,代码行数:8,代码来源:userspecificquerywrapperobject.cpp
示例6: updateParameters
void BilateralFilter::onKeyPressed(int key) {
// float blurOffset = _texelSpacing.x;
// if (key==OF_KEY_DOWN) blurOffset -= 0.5f;
// else if (key==OF_KEY_UP) blurOffset += 0.5f;
// else if (key==OF_KEY_LEFT) _normalization -=0.5;
// else if (key==OF_KEY_RIGHT) _normalization += 0.5;
updateParameters();
}
开发者ID:chemabc,项目名称:ofxFilterLibrary,代码行数:8,代码来源:BilateralFilter.cpp
示例7: updateVelocity
// ------------- update
void EyeLinker::update(){
updateVelocity();
updateParameters();
updatePhysics();
updateEye();
updateFading();
updateFireworks();
}
开发者ID:ofZach,项目名称:funkyForms,代码行数:9,代码来源:EyeLinker.cpp
示例8: updateParameters
ptRecorder::ptRecorder() { // constructor for class JoyTeleop
joySub = nh.subscribe("/joy", 10, &ptRecorder::joyCallback, this);
poseSub = nh.subscribe("/robot_pose", 10, &ptRecorder::poseCallback, this);
pointPub= nh.advertise<geometry_msgs::PoseStamped>("/pt", 10);
updateParameters();
}
开发者ID:1487quantum,项目名称:fyp-autonomous-bot,代码行数:8,代码来源:pointrecorder.cpp
示例9: mb_estimator_update
/***************** ENTRY-POINT FUNCTION CALL *****************************
* *
**************************************************************************/
void mb_estimator_update(void) {
clear_UI_LED(); // Clears all LEDs that had been active on the previous cycle
if (INITIALIZE_ESTIMATOR) {
// Initialize the filter coefficients:
setFilterCoeff(&FC_FAST, FILTER_CUTOFF_FAST);
setFilterCoeff(&FC_SLOW, FILTER_CUTOFF_SLOW);
setFilterCoeff(&FC_VERY_SLOW, FILTER_CUTOFF_VERY_SLOW);
// Reset the joint angle rate filters
setFilterData(&FD_OUTER_LEG_ANGLE, ID_UI_ROLL);
setFilterData(&FD_UI_ANG_RATE_X, ID_UI_ANG_RATE_X);
setFilterData(&FD_MCH_ANG_RATE, ID_MCH_ANG_RATE);
setFilterData(&FD_MCFO_RIGHT_ANKLE_RATE, ID_MCFO_RIGHT_ANKLE_RATE);
setFilterData(&FD_MCFI_ANKLE_RATE, ID_MCFI_ANKLE_RATE);
// Reset the contact sensor filters
setFilterData(&FD_MCFO_LEFT_HEEL_SENSE, ID_MCFO_LEFT_HEEL_SENSE);
setFilterData(&FD_MCFO_RIGHT_HEEL_SENSE, ID_MCFO_RIGHT_HEEL_SENSE);
setFilterData(&FD_MCFI_LEFT_HEEL_SENSE, ID_MCFI_LEFT_HEEL_SENSE);
setFilterData(&FD_MCFI_RIGHT_HEEL_SENSE, ID_MCFI_RIGHT_HEEL_SENSE);
// Steering motor stuff:
setFilterData(&FD_MCSI_STEER_ANGLE, ID_MCSI_STEER_ANGLE);
// Robot orientation estimation
resetRobotOrientation();
getIntegralRateGyro(); // Run integral to log the current state of the rate gyro
// Set "once per step" variables:
STATE_lastStepLength = 0.0; // Initialize to zero, for lack of a better plan
STATE_lastStepTimeSec = STATE_t; // cpu clock time at last heel strike.
STATE_lastStepDuration = 0.0; // Duration of the last step (seconds)
STATE_lastEstTime = 0.001 * mb_io_get_float(ID_TIMESTAMP);
// Remember that we've initialized everything properly
INITIALIZE_ESTIMATOR = false;
}
STATE_t = 0.001 * mb_io_get_float(ID_TIMESTAMP); // Robot Time (converted to seconds)
runAllFilters();// Run the butterworth filters:
updateRobotOrientation();
sendTotalPower();
updateEnergyUsage(); // Must come after sendTotalPower()
// Update the state variables: (absolute orientation and rate)
updateRobotState();
// Update controller parameters from LabVIEW
updateParameters();
// Check if the robot fell down
checkIfRobotFellDown();
STATE_lastEstTime = STATE_t; // Update previous estimation time.
return;
}
开发者ID:RuinaLab,项目名称:Ranger,代码行数:61,代码来源:mb_estimator.c
示例10: trainStochasticGradientDescent
// executes serial implementation of stochastic gradient descent for
// logistic regression with a fixed number of iterations
// config_params: {step_size, characteristic_time}
void trainStochasticGradientDescent(
DataSet training_set,
TrainingOptions training_options) {
// shuffle datapoints in order to add more stochasticity
// shuffleKeyValue(training_set.data_points, training_set.labels,
// training_set.num_data_points, training_set.num_features);
FeatureType* gradient = new FeatureType[training_set.num_features];
// read configuration parameters
double step_size = *training_options.step_size;
const double characteristic_time =
(fieldExists(training_options.config_params, "characteristic_time"))
? training_options.config_params["characteristic_time"]
: CHARACTERISTIC_TIME;
size_t curr_num_epochs =
(fieldExists(training_options.config_params, "curr_num_epochs"))
? training_options.config_params["curr_num_epochs"]
: 0;
double annealed_step_size = step_size;
for (size_t k = 0; k < training_options.num_epochs; k++) {
// simulated annealing (reduces step size as it converges)
annealed_step_size = training_options.config_params["initial_step_size"]
/ (1.0
+ (curr_num_epochs
* training_set.num_data_points
/ characteristic_time));
curr_num_epochs++;
for (size_t i = 0; i < training_set.num_data_points; i++) {
// computes gradient
gradientForSinglePoint(
training_set.parameter_vector,
&training_set.data_points[i * training_set.num_features],
training_set.labels[i],
training_set.num_features,
gradient);
// updates parameter vector
updateParameters(
training_set.parameter_vector,
gradient,
training_set.num_features,
annealed_step_size);
}
}
*training_options.step_size = annealed_step_size;
delete[] gradient;
}
开发者ID:yw778,项目名称:testApplication,代码行数:60,代码来源:sgd_baseline.cpp
示例11: boldDriver
// Bold Driver: adjusting the step size according to the result of the
// last step and reverting the step if results are worse than they were before.
static void boldDriver(
DataSet training_set,
FeatureType* gradient,
double* step_size) {
double previous_loss = lossFunction(training_set);
updateParameters(training_set.parameter_vector,
gradient,
training_set.num_features,
*step_size);
double current_loss = lossFunction(training_set);
// if it's going in the right direction, increase step size
if (current_loss < previous_loss) {
*step_size *= 1.045;
}
// if the previous step was too big and the loss increased,
// revert step and reduce step size
else {
bool revert = true;
int num_reverts = 0, max_reverts = 10;
while (revert && (num_reverts < max_reverts)) {
updateParameters(training_set.parameter_vector,
gradient,
training_set.num_features,
*step_size,
revert);
*step_size *= 0.5;
updateParameters(training_set.parameter_vector,
gradient,
training_set.num_features,
*step_size);
current_loss = lossFunction(training_set);
revert = (current_loss > previous_loss);
}
}
}
开发者ID:yw778,项目名称:testApplication,代码行数:46,代码来源:batch_baseline.cpp
示例12: updateParameters
bool functor::useParameters(functor::parameters& theParams) {
if (ownParams) {
delete params;
params = 0;
}
params = &theParams;
ownParams = false;
return updateParameters();
}
开发者ID:chenbk85,项目名称:alcordev,代码行数:10,代码来源:ltiFunctor.cpp
示例13: updateParameters
void Unison::setSize(int new_size)
{
if(new_size < 1)
new_size = 1;
unison_size = new_size;
alloc.devalloc(uv);
uv = alloc.valloc<UnisonVoice>(unison_size);
first_time = true;
updateParameters();
}
开发者ID:xsgoodbox,项目名称:zynaddsubfx,代码行数:10,代码来源:Unison.cpp
示例14: updateEvent
void PanelObjectEvent::on_radioButtonEventUser_toggled(bool checked) {
ui->comboBoxEventsUser->setEnabled(checked);
m_event->setIsSystem(false);
QStandardItemModel *model = RPM::get()->project()->gameDatas()
->commonEventsDatas()->modelEventsUser();
SystemEvent *super = reinterpret_cast<SystemEvent *>(model->item(ui
->comboBoxEventsUser->currentIndex())->data().value<quintptr>());
updateEvent(super);
updateParameters(super);
}
开发者ID:Wano-k,项目名称:RPG-Paper-Maker,代码行数:10,代码来源:panelobjectevent.cpp
示例15: updateParameters
void ColorGradationPlugin::changedParam( const OFX::InstanceChangedArgs& args, const std::string& paramName )
{
if( paramName == kParamInvert )
{
int in = _paramIn->getValue();
_paramIn->setValue ( _paramOut->getValue() );
_paramOut->setValue( in );
}
updateParameters();
}
开发者ID:Finaler,项目名称:TuttleOFX,代码行数:10,代码来源:ColorGradationPlugin.cpp
示例16: updateParameters
void Unison::setSize(int new_size)
{
if(new_size < 1)
new_size = 1;
unison_size = new_size;
if(uv)
delete [] uv;
uv = new UnisonVoice[unison_size];
first_time = true;
updateParameters();
}
开发者ID:CallisteHanriat,项目名称:lmms,代码行数:11,代码来源:Unison.cpp
示例17: getElapsedTime
void MovingDots::drawFrame(shared_ptr<StimulusDisplay> display) {
//
// If we're drawing to the main display, update dots
//
if (display->getCurrentContextIndex() == 0) {
currentTime = getElapsedTime();
if (previousTime != currentTime) {
updateParameters();
updateDots();
previousTime = currentTime;
}
}
if (0 == currentNumDots) {
// No dots, so nothing to draw
return;
}
//
// Draw the dots
//
glPushMatrix();
glTranslatef(fieldCenterX->getValue().getFloat(), fieldCenterY->getValue().getFloat(), 0.0f);
glScalef(currentFieldRadius, currentFieldRadius, 1.0f);
glRotatef(direction->getValue().getFloat(), 0.0f, 0.0f, 1.0f);
// Enable antialiasing so dots are round, not square
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation(GL_FUNC_ADD);
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
glColor4f(red->getValue().getFloat(),
green->getValue().getFloat(),
blue->getValue().getFloat(),
alpha->getValue().getFloat());
glEnableClientState(GL_VERTEX_ARRAY);
glPointSize(dotSize->getValue().getFloat() * dotSizeToPixels[display->getCurrentContextIndex()]);
glVertexPointer(verticesPerDot, GL_FLOAT, 0, &(dotPositions[0]));
glDrawArrays(GL_POINTS, 0, currentNumDots);
glDisableClientState(GL_VERTEX_ARRAY);
glDisable(GL_BLEND);
glDisable(GL_POINT_SMOOTH);
glPopMatrix();
}
开发者ID:benvermaercke,项目名称:mworks,代码行数:53,代码来源:MovingDots.cpp
示例18: response
bool EngineEffectChain::processEffectsRequest(const EffectsRequest& message,
EffectsResponsePipe* pResponsePipe) {
EffectsResponse response(message);
switch (message.type) {
case EffectsRequest::ADD_EFFECT_TO_CHAIN:
if (kEffectDebugOutput) {
qDebug() << debugString() << "ADD_EFFECT_TO_CHAIN"
<< message.AddEffectToChain.pEffect
<< message.AddEffectToChain.iIndex;
}
response.success = addEffect(message.AddEffectToChain.pEffect,
message.AddEffectToChain.iIndex);
break;
case EffectsRequest::REMOVE_EFFECT_FROM_CHAIN:
if (kEffectDebugOutput) {
qDebug() << debugString() << "REMOVE_EFFECT_FROM_CHAIN"
<< message.RemoveEffectFromChain.pEffect
<< message.RemoveEffectFromChain.iIndex;
}
response.success = removeEffect(message.RemoveEffectFromChain.pEffect,
message.RemoveEffectFromChain.iIndex);
break;
case EffectsRequest::SET_EFFECT_CHAIN_PARAMETERS:
if (kEffectDebugOutput) {
qDebug() << debugString() << "SET_EFFECT_CHAIN_PARAMETERS"
<< "enabled" << message.SetEffectChainParameters.enabled
<< "mix" << message.SetEffectChainParameters.mix;
}
response.success = updateParameters(message);
break;
case EffectsRequest::ENABLE_EFFECT_CHAIN_FOR_CHANNEL:
if (kEffectDebugOutput) {
qDebug() << debugString() << "ENABLE_EFFECT_CHAIN_FOR_CHANNEL"
<< message.channel;
}
response.success = enableForChannel(message.channel);
break;
case EffectsRequest::DISABLE_EFFECT_CHAIN_FOR_CHANNEL:
if (kEffectDebugOutput) {
qDebug() << debugString() << "DISABLE_EFFECT_CHAIN_FOR_CHANNEL"
<< message.channel;
}
response.success = disableForChannel(message.channel);
break;
default:
return false;
}
pResponsePipe->writeMessages(&response, 1);
return true;
}
开发者ID:PetrBarborka,项目名称:mixxx,代码行数:50,代码来源:engineeffectchain.cpp
示例19: QListViewItem
void AddAction::updateProfileFunctions()
{
ProfileServer *theServer = ProfileServer::profileServer();
theProfileFunctions->clear();
profileFunctionMap.clear();
if(!theProfiles->currentItem()) return;
const Profile *p = theServer->profiles()[profileMap[theProfiles->currentItem()]];
QDict<ProfileAction> dict = p->actions();
for(QDictIterator<ProfileAction> i(dict); i.current(); ++i)
profileFunctionMap[new QListViewItem(theProfileFunctions, i.current()->name(), QString().setNum(i.current()->arguments().count()), i.current()->comment())] = i.currentKey();
updateParameters();
updateOptions();
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:14,代码来源:addaction.cpp
示例20: updateParameters
//-------------------------------------------------------------------------------
void DialogLoadMBLUE::slotParameterUpdated()
{
updateParameters();
int npts = (int) (ceil(fabs(xmax-xmin))*ceil(fabs(ymax-ymin))*400 );
int nbrec = (int) days*24/interval +1;
double nbdata = 0;
nbdata += wind ? 4.4 / 3.6 : 0;
nbdata += GUSTsfc ? 3.4 / 5.7 : 0;
nbdata += pressure ? 3.4 / 4.2 : 0;
nbdata += rain ? 3.4 / 8.0 : 0;
nbdata += cloud ? 3.4 / 9.9 : 0;
nbdata += temp ? 3.4 / 3.9 : 0;
nbdata += humid ? 3.4 / 5.3 : 0;
nbdata += CAPEsfc ? 3.4 / 7.9 : 0;
if (chkAltitude500->isChecked()) nbdata += 6.3 / 3.3;
if (chkAltitude700->isChecked()) nbdata += 6.3 / 3.3;
if (chkAltitude850->isChecked()) nbdata += 6.3 / 3.3;
int head = (nbdata>0) ? 512 : 0;
double estime = head + nbdata*4*nbrec*npts;
// compress
/* if (estime < 2000) estime /= 16;
else if (estime < 6000) estime /= 14;
else if (estime < 15000) estime /= 8;
else if (estime < 100000) estime /= 6;
else estime /= 5;*/
// estime /= 3; // zip
estime = estime/1024; // ko
// DBG ("estime= %d ko", (int)estime);
double compress;
compress = 4.2;
slotGribMessage(tr("Size: %1 ko approx").arg((int)(estime/compress)) );
if (estime == 0)
btOK->setEnabled(false);
else
btOK->setEnabled(true);
}
开发者ID:prohan91,项目名称:zyGrib,代码行数:50,代码来源:DialogLoadMBLUE.cpp
注:本文中的updateParameters函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论