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


C++ ident函数代码示例

本文整理汇总了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;
}
开发者ID:stuydw,项目名称:polygons,代码行数:18,代码来源:matrix.c

示例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;
}
开发者ID:stuydw,项目名称:mdl,代码行数:17,代码来源:matrix.c

示例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;
}
开发者ID:roddajohn,项目名称:verbose-chainsaw,代码行数:17,代码来源:matrix.c

示例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;
}
开发者ID:stuydw,项目名称:transformations,代码行数:17,代码来源:matrix.c

示例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;
}
开发者ID:stuydw,项目名称:transformations,代码行数:17,代码来源:matrix.c

示例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;
}
开发者ID:stuydw,项目名称:polygons,代码行数:17,代码来源:matrix.c

示例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;
}
开发者ID:stuydw,项目名称:polygons,代码行数:18,代码来源:matrix.c

示例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);
		
	}
}
开发者ID:CrociDB,项目名称:EP-AED,代码行数:41,代码来源:main.cpp

示例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;
            }
        }
    }
开发者ID:rueckstiess,项目名称:mongo,代码行数:53,代码来源:rocks_engine.cpp

示例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;

}
开发者ID:stuydw,项目名称:transformations,代码行数:19,代码来源:matrix.c

示例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;
}
开发者ID:stuydw,项目名称:transformations,代码行数:18,代码来源:matrix.c

示例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; 

}
开发者ID:stuydw,项目名称:transformations,代码行数:19,代码来源:matrix.c

示例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;
 }
开发者ID:lemoniac,项目名称:spirvviewer,代码行数:12,代码来源:spirvparser.cpp

示例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());
}
开发者ID:daniloluca,项目名称:compiler-c,代码行数:13,代码来源:interpreter.c

示例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);
}
开发者ID:JFreaker,项目名称:exetoc,代码行数:13,代码来源:CXmlPrt.cpp


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