本文整理汇总了C++中rn函数的典型用法代码示例。如果您正苦于以下问题:C++ rn函数的具体用法?C++ rn怎么用?C++ rn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rn函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: assert
R_Ring_Vector FHE_Cipher_Text::Scale(R_Ring_Vector &x, ZZ q, ZZ p, ZZ r) {
assert(p < q);
R_Ring_Vector rn(p, x.Get_d(), x.Get_Dimension());
for (int i = 0; i < x.Get_Dimension(); i++) {
rn[i] = x[i].Scale(q, p, r);
}
return rn;
}
开发者ID:mohakamo,项目名称:fully-homomorphic-encryption,代码行数:8,代码来源:SI_HE.cpp
示例17: appendInstructionName
const char* ARMv7DOpcodeCompareRegisterT2::format()
{
appendInstructionName("compare");
appendRegisterName(rn());
appendSeparator();
appendRegisterName(rm());
return m_formatBuffer;
}
开发者ID:CannedFish,项目名称:webkit,代码行数:9,代码来源:ARMv7DOpcode.cpp
示例18: QVERIFY
// test only for posix
void tst_QSocketNotifier::posixSockets()
{
QTcpServer server;
QVERIFY(server.listen(QHostAddress::LocalHost, 0));
int posixSocket = qt_safe_socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in addr;
addr.sin_addr.s_addr = htonl(0x7f000001);
addr.sin_family = AF_INET;
addr.sin_port = htons(server.serverPort());
qt_safe_connect(posixSocket, (const struct sockaddr*)&addr, sizeof(sockaddr_in));
QVERIFY(server.waitForNewConnection(5000));
QScopedPointer<QTcpSocket> passive(server.nextPendingConnection());
::fcntl(posixSocket, F_SETFL, ::fcntl(posixSocket, F_GETFL) | O_NONBLOCK);
{
QSocketNotifier rn(posixSocket, QSocketNotifier::Read);
connect(&rn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop()));
QSignalSpy readSpy(&rn, SIGNAL(activated(int)));
QVERIFY(readSpy.isValid());
// No write notifier, some systems trigger write notification on socket creation, but not all
QSocketNotifier en(posixSocket, QSocketNotifier::Exception);
connect(&en, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop()));
QSignalSpy errorSpy(&en, SIGNAL(activated(int)));
QVERIFY(errorSpy.isValid());
passive->write("hello",6);
passive->waitForBytesWritten(5000);
QTestEventLoop::instance().enterLoop(3);
QCOMPARE(readSpy.count(), 1);
QCOMPARE(errorSpy.count(), 0);
char buffer[100];
int r = qt_safe_read(posixSocket, buffer, 100);
QCOMPARE(r, 6);
QCOMPARE(buffer, "hello");
QSocketNotifier wn(posixSocket, QSocketNotifier::Write);
connect(&wn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop()));
QSignalSpy writeSpy(&wn, SIGNAL(activated(int)));
QVERIFY(writeSpy.isValid());
qt_safe_write(posixSocket, "goodbye", 8);
QTestEventLoop::instance().enterLoop(3);
QCOMPARE(readSpy.count(), 1);
QCOMPARE(writeSpy.count(), 1);
QCOMPARE(errorSpy.count(), 0);
// Write notifier may have fired before the read notifier inside
// QTcpSocket, give QTcpSocket a chance to see the incoming data
passive->waitForReadyRead(100);
QCOMPARE(passive->readAll(), QByteArray("goodbye",8));
}
qt_safe_close(posixSocket);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:58,代码来源:tst_qsocketnotifier.cpp
示例19: rn
void createNetwork::rewireWeights ( double prop ,boost::function<double () > r,nodeKind theNodeKind )
{
network::edgeList toChange;
network::edgeIterator it;
// unsigned int i;
network::edgesBetween ( toChange, theNodeKind, theNodeKind );
nodeList vl;
network::verticesMatching(vl, theNodeKind);
getRandomNode rn (vl);
for ( it = toChange.begin(); it != toChange.end(); it++ )
{
if ( network::noise.getUniform() > prop )
continue;
nodeDescriptor newSource;
nodeDescriptor newTarget;
nodeDescriptor oldSource = it->first ;
nodeDescriptor oldTarget = getTarget(*it);
do
{
newSource = rn();
newTarget = rn();
}
while ( newSource == newTarget || nodeBlueprint::theNodes[newSource]->isLinked ( newTarget ) ); // keine Selbst- und Doppelverbindungen
// if ((network::theNodes[newSource] == (*it)->source) && (network::theNodes[newTarget] == (*it)->target))
// continue;
((edgeVirtual*) getEdge(*it))->setWeight( r() );
network::link ( newSource,newTarget, (edgeBlueprint *) node::theNodes[it->first]-> getEdge(it->second));
network::unlink( oldSource, oldTarget);
}
network::clean();
}
开发者ID:Conedy,项目名称:Conedy,代码行数:43,代码来源:createNetwork.cpp
示例20: main
int main( int argc, char *argv[] ) {
int sq_side = 1000, radius = sq_side/2;
int n = 1000, success = 0;
double pi = 0;
srand(time(NULL));
printf("Sequential MonteCarlo for Pi\n");
for (int cnt = 0; cnt < n; cnt ++)
{
double x = rn();
double y = rn();
if ((x*x + y*y) <= 1.0)
{
success += 1;
}
}
pi = ((double)success)/((double)n) * 4;
printf("PI = %1.5f\n", pi);
printf("PI/4 = %1.5f\n", ((double)success/n));
}
开发者ID:renato2099,项目名称:PProg,代码行数:19,代码来源:hw_pi_seq.c
注:本文中的rn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论