当前位置: 首页>>代码示例>>C++>>正文


C++ rn函数代码示例

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


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

示例1: _fop1d

static void
_fop1d(jit_state_t *_jit, jit_int32_t op,
       jit_int32_t r0, jit_int32_t r1, jit_float64_t *i0)
{
    jit_int32_t		reg;
    reg = jit_get_reg(jit_class_fpr);
    movi_d(rn(reg), i0);
    FPop1(r0, r1, op, rn(reg));
    jit_unget_reg(reg);
}
开发者ID:8l,项目名称:bomberjacket,代码行数:10,代码来源:jit_sparc-fpu.c

示例2: _stxi_d

static void
_stxi_d(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0, jit_int32_t r1)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	STDFI(r1, r0, i0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	stxr_d(rn(reg), r0, r1);
	jit_unget_reg(reg);
    }
}
开发者ID:8l,项目名称:bomberjacket,代码行数:13,代码来源:jit_sparc-fpu.c

示例3: _ldxi_d

static void
_ldxi_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	LDDFI(r1, i0, r0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	ldxr_d(r0, r1, rn(reg));
	jit_unget_reg(reg);
    }
}
开发者ID:8l,项目名称:bomberjacket,代码行数:13,代码来源:jit_sparc-fpu.c

示例4: _sti_f

static void
_sti_f(jit_state_t *_jit, jit_word_t i0, jit_int32_t r0)
{
    jit_int32_t		reg;
    if (s13_p(i0))
	STFI(r0, 0, i0);
    else {
	reg = jit_get_reg(jit_class_gpr);
	movi(rn(reg), i0);
	str_f(rn(reg), r0);
	jit_unget_reg(reg);
    }
}
开发者ID:8l,项目名称:bomberjacket,代码行数:13,代码来源:jit_sparc-fpu.c

示例5: _dcw

static void
_dcw(jit_state_t *_jit, jit_int32_t cc,
     jit_int32_t r0, jit_int32_t r1, jit_float64_t *i0)
{
    jit_int32_t		reg;
    reg = jit_get_reg(jit_class_fpr);
    movi_d(rn(reg), i0);
    FCMPD(r1, rn(reg));
    jit_unget_reg(reg);
    FBa(cc, 3);
    movi(r0, 1);
    movi(r0, 0);
}
开发者ID:8l,项目名称:bomberjacket,代码行数:13,代码来源:jit_sparc-fpu.c

示例6: assert

ADDS
#undef X

#undef HEADER_ARG
#undef HEADER_NONE

#undef BODY_ARG
#undef BODY_NONE

#undef ADDS

void Assembler::addi(const Reg64& rt, const Reg64& ra, Immed imm) {
  assert(imm.fits(HPHP::sz::word) && "Immediate is too big");
  EmitDForm(14, rn(rt), rn(ra), imm.w());
}
开发者ID:facebook,项目名称:hhvm,代码行数:15,代码来源:asm-ppc64.cpp

示例7: rn

Spectrum DensityRegion::tau(const Ray &r, float stepSize,
                            float u) const {
    float t0, t1;
    float length = r.d.Length();
    if (length == 0.f) return 0.f;
    Ray rn(r.o, r.d / length, r.mint * length, r.maxt * length, r.time);
    if (!IntersectP(rn, &t0, &t1)) return 0.;
    Spectrum tau(0.);
    t0 += u * stepSize;
    while (t0 < t1) {
        tau += sigma_t(rn(t0), -rn.d, r.time);
        t0 += stepSize;
    }
    return tau * stepSize;
}
开发者ID:alex310110,项目名称:pbrt,代码行数:15,代码来源:volume.cpp

示例8: _dbw

static jit_word_t
_dbw(jit_state_t *_jit, jit_int32_t cc,
     jit_word_t i0, jit_int32_t r0, jit_float64_t *i1)
{
    jit_word_t		w;
    jit_int32_t		reg;
    reg = jit_get_reg(jit_class_fpr);
    movi_d(rn(reg), i1);
    FCMPD(r0, rn(reg));
    jit_unget_reg(reg);
    w = _jit->pc.w;
    FB(cc, (i0 - w) >> 2);
    NOP();
    return (w);
}
开发者ID:8l,项目名称:bomberjacket,代码行数:15,代码来源:jit_sparc-fpu.c

示例9: main

int main()
{
    FILE *fin=fopen("friday.in","r");
    FILE *fout=fopen("friday.out","w");

    int n;
    fscanf(fin,"%d",&n);

    int md[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
    int y,m,wd[8],d=0,td;
    memset(wd,0,sizeof(wd));
    for (y=1900;y<=1900+n-1;y++)
    {
        if (rn(y)) md[2]=29; else md[2]=28;
        for (m=1;m<=12;m++)
        {
            td=(d+13)%7;
            wd[td]++;
            d=(d+md[m])%7;
        }
    }
    fprintf(fout,"%d %d %d %d %d %d %d\n",wd[6],wd[0],wd[1],wd[2],wd[3],wd[4],wd[5]);

    fclose(fin); fclose(fout);
    return 0;
}
开发者ID:cheuk-fung,项目名称:Programming-Challenges,代码行数:26,代码来源:friday.c

示例10: zrtp_sendSASRelayPacket

int32_t zrtp_sendSASRelayPacket(ZrtpContext* zrtpContext, uint8_t* sh, char* render) {
    if (zrtpContext && zrtpContext->zrtpEngine) {
        std::string rn(render);
        return zrtpContext->zrtpEngine->sendSASRelayPacket(sh, rn) ? 1 : 0;
    }
    return 0;
}
开发者ID:Jenuce,项目名称:ZRTPCPP,代码行数:7,代码来源:ZrtpCWrapper.cpp

示例11: createTree

void createTree(const char* fn , Int_t seed) {
  TFile* f = TFile::Open(fn,"update");
  f->cd();
  Double_t aD;
  Float_t aF;
  Int_t aI;
  Double_t aVD[5];
  vector<Double_t> aSD(10);
  vector<Double_t>* pSD = &aSD;
  TTree *t = new TTree("TestTree","TestTree");
  t->Branch("aDouble",&aD,"aDouble/D");
  t->Branch("aFloat",&aF,"aFloat/F");
  t->Branch("aInt",&aI,"aInt/I");
  t->Branch("aArrayD",&(aVD[0]),"aArrayD[5]/D");
  t->Branch("aStdVecD","vector<Double_t>",&pSD);

  TRandom rn(seed);
  for ( Int_t evt = 0 ; evt < 1000 ; ++ evt ) {
    aD = rn.Gaus();
    aF = rn.Uniform();
    aI = rn.Integer(100);
    for ( Int_t i = 0 ; i<10 ; ++i ){
      if ( i < 5 ) aVD[i] = rn.Gaus( i , 0.1 );
      aSD[i] = rn.Gaus( -i , 0.1 );
    }
    t->Fill();
  }
  t->Print();
  t->Write();
  f->Close();
}
开发者ID:AlexanderMorton,项目名称:eutelescope,代码行数:31,代码来源:createExampleFile.C

示例12: logicalAndExpression

MyPluralFormsNode*MyPluralFormsParser::logicalOrExpression()
{
    MyPluralFormsNode* p = logicalAndExpression();
    if (p == NULL)
        return NULL;
    MyPluralFormsNodePtr ln(p);
    if (token().type() == MyPluralFormsToken::T_LOGICAL_OR)
    {
        MyPluralFormsNodePtr un(new MyPluralFormsNode(token()));
        if (!nextToken())
        {
            return 0;
        }
        p = logicalOrExpression();
        if (p == 0)
        {
            return 0;
        }
        MyPluralFormsNodePtr rn(p);    // right
        if (rn->token().type() == MyPluralFormsToken::T_LOGICAL_OR)
        {
            // see logicalAndExpression comment
            un->setNode(0, ln.release());
            un->setNode(1, rn->releaseNode(0));
            rn->setNode(0, un.release());
            return rn.release();
        }


        un->setNode(0, ln.release());
        un->setNode(1, rn.release());
        return un.release();
    }
    return ln.release();
}
开发者ID:bingmann,项目名称:cryptote,代码行数:35,代码来源:myintl.cpp

示例13: ASSERT

// нарисовать линию до
void Drawer::LineTo(int to_x, int to_y)
{
    ASSERT( (curX == to_x) || (curY == to_y) );

    RangeNormalizer rn(*this, to_x, to_y);

    LineToImpl(to_x, to_y);
}
开发者ID:cargabsj175,项目名称:bombono-dvd,代码行数:9,代码来源:rgba.cpp

示例14: FavCompactReadableName

// caller has to free() the result
static WCHAR* FavCompactReadableName(DisplayState* fav, Favorite* fn, bool isCurrent = false) {
    ScopedMem<WCHAR> rn(FavReadableName(fn));
    if (isCurrent) {
        return str::Format(L"%s : %s", _TR("Current file"), rn.Get());
    }
    const WCHAR* fp = path::GetBaseName(fav->filePath);
    return str::Format(L"%s : %s", fp, rn.Get());
}
开发者ID:wyrover,项目名称:sumatrapdf,代码行数:9,代码来源:Favorites.cpp

示例15: Zufallszahlen

 Zufallszahlen(int _n, int range) : zahlen(new int[_n]),n(_n){
     std::random_device rn;
     std::mt19937 engine(rn());
     std::uniform_int_distribution<int> dice(1, range);
     for(int i=0; i < _n; ++i) {
       zahlen[i] = dice(engine);
     }
 }
开发者ID:rehberry,项目名称:C-C-Programmierung-1,代码行数:8,代码来源:move01.cpp


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