本文整理汇总了C++中ident函数的典型用法代码示例。如果您正苦于以下问题:C++ ident函数的具体用法?C++ ident怎么用?C++ ident使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ident函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_translate
/*======== struct matrix * make_translate() ==========
Inputs: int x
int y
int z
Returns: The translation matrix created using x, y and z
as the translation offsets.
====================*/
struct matrix * make_translate(double x, double y, double z) {
struct matrix * m = new_matrix(4, 4);
ident(m);
m->m[0][3] = x;
m->m[1][3] = y;
m->m[2][3] = z;
return m;
}
示例2: make_rotX
/*======== struct matrix * make_rotX() ==========
Inputs: double theta
Returns: The rotation matrix created using theta as the
angle of rotation and X as the axis of rotation.
====================*/
struct matrix * make_rotX(double theta) {
//printf("theta = %lf\n",theta);
struct matrix * m = new_matrix(4, 4);
ident(m);
m->m[1][1] = cos( theta );
m->m[1][2] = -1 * sin( theta );
m->m[2][1] = sin( theta );
m->m[2][2] = cos( theta );
return m;
}
示例3: make_rotZ
/*======== struct matrix * make_rotZ() ==========
Inputs: double theta
Returns: The rotation matrix created using theta as the
angle of rotation and Z as the axis of rotation.
====================*/
struct matrix * make_rotZ(double theta) {
struct matrix *transform = new_matrix(4, 4);
ident(transform);
transform->m[0][0] = cos(convertToRadians(theta));
transform->m[0][1] = -1 * sin(convertToRadians(theta));
transform->m[1][1] = cos(convertToRadians(theta));
transform->m[1][0] = sin(convertToRadians(theta));
return transform;
}
示例4: make_rotY
/*======== struct matrix * make_rotY() ==========
Inputs: double theta
Returns: The rotation matrix created using theta as the
angle of rotation and Y as the axis of rotation.
====================*/
struct matrix * make_rotY(double theta) {
double deg = (theta * M_PI) / 180;
struct matrix *y = new_matrix(4,4);
ident(y);
y->m[0][0] = cos(deg);
y->m[0][2] = -sin(deg);
y->m[2][0] = sin(deg);
y->m[2][2] = cos(deg);
return y;
}
示例5: make_rotZ
/*======== struct matrix * make_rotZ() ==========
Inputs: double theta
Returns: The rotation matrix created using theta as the
angle of rotation and Z as the axis of rotation.
====================*/
struct matrix * make_rotZ(double theta) {
double deg = (theta * M_PI) / 180;
struct matrix *z = new_matrix(4,4);
ident(z);
z->m[0][0] = cos(deg);
z->m[0][1] = -sin(deg);
z->m[1][0] = sin(deg);
z->m[1][1] = cos(deg);
return z;
}
示例6: make_rotX
/*======== struct matrix * make_rotX() ==========
Inputs: double theta
Returns: The rotation matrix created using theta as the
angle of rotation and X as the axis of rotation.
====================*/
struct matrix * make_rotX(double theta) {
struct matrix * m = new_matrix(4, 4);
ident(m);
m->m[1][1] = cos( theta );
m->m[1][2] = -1 * sin( theta );
m->m[2][1] = sin( theta );
m->m[2][2] = cos( theta );
return m;
}
示例7: make_scale
/*======== struct matrix * make_scale() ==========
Inputs: int x
int y
int z
Returns: The translation matrix creates using x, y and z
as the scale factors
====================*/
struct matrix * make_scale(double x, double y, double z) {
struct matrix * m = new_matrix(4, 4);
ident(m);
m->m[0][0] = x;
m->m[1][1] = y;
m->m[2][2] = z;
return m;
}
示例8: main
int main() {
char resp = 'h';
int num = 0;
printf("Se desejar arvore aleatoria digite 'a'\nCaso contrário digite outra letra\n");
scanf("%c",&resp);
NO *raiz = NULL;
if(resp == 'a'){
printf("Qual o numero de NOs desejados, além da raiz?\n");
scanf("%i",&num);
criar_abb_aleatorio(&raiz, num);
printf("Árvore ANTES da exclusao:\n\n");
ident(raiz, 0);
printf("Qual nivel deve ser excluído?\n");
scanf("%i",&num);
excluirNivel(&raiz, num);
printf("Árvore APOS da exclusao:\n\n");
ident(raiz, 0);
}
else{
printf("Use -1 para raiz sem filhos, 0 para raiz com um filho,\n1 para raiz com dois filhos, qualquer outro numero irá gerar arvore geral\nQue contém todos os casos\n");
scanf("%i",&num);
criar_abb(&raiz, num);
printf("Árvore ANTES da exclusao:\n\n");
ident(raiz, 0);
printf("Qual nivel deve ser excluído?\n");
scanf("%i",&num);
excluirNivel(&raiz, num);
printf("Árvore APOS da exclusao:\n\n");
ident(raiz, 0);
}
}
示例9: _path
RocksEngine::RocksEngine(const std::string& path, bool durable)
: _path(path), _durable(durable) {
{ // create block cache
uint64_t cacheSizeGB = 0;
ProcessInfo pi;
unsigned long long memSizeMB = pi.getMemSizeMB();
if (memSizeMB > 0) {
double cacheMB = memSizeMB / 2;
cacheSizeGB = static_cast<uint64_t>(cacheMB / 1024);
}
if (cacheSizeGB < 1) {
cacheSizeGB = 1;
}
_block_cache = rocksdb::NewLRUCache(cacheSizeGB * 1024 * 1024 * 1024LL);
}
// open DB
rocksdb::DB* db;
auto s = rocksdb::DB::Open(_options(), path, &db);
ROCKS_STATUS_OK(s);
_db.reset(db);
// open iterator
boost::scoped_ptr<rocksdb::Iterator> _iter(_db->NewIterator(rocksdb::ReadOptions()));
// find maxPrefix
_maxPrefix = 0;
_iter->SeekToLast();
if (_iter->Valid()) {
// otherwise the DB is empty, so we just keep it at 0
bool ok = extractPrefix(_iter->key(), &_maxPrefix);
// this is DB corruption here
invariant(ok);
}
// load ident to prefix map
{
boost::mutex::scoped_lock lk(_identPrefixMapMutex);
for (_iter->Seek(kMetadataPrefix);
_iter->Valid() && _iter->key().starts_with(kMetadataPrefix); _iter->Next()) {
rocksdb::Slice ident(_iter->key());
ident.remove_prefix(kMetadataPrefix.size());
// this could throw DBException, which then means DB corruption. We just let it fly
// to the caller
BSONObj identConfig(_iter->value().data());
BSONElement element = identConfig.getField("prefix");
// TODO: SERVER-16979 Correctly handle errors returned by RocksDB
// This is DB corruption
invariant(!element.eoo() || !element.isNumber());
uint32_t identPrefix = static_cast<uint32_t>(element.numberInt());
_identPrefixMap[StringData(ident.data(), ident.size())] = identPrefix;
}
}
}
示例10: make_translate
/*======== struct matrix * make_translate() ==========
Inputs: int x
int y
int z
Returns: The translation matrix created using x, y and z
as the translation offsets.
====================*/
struct matrix * make_translate(double x, double y, double z) {
struct matrix * g;
g = new_matrix(4,4);
ident(g);
g->m[0][3] = x;
g->m[1][3] = y;
g->m[2][3] = z;
return g;
}
示例11: make_rotZ
/*======== struct matrix * make_rotZ() ==========
Inputs: double theta
Returns: The rotation matrix created using theta as the
angle of rotation and Z as the axis of rotation.
====================*/
struct matrix * make_rotZ(double theta) {
struct matrix * g;
g = new_matrix(4,4);
ident(g);
g->m[0][0] = cos((M_PI * theta) / 180);
g->m[0][1] = -1 * sin((M_PI * theta) / 180 );
g->m[1][0] = sin((M_PI * theta) / 180);
g->m[1][1] = cos((M_PI * theta) / 180);
return g;
}
示例12: make_translate
/*======== struct matrix * make_translate() ==========
Inputs: int x
int y
int z
Returns: The translation matrix created using x, y and z
as the translation offsets.
====================*/
struct matrix * make_translate(double x, double y, double z) {
struct matrix *translate = new_matrix(4, 4);
ident(translate);
translate->m[0][3] = x;
translate->m[1][3] = y;
translate->m[2][3] = z;
return translate;
}
示例13: decodeTypeFunction
void decodeTypeFunction() // 33
{
uint32_t result = decodeId();
uint32_t return_type = decodeId();
std::cout << ident() << "TypeFunction " << result << " " << return_type << " (";
while(offset + 1 < length)
{
uint32_t paremeter_type = decodeId();
std::cout << " " << paremeter_type;
}
std::cout << ")" << std::endl;
}
示例14: factor
/* analisa e traduz um fator matemático */
void factor(){
if (look == '(') {
match('(');
expression();
match(')');
} else if(isalpha(look))
ident();
else
emit("MOV AX, %c", getNum());
}
示例15: ident
void CXmlOutPro::prtl_ident(PSTR fmt,...)
{
ident();
va_list argptr;
char buf[280];
va_start(argptr, fmt);
vsprintf(buf, fmt, argptr);
va_end(argptr);
prtl("%s",buf);
}