• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sk函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中sk函数的典型用法代码示例。如果您正苦于以下问题:C++ sk函数的具体用法?C++ sk怎么用?C++ sk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sk函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sk

// set value
void ReservoirMethod::SetValue(const char* key, float value)
{
	string sk(key);
	if (StringMatch(sk,"TimeStep"))
		m_TimeStep = int(value);
	else if (StringMatch(sk, "ThreadNum"))
		omp_set_num_threads((int)value);
	else if (StringMatch(sk,"CellSize"))
		m_nCells = int(value);
	else if (StringMatch(sk,"CellWidth"))
		m_CellWidth = int(value);
	else if (StringMatch(sk,"Kg"))
		m_Kg = value;
	else if (StringMatch(sk,"Base_ex"))
		m_Base_ex = value;
	else if (StringMatch(sk,"df_coef"))
		m_dp_co = value;
	else if (StringMatch(sk,"GW0"))
		m_GW0 = value;
	else if (StringMatch(sk,"GWMAX"))
		m_GWMAX = value;
	//else if(StringMatch(sk, "UpperSoilDepth"))		
	//	m_upSoilDepth = value;
	else
		throw ModelException("GWA_RE","SetValue","Parameter " + sk + " does not exist in GWA_RE module. Please contact the module developer.");
	
}
开发者ID:SmileEric,项目名称:SEIMS,代码行数:28,代码来源:ReservoirMethod.cpp


示例2: m_id

RegionDesc::Block::Block(const Func* func,
                         bool        resumed,
                         Offset      start,
                         int         length,
                         FPInvOffset initSpOff,
                         uint16_t    inlineLevel)
  : m_id(s_nextId--)
  , m_func(func)
  , m_resumed(resumed)
  , m_start(start)
  , m_last(kInvalidOffset)
  , m_length(length)
  , m_initialSpOffset(initSpOff)
  , m_inlinedCallee(nullptr)
  , m_inlineLevel(inlineLevel)
{
  assertx(length >= 0);
  if (length > 0) {
    SrcKey sk(func, start, resumed);
    for (unsigned i = 1; i < length; ++i) sk.advance();
    m_last = sk.offset();
  }
  checkInstructions();
  checkMetadata();
}
开发者ID:DREVILSWATERBOY,项目名称:hhvm,代码行数:25,代码来源:region-selection.cpp


示例3: initialOutputs

void ReservoirMethod::Get1DData(const char *key, int *nRows, float **data)
{
	initialOutputs();
    string sk(key);
    if (StringMatch(sk, VAR_REVAP))
    {
        *data = m_D_Revap;
        *nRows = m_nCells;
    }
    else if (StringMatch(sk, VAR_RG))
    {
        *data = m_T_RG;
        *nRows = m_nSubbasins + 1;
    }
    else if (StringMatch(sk, VAR_SBQG))
    {
        *data = m_T_QG;
        *nRows = m_nSubbasins + 1;
    }
    else if (StringMatch(sk, VAR_SBGS))
    {
        *data = m_gwStore;
        *nRows = m_nSubbasins + 1;
    }
    else if (StringMatch(sk, VAR_SBPET))
    {
        *data = m_petSubbasin;
        *nRows = m_nSubbasins + 1;
    }
    else
        throw ModelException(MID_GWA_RE, "Get1DData", "Parameter " + sk + " does not exist.");
}
开发者ID:gaohr,项目名称:SEIMS,代码行数:32,代码来源:ReservoirMethod.cpp


示例4: main

int main(int argc, char *argv[]) {
    long m, p, r, L, R;
    ArgMapping argmap;
	MDL::Timer timer;
    argmap.arg("m", m, "m");
    argmap.arg("L", L, "L");
    argmap.arg("p", p, "p");
    argmap.arg("r", r, "r");
    argmap.arg("R", R, "R");
    argmap.parse(argc, argv);
	timer.start();
    FHEcontext context(m, p, r);
    buildModChain(context, L);
    FHESecKey sk(context);
    sk.GenSecKey(64);
    addSome1DMatrices(sk);
    FHEPubKey pk = sk;

    auto G       = context.alMod.getFactorsOverZZ()[0];
    EncryptedArray ea(context, G);
	timer.end();
    printf("slots %ld\n", ea.size());
	printf("Key Gen %f\n", timer.second());
    auto data = load_csv("adult.data", R);
    benchmark(ea, pk, sk, data);
}
开发者ID:fionser,项目名称:MDLHELib,代码行数:26,代码来源:benchmark_covariance.cpp


示例5: sk

void ReservoirMethod::Set1DData(const char *key, int n, float *data)
{
    string sk(key);
    if (StringMatch(sk, VAR_GWNEW))
    {
        m_VgroundwaterFromBankStorage = data;
		return;
    }

    //check the input data
    if (!CheckInputSize(key, n)) return;

    //set the value
    if (StringMatch(sk, VAR_INET))
        m_D_EI = data;
    else if (StringMatch(sk, VAR_DEET))
        m_D_ED = data;
    else if (StringMatch(sk, VAR_SOET))
        m_D_ES = data;
	else if (StringMatch(sk, VAR_AET_PLT))
		m_plantEP = data;
    else if (StringMatch(sk, VAR_PET))
        m_D_PET = data;
    else if (StringMatch(sk, VAR_SLOPE))
        m_Slope = data;
	else if (StringMatch(sk, VAR_SOILLAYERS))
		m_soilLayers = data;
    else
        throw ModelException(MID_GWA_RE, "Set1DData", "Parameter " + sk + " does not exist in current module.");
}
开发者ID:gaohr,项目名称:SEIMS,代码行数:30,代码来源:ReservoirMethod.cpp


示例6: Scene

GameMenuScene::GameMenuScene(Stage* stage, QGraphicsItem* parent)
	: Scene(mapSceneName(sceneGameMenu), stage, parent)
{
	setBackground("gm_background");

	LinearLayout* leftLayout = new LinearLayout(Qt::Vertical);
	Actor* gameTitle = new Actor("ge_game_title", this);
	gameTitle->setPaddings(0.1);
	leftLayout->addItem(gameTitle, 0.2);

	LinearLayout* centralLayout = new LinearLayout(Qt::Horizontal);
	leftLayout->addLayout(centralLayout, 0.8);
	Actor* robot = new Actor("ge_robot", this);
	robot->setPaddings(0.2);
	centralLayout->addItem(robot, 0.5);
	robot->alignCenter();
	centralLayout->addStretch(0.5);

	LinearLayout* rightLayout = new LinearLayout(Qt::Vertical);
	setupButtons(rightLayout);

	LinearLayout* globalLayout = new LinearLayout(Qt::Horizontal);
	globalLayout->addLayout(leftLayout, 0.7);
	globalLayout->addLayout(rightLayout, 0.3);
	setLayout(globalLayout);

	// This is the last scene loaded
	QSettings settings;
	settings.setValue( sk("Application/LastScene"), sceneName );
}
开发者ID:citic,项目名称:botNeumann,代码行数:30,代码来源:GameMenuScene.cpp


示例7: TEST

TEST(OptimizationBfgsUpdate, bfgs_update_secant) {
  typedef stan::optimization::BFGSUpdate_HInv<> QNUpdateT;
  typedef QNUpdateT::VectorT VectorT;

  const unsigned int nDim = 10;
  QNUpdateT bfgsUp;
  VectorT yk(nDim), sk(nDim), sdir(nDim);

  // Construct a set of BFGS update vectors and check that
  // the secant equation H*yk = sk is always satisfied.
  for (unsigned int i = 0; i < nDim; i++) {
    sk.setZero(nDim);
    yk.setZero(nDim);
    sk[i] = 1;
    yk[i] = 1;

    bfgsUp.update(yk,sk,i==0);

    // Because the constructed update vectors are all orthogonal the secant
    // equation should be exactlty satisfied for all nDim updates.
    for (unsigned int j = 0; j <= i; j++) {
      sk.setZero(nDim);
      yk.setZero(nDim);
      sk[i - j] = 1;
      yk[i - j] = 1;

      bfgsUp.search_direction(sdir,yk);
      
      EXPECT_NEAR((sdir + sk).norm(),0.0,1e-10);
    }
  }
}
开发者ID:actuariat,项目名称:stan,代码行数:32,代码来源:bfgs_update_test.cpp


示例8: sk

void SUR_GA::SetValue(const char *key, float value)
{
    string sk(key);

    if (StringMatch(sk, "ThreadNum"))
    {
        omp_set_num_threads((int) value);
    }
    else if (StringMatch(sk, "TimeStep"))
    {
        m_TimeStep = value * 60; //hour -> mimute
    }
    else if (StringMatch(sk, "T_snow"))
    {
        m_Tsnow = value;
    }
    else if (StringMatch(sk, "t_soil"))
    {
        m_Tsoil = value;
    }
    else if (StringMatch(sk, "T0"))
    {
        m_T0 = value;
    }
    else if (StringMatch(sk, "s_frozen"))
    {
        this->m_Sfrozen = value;
    }
    else
        throw ModelException("SUR_GA", "SetValue", "Parameter " + sk
                                                   +
                                                   " does not exist in SUR_GA method. Please contact the module developer.");

}
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:34,代码来源:SUR_GA.cpp


示例9: sk

int wxListBox::DoAppend(const wxString& item)
{
    wxSizeKeeper sk( this );
    Widget listBox = (Widget) m_mainWidget;

    bool managed = XtIsManaged(listBox);

    if (managed)
        XtUnmanageChild (listBox);
    int n;
    XtVaGetValues (listBox, XmNitemCount, &n, NULL);
    wxXmString text( item );
    //  XmListAddItem(listBox, text, n + 1);
    XmListAddItemUnselected (listBox, text(), 0);

    // It seems that if the list is cleared, we must re-ask for
    // selection policy!!
    SetSelectionPolicy();

    if (managed)
        XtManageChild (listBox);

    sk.Restore();
    m_noItems ++;

    return GetCount() - 1;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:27,代码来源:listbox.cpp


示例10: update

 // update performs the heart of an iteration:
 // It walks the border path from the active point to the end point
 // and adds the required Transitions brought by the insertion of
 // the string's i-th character.
 //
 // It returns the end point.
 ReferencePoint update(Node *s, MappedSubstring ki) {
     Node *oldr = &tree.root;
     Node *r = nullptr;
     bool is_endpoint = false;
     MappedSubstring ki1 = ki;
     auto ref_str_it = haystack.find(ki.ref_str);
     S w = ref_str_it->second;
     ReferencePoint sk(s, std::pair<int,int>(ki.ref_str, ki.l));
     ki1.r = ki.r-1;
     is_endpoint = test_and_split(s, ki1, w[ki.r], w, &r);
     while (!is_endpoint) {
         Leaf *r_prime = new Leaf();
         r->g.insert(std::pair<C,Transition>(
           w[ki.r], Transition(MappedSubstring(
           ki.ref_str, ki.r, std::numeric_limits<int>::max()), r_prime)));
         if (&tree.root != oldr) {
             oldr->suffix_link = r;
         }
         oldr = r;
         sk = canonize(sk.first->suffix_link, ki1);
         ki1.l = ki.l = sk.second.second;
         is_endpoint = test_and_split(sk.first, ki1, w[ki.r], w, &r); 
     }
     if (&tree.root != oldr) {
         oldr->suffix_link = sk.first;
     }
     return sk;
 }
开发者ID:CCJY,项目名称:coliru,代码行数:34,代码来源:main.cpp


示例11: QByteArray

void PlayerManager::saveLastPlayer()
{
	QSettings settings;
	const QByteArray& playerId = currentPlayer ? currentPlayer->getId() : QByteArray();
	settings.setValue(sk("Players/LastPlayer"), QVariant(playerId));
	if ( currentPlayer) currentPlayer->save();
}
开发者ID:citic,项目名称:botNeumann,代码行数:7,代码来源:PlayerManager.cpp


示例12: keyguard

	int Ardb::ZClear(const DBID& db, const Slice& key)
	{
		KeyLockerGuard keyguard(m_key_locker, db, key);
		ZSetMetaValue meta;
		if (0 != GetZSetMetaValue(db, key, meta))
		{
			return 0;
		}
		Slice empty;
		ZSetKeyObject sk(key, empty, meta.min_score, db);

		BatchWriteGuard guard(GetEngine());
		struct ZClearWalk: public WalkHandler
		{
				Ardb* z_db;
				int OnKeyValue(KeyObject* k, ValueObject* value, uint32 cursor)
				{
					ZSetKeyObject* sek = (ZSetKeyObject*) k;
					ZSetScoreKeyObject tmp(sek->key, sek->value, sek->db);
					z_db->DelValue(*sek);
					z_db->DelValue(tmp);
					return 0;
				}
				ZClearWalk(Ardb* db) :
						z_db(db)
				{
				}
		} walk(this);
		Walk(sk, false, &walk);
		KeyObject k(key, ZSET_META, db);
		DelValue(k);
		return 0;
	}
开发者ID:ericcapricorn,项目名称:ardb,代码行数:33,代码来源:zsets.cpp


示例13: sk

void DepressionFSDaily::SetValue(const char* key, const float value) {
    string sk(key);
    if (StringMatch(sk, VAR_DEPREIN)) m_depCo = value;
    else {
        throw ModelException(MID_DEP_LINSLEY, "SetValue", "Parameter " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:7,代码来源:DepressionFSDaily.cpp


示例14: sk

void wxStaticBox::SetLabel( const wxString& label )
{
    wxXmSizeKeeper sk( (Widget)GetMainWidget() );

    wxStaticBoxBase::SetLabel( label );

    sk.Restore();
}
开发者ID:beanhome,项目名称:dev,代码行数:8,代码来源:statbox.cpp


示例15: sk

void DepressionFSDaily::SetValue(const char *key, float data)
{
    string sk(key);
    if (StringMatch(sk, VAR_DEPREIN)) m_depCo = data;
    else if (StringMatch(sk, VAR_OMP_THREADNUM))omp_set_num_threads((int) data); 
    else
        throw ModelException(MID_DEP_LINSLEY, "SetValue", "Parameter " + sk + " does not exist.");
}
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:8,代码来源:DepressionFSDaily.cpp


示例16: CheckInputSize

void IUH_OL::Set1DData(const char* key, const int n, float* data) {
    CheckInputSize(key, n);
    string sk(key);
    if (StringMatch(sk, VAR_SUBBSN)) m_subbsnID = data;
    else if (StringMatch(sk, VAR_SURU)) m_surfRf = data;
    else {
        throw ModelException(MID_IUH_OL, "Set1DData", "Parameter " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:9,代码来源:IUH_OL.cpp


示例17: tr

void MainWindow::resetSettings()
{
	const QString& text = tr("Do you want to reset the configuration. All players' progress will be deleted");
	if ( QMessageBox::question(this, tr("Settings reset?"), text, QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes )
	{
		QSettings().setValue(sk("Application/SettingsReset"), true);
		QMessageBox::warning(this, tr("Settings reset"), tr("Please restart botNeumann++ for the changes to take effect"));
	}
}
开发者ID:citic,项目名称:botNeumann,代码行数:9,代码来源:MainWindow.cpp


示例18: sk

void IUH_OL::Set2DData(const char* key, const int nRows, const int nCols, float** data) {
    string sk(key);
    if (StringMatch(sk, VAR_OL_IUH)) {
        CheckInputSize(VAR_OL_IUH, nRows);
        m_iuhCell = data;
        m_iuhCols = nCols;
    } else {
        throw ModelException(MID_IUH_OL, "Set2DData", "Parameter " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:10,代码来源:IUH_OL.cpp


示例19: sk

void PER_PI::Get2DData(const char* key, int *nRows, int *nCols, float*** data)
{
	string sk(key);
	*nRows = m_nCells;
	*nCols = m_nSoilLayers;
	if (StringMatch(sk, VAR_PERCO))   *data = m_perc;
	else
		throw ModelException(MID_PER_PI, "Get2DData", "Output " + sk 
		+ " does not exist. Please contact the module developer.");
}
开发者ID:fannq,项目名称:SEIMS,代码行数:10,代码来源:PER_PI.cpp


示例20: InitialOutputs

void IUH_OL::GetValue(const char* key, float* value) {
    InitialOutputs();
    string sk(key);
    if (StringMatch(sk, VAR_SBOF) && m_inputSubbsnID > 0) {
        /// For MPI version to transfer data across subbasins
        *value = m_Q_SBOF[m_inputSubbsnID];
    } else {
        throw ModelException(MID_IUH_OL, "GetValue", "Result " + sk + " does not exist.");
    }
}
开发者ID:crazyzlj,项目名称:SEIMS,代码行数:10,代码来源:IUH_OL.cpp



注:本文中的sk函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sk_ASN1_OBJECT_pop_free函数代码示例发布时间:2022-05-30
下一篇:
C++ sizeudata函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap