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

C++ LoadVector函数代码示例

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

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



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

示例1: LoadCode

static void LoadCode(LoadState* S, Proto* f)
{
    int n=LoadInt(S);
    Align4(S);
    if (!luaZ_direct_mode(S->Z)) {
        f->code=luaM_newvector(S->L,n,Instruction);
        LoadVector(S,f->code,n,sizeof(Instruction));
    } else {
        f->code=(Instruction*)luaZ_get_crt_address(S->Z);
        LoadVector(S,NULL,n,sizeof(Instruction));
    }
    f->sizecode=n;
}
开发者ID:CobooGuo,项目名称:elua,代码行数:13,代码来源:lundump.c


示例2: LoadCode

static void LoadCode(LoadState* S, Proto* f)
{
 int n=LoadInt(S);
 f->code=luaM_newvector(S->L,n,Instruction);
 f->sizecode=n;
 LoadVector(S,f->code,n,sizeof(Instruction));
}
开发者ID:alucard-dracula,项目名称:yggdrasil,代码行数:7,代码来源:lundump.c


示例3: checkliteral

static void checkliteral (LoadState *S, const char *s, const char *msg) {
  char buff[sizeof(LUA_SIGNATURE) + sizeof(LUAC_DATA)]; /* larger than both */
  size_t len = strlen(s);
  LoadVector(S, buff, len);
  if (memcmp(s, buff, len) != 0)
    error(S, msg);
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:7,代码来源:lundump.c


示例4: LoadDebug

static void LoadDebug(LoadState* S, Proto* f)
{
 int i,n;
 n=LoadInt(S);
 f->lineinfo=luaM_newvector(S->L,n,uint32_t);
 f->sizelineinfo=n;
 LoadVector(S,f->lineinfo,n,sizeof(uint32_t));
 if (S->flip)
  for (i=0; i<n; i++)
   f->lineinfo[i] = Swap32(f->lineinfo[i]);
 n=LoadInt(S);
 f->locvars=luaM_newvector(S->L,n,LocVar);
 f->sizelocvars=n;
 for (i=0; i<n; i++) f->locvars[i].varname=NULL;
 for (i=0; i<n; i++)
 {
  f->locvars[i].varname=LoadString(S);
  f->locvars[i].startpc=LoadInt(S);
  f->locvars[i].endpc=LoadInt(S);
 }
 n=LoadInt(S);
 f->upvalues=luaM_newvector(S->L,n,TString*);
 f->sizeupvalues=n;
 for (i=0; i<n; i++) f->upvalues[i]=NULL;
 for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);
}
开发者ID:goofwear,项目名称:stepmania,代码行数:26,代码来源:lundump.c


示例5: LoadCode

static void LoadCode (LoadState* S, Proto* f)
{
 int size=LoadInt(S);
 f->code=luaM_newvector(S->L,size,Instruction);
 f->sizecode=size;
 LoadVector(S,f->code,size,sizeof(*f->code));
}
开发者ID:terrordrummer,项目名称:safebikesimframework,代码行数:7,代码来源:lundump.c


示例6: wfopen

bool BrfData::LoadFast(const wchar_t*filename, bool faster){
  FILE *f = wfopen(filename,"rb");
  if (!f) return false;

  version = 0;
  globVersion = version;

  while (1) {
    char str[255];
    if (!LoadString(f, str)) return false;
    if (!strcmp(str,"end")) break;
    else if (!strcmp(str,"rfver ")) LoadVersion(f,-1);
    else if (!strcmp(str,"shader")) {if (!SkipVector(f,shader)) return false;}
    else if (!strcmp(str,"texture")) {if (!LoadVector(f,texture)) return false; }
    else if (!strcmp(str,"material")) {if (!SkipVector(f,material)) return false; }
    else if (!strcmp(str,"mesh")) { if (faster) break; if (!SkipVector(f,mesh)) return false;}
    else if (!strcmp(str,"skeleton")) {if (!SkipVector(f,skeleton)) return false;}
    else if (!strcmp(str,"skeleton_anim")) { if (faster) break; if (!SkipVector(f,animation)) return false;}
    else if (!strcmp(str,"body")) { if (faster) break; if (!SkipVector(f,body)) return false;}
    else {
      //printf("ERROR! Unknown token \"%s\"\n",str);
      fflush(stdout);
      fclose(f);
      return false;
    }

  }
  fclose(f);
  return true;
}
开发者ID:cfcohen,项目名称:openbrf,代码行数:30,代码来源:brfData.cpp


示例7: main

int main(int argc, char *argv[]) {
  Vector Y;
  Matrix X;
  Matrix Cov;
  LoadVector("input.linear.mvt.y", Y);
  LoadMatrix("input.linear.mvt.x", X);
  LoadMatrix("input.linear.mvt.cov", Cov);

  {
    Matrix x;
    Vector y;
    x = X;
    y = Y;

    LinearRegressionVT linear;
    if (!linear.FitNullModel(Cov, Y)) {
      fprintf(stderr, "Fitting failed! - step 1!\n");
      return -1;
    }
    if (!linear.TestCovariate(Cov, Y, X)) {
      fprintf(stderr, "Fitting failed - step 2!\n");
      return -1;
    }

    dumpToFile(linear.GetU(), stdout);
    dumpToFile(linear.GetV(), stdout);
    dumpToFile(linear.GetT(), stdout);
    dumpToFile(linear.GetCov(), stdout);
    fprintf(stdout, "%g\t0\n", linear.GetPvalue(), 0);
  }
  return 0;
};
开发者ID:zhanxw,项目名称:rvtests,代码行数:32,代码来源:testLinearVT.cpp


示例8: LoadLines

static void LoadLines (LoadState* S, Proto* f)
{
 int size=LoadInt(S);
 f->lineinfo=luaM_newvector(S->L,size,int);
 f->sizelineinfo=size;
 LoadVector(S,f->lineinfo,size,sizeof(*f->lineinfo));
}
开发者ID:terrordrummer,项目名称:safebikesimframework,代码行数:7,代码来源:lundump.c


示例9: LoadLines

static void LoadLines(LoadState* S, Proto* f)
{
 int n=LoadInt(S);
 f->lineinfo=luaM_newvector(S->L,n,int);
 f->sizelineinfo=n;
 LoadVector(S,f->lineinfo,n,sizeof(int));
}
开发者ID:a-sf-mirror,项目名称:gusanos,代码行数:7,代码来源:lundump.c


示例10: main

int main(int argc, char* argv[]) {
  LogisticRegression lr;
  LogisticRegressionScoreTest lrst;
  LogisticRegressionPermutationTest lrpt;

  Vector y;
  Matrix x;
  Matrix cov;

  LoadVector("input.y", y);
  LoadMatrix("input.x", x);
  LoadMatrix("input.cov", cov);

  Matrix xall;
  xall = x;
  xall.StackRight(cov);  // 1 + x + cov

  if (lr.FitLogisticModel(xall, y, 100) == false) {
    fprintf(stderr, "Fitting failed!\n");
    return -1;
  }

  Vector& beta = lr.GetCovEst();
  Matrix& v = lr.GetCovB();
  Vector& pWald = lr.GetAsyPvalue();

  fprintf(stdout, "wald_beta\t");
  Print(beta);
  fputc('\n', stdout);

  fprintf(stdout, "wald_vcov\t");
  Print(v);
  fputc('\n', stdout);

  fprintf(stdout, "wald_p\t");
  Print(pWald[1]);
  fputc('\n', stdout);

  if (lrpt.FitLogisticModelCov(xall, 1, y, 2000, -1) == false) {
    fprintf(stderr, "Fitting failed!\n");
    return -1;
  }

  fprintf(stdout, "permutation_p\t");
  double permu_p = lrpt.getPvalue();
  Print(permu_p);
  fputc('\n', stdout);

  if (lrst.FitLogisticModel(xall, y, 1, 100) == false) {
    fprintf(stderr, "Fitting failed!\n");
    return -1;
  }

  fprintf(stdout, "score_p\t");
  double score_p = lrst.GetPvalue();
  Print(score_p);
  fputc('\n', stdout);

  return 0;
};
开发者ID:zhanxw,项目名称:rvtests,代码行数:60,代码来源:testLogisticRegressionCov.cpp


示例11: LoadLines

static void LoadLines (lua_State* L, Proto* tf, ZIO* Z, int swap)
{
 int n;
 tf->nlineinfo=n=LoadInt(L,Z,swap);
 tf->lineinfo=luaM_newvector(L,n,int);
 LoadVector(L,tf->lineinfo,n,sizeof(*tf->lineinfo),Z,swap);
}
开发者ID:rparet,项目名称:darkpawns,代码行数:7,代码来源:lundump.c


示例12: LoadDebug

static void LoadDebug(LoadState* S, Proto* f)
{
 int i,n;
 n=LoadInt(S);
 f->lineinfo=luaM_newvector(S->L,n,int);
 f->sizelineinfo=n;
 LoadVector(S,f->lineinfo,n,sizeof(int));
 n=LoadInt(S);
 f->locvars=luaM_newvector(S->L,n,LocVar);
 f->sizelocvars=n;
 for (i=0; i<n; i++) f->locvars[i].varname=NULL;
 for (i=0; i<n; i++)
 {
  f->locvars[i].varname=LoadString(S);
#if LUA_REFCOUNT
  luarc_addrefstring(f->locvars[i].varname);
#endif /* LUA_REFCOUNT */
  f->locvars[i].startpc=LoadInt(S);
  f->locvars[i].endpc=LoadInt(S);
 }
 n=LoadInt(S);
 f->upvalues=luaM_newvector(S->L,n,TString*);
 f->sizeupvalues=n;
 for (i=0; i<n; i++) f->upvalues[i]=NULL;
#if LUA_REFCOUNT
 for (i=0; i<n; i++) {
  f->upvalues[i]=LoadString(S);
  luarc_addrefstring(f->upvalues[i]);
 }
#else
 for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);
#endif /* LUA_REFCOUNT */
}
开发者ID:Ark-kun,项目名称:luajit-rocks,代码行数:33,代码来源:lundump.c


示例13: LoadCode

static void LoadCode (lua_State* L, Proto* tf, ZIO* Z, int swap)
{
 int size=LoadInt(L,Z,swap);
 tf->code=luaM_newvector(L,size,Instruction);
 LoadVector(L,tf->code,size,sizeof(*tf->code),Z,swap);
 if (tf->code[size-1]!=OP_END) luaO_verror(L,"bad code in `%.99s'",ZNAME(Z));
 luaF_protook(L,tf,size);
}
开发者ID:rparet,项目名称:darkpawns,代码行数:8,代码来源:lundump.c


示例14: LoadByte

static TString *LoadString (LoadState *S) {
  size_t size = LoadByte(S);
  if (size == 0xFF)
    LoadVar(S, size);
  if (size == 0)
    return NULL;
  else if (--size <= LUAI_MAXSHORTLEN) {  /* short string? */
    char buff[LUAI_MAXSHORTLEN];
    LoadVector(S, buff, size);
    return luaS_newlstr(S->L, buff, size);
  }
  else {  /* long string */
    TString *ts = luaS_createlngstrobj(S->L, size);
    LoadVector(S, getstr(ts), size);  /* load directly in final place */
    return ts;
  }
}
开发者ID:1dao,项目名称:puss,代码行数:17,代码来源:lundump.c


示例15: Clear

bool BrfData::Load(FILE*f,int verbose,int imposeVers){

  Clear();

  version = 0;
  globVersion = version;
  while (1) {
    char str[255];
    if (!LoadString(f, str)) return false;
    if (verbose>1) printf("Read \"%s\"\n",str);
    if (!strcmp(str,"end")) break;
    else if (!strcmp(str,"rfver ")) LoadVersion(f,imposeVers);
    else if (!strcmp(str,"mesh"))  {
      if (!LoadVector(f,mesh)) return false;
    //  int k; LoadInt(f,k); mesh.resize(1); mesh[0].Load(f); return true;
    }
    else if (!strcmp(str,"texture")) {if (!LoadVector(f,texture)) return false;}
    else if (!strcmp(str,"shader")) {if (!LoadVector(f,shader)) return false;}
    else if (!strcmp(str,"material")) {if (!LoadVector(f,material)) return false;}
    else if (!strcmp(str,"skeleton")) {if (!LoadVector(f,skeleton)) return false;}
    else if (!strcmp(str,"skeleton_anim")) {if (!LoadVector(f,animation)) return false;}
    else if (!strcmp(str,"body")) {if (!LoadVector(f,body)) return false; }
    else {
      //printf("ERROR! Unknown token \"%s\"\n",str);
      fflush(stdout);
      fclose(f);
      return false;
    }

  }
  fclose(f);
  return true;
}
开发者ID:cfcohen,项目名称:openbrf,代码行数:33,代码来源:brfData.cpp


示例16: LoadDebug

static void LoadDebug(LoadState* S, Proto* f)
{
    int i,n;
    n=LoadInt(S);
    Align4(S);
    if (!luaZ_direct_mode(S->Z)) {
        f->lineinfo=luaM_newvector(S->L,n,int);
        LoadVector(S,f->lineinfo,n,sizeof(int));
    } else {
开发者ID:CobooGuo,项目名称:elua,代码行数:9,代码来源:lundump.c


示例17: main

int main(int argc, char* argv[]) {
  LinearRegression lr;
  LinearRegressionScoreTest lrst;
  LinearRegressionPermutationTest lrpt;

  Vector y;
  Matrix x;

  LoadVector("input.y", y);
  LoadMatrix("input.x", x);

  if (lr.FitLinearModel(x, y) == false) {
    fprintf(stderr, "Fitting failed!\n");
    return -1;
  }

  Vector& beta = lr.GetCovEst();
  Matrix& v = lr.GetCovB();
  Vector& pWald = lr.GetAsyPvalue();

  fprintf(stdout, "wald_beta\t");
  Print(beta);
  fputc('\n', stdout);

  fprintf(stdout, "wald_vcov\t");
  Print(v);
  fputc('\n', stdout);

  fprintf(stdout, "wald_p\t");
  Print(pWald[1]);
  fputc('\n', stdout);

  if (lrpt.FitLinearModel(x, 1, y, 200, 0.05) == false) {
    fprintf(stderr, "Fitting failed!\n");
    return -1;
  }

  fprintf(stdout, "permutation_p\t");
  double permu_p = lrpt.getPvalue();
  Print(permu_p);
  fputc('\n', stdout);

  if (lrst.FitLinearModel(x, y, 1) == false) {
    fprintf(stderr, "Fitting failed!\n");
    return -1;
  }

  fprintf(stdout, "score_p\t");
  double score_p = lrst.GetPvalue();
  Print(score_p);
  fputc('\n', stdout);

  return 0;
};
开发者ID:zhanxw,项目名称:rvtests,代码行数:54,代码来源:testLinearRegression.cpp


示例18: LoadCode

static void LoadCode(LoadState* S, Proto* f)
{
 int n=LoadInt(S);
 int i=0;
 f->code=luaM_newvector(S->L,n,Instruction);
 f->sizecode=n;
 LoadVector(S,f->code,n,sizeof(Instruction));
 if (!S->flip)
  return;
 for (i=0; i<n; ++i)
  f->code[i] = Swap32(f->code[i]);
}
开发者ID:goofwear,项目名称:stepmania,代码行数:12,代码来源:lundump.c


示例19: LoadByte

static TString *LoadString (LoadState *S) {
  size_t size = LoadByte(S);
  if (size == 0xFF)
    LoadVar(S, size);
  if (size == 0)
    return NULL;
  else {
    char *s = luaZ_openspace(S->L, S->b, --size);
    LoadVector(S, s, size);
    return luaS_newlstr(S->L, s, size);
  }
}
开发者ID:bbayles,项目名称:netsa-pkg,代码行数:12,代码来源:lundump.c


示例20: LoadWString

static TString* LoadWString(LoadState* S)
{
 size_t size;
 LoadVar(S,size);
 if (size==0)
  return NULL;
 else
 {
  lua_WChar* s=(lua_WChar*)luaZ_openspace(S->L,S->b,size*2);
  LoadVector(S,s,size,2);
  return luaS_newlwstr(S->L,s,size-1);		/* remove trailing '\0' */
 }
}
开发者ID:CSE380Skulls,项目名称:ForceOfReaction,代码行数:13,代码来源:lundump.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LoadWindowFromXML函数代码示例发布时间:2022-05-30
下一篇:
C++ LoadVar函数代码示例发布时间: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