您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ symbol函数代码示例

51自学网 2021-06-03 08:36:26
  C++
这篇教程C++ symbol函数代码示例写得很实用,希望能帮到您。

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

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

示例1: _tfopen_s

// Create netlist and output as a SPICE filevoid CNetList::WriteSpiceFile( CTinyCadMultiDoc *pDesign, const TCHAR *filename ){	// Open the filename for the spice file	FILE *theFile;	errno_t err;	err = _tfopen_s(&theFile, filename,_T("w"));	if ((theFile == NULL) || (err != 0))	{		Message(IDS_CANNOTOPEN);		return;	}	// Output the standard header comment - expected on line 1 by some Spice engines	_ftprintf(theFile,_T("* Schematics Netlist */n"));	createErrorFile( filename );	_ftprintf(m_err_file,_T("Results of Spice file generation for %s/n/n"),		pDesign->GetPathName() );	// Set the Busy icon	SetCursor( AfxGetApp()->LoadStandardCursor( IDC_WAIT ) );	// Create the net list	m_prefix_import = TRUE;	m_prefix_references = TRUE;	MakeNet( pDesign );		// Now we have the net list we must convert it into a file suitable for	// spice...	//	// The netlist represents a single vector per net, however, spice requires	// a vector per symbol.  We have to rotate the array, so that we have one	// entry in our vector for each of the symbols in our drawing....	//		typedef std::map<CString,CNetListSymbol>	symbolCollection;	symbolCollection symbols;	labelCollection labels;	netCollection::iterator nit = m_nets.begin();	while (nit != m_nets.end()) 	{		nodeVector::iterator nv_it = (*nit).second.begin();		while (nv_it != (*nit).second.end()) 		{			CNetListNode& theNode = *nv_it;			++ nv_it;			// Is this node a symbol?			if (!theNode.m_reference.IsEmpty() && theNode.m_pMethod->GetType() == xMethodEx3 )			{				// Yes, so update the pin allocations in the symbol map...				CNetListSymbol &symbol = symbols[ theNode.m_reference ];				symbol.m_pins[ theNode.m_pin ] = theNode.m_NetList;				symbol.m_pMethod = theNode.m_pMethod;			}			// Is this node a label?			if (!theNode.getLabel().IsEmpty())			{				// Yes, so update the label collection				labels[ theNode.m_NetList ] = theNode.getLabel();			}		}		++ nit;	}	//	// We scan the symbols array and extract any file imports	// That we need from the fields of the symbols...	//	symbolCollection::iterator sit = symbols.begin();	typedef std::set<CString> strings;	typedef std::vector<strings> string_collection;	string_collection prolog_lines;	string_collection epilog_lines;	prolog_lines.resize( 10 );	epilog_lines.resize( 10 );	// Do this for all of the files in the imports list...	fileCollection::iterator fi = m_imports.begin();	for (;fi != m_imports.end(); ++ fi)	{		CTinyCadMultiDoc *dsn = pDesign;		if ((*fi)->m_file_name_index != 0)		{			dsn = (*fi)->m_pDesign;		}//.........这里部分代码省略.........
开发者ID:saranyan,项目名称:tinycad_graph_matching,代码行数:101,


示例2: generateSymbols

SymbolSlab generateSymbols(std::vector<std::string> QualifiedNames) {  SymbolSlab::Builder Slab;  for (llvm::StringRef QName : QualifiedNames)    Slab.insert(symbol(QName));  return std::move(Slab).build();}
开发者ID:ingowald,项目名称:llvm-project,代码行数:6,


示例3: QVariant

/*!** this code should be read as table of generic cases (where row/column doesn't matter)** which is important for the graphicsView. for the treeView there is a part of code where** row/column matters, see the very long switch statement.*/QVariant Model::data( const QModelIndex &index, int role ) const {//   qDebug() << __FUNCTION__;  if ( !index.isValid() )    return QVariant();  AbstractTreeItem* n = static_cast<AbstractTreeItem*>( index.internalPointer() );  if ( role == customRole::CustomLabelRole )    return n->getProperty( "CustomLabelRole" );  // to understand customRole::TypeRole see the comment (Model.h - TreeItemType enum comment )  if ( role == customRole::TypeRole ) {    if ( n->getObjectType() == AUTOMATE_ROOT )      return ViewTreeItemType::AUTOMATE_ROOT;    if ( n->getObjectType() == NODE_CONNECTION )      return ViewTreeItemType::NODE_CONNECTION;    if ( n->getObjectType() == NODE )      return ViewTreeItemType::NODE;    return ViewTreeItemType::UNKNOWN;  }  if ( role == customRole::FinalRole )    if ( n->getObjectType() == NODE )      return n->getProperty( "final" );  if ( role == customRole::PosRole )    if ( n->getObjectType() == NODE )      return n->getProperty( "pos" );  if ( role == customRole::StartRole )    if ( n->getObjectType() == NODE )      return n->getProperty( "start" );  if ( role == customRole::SymbolIndexRole )    if ( n->getObjectType() == NODE_CONNECTION ) {      node_connection* nc = static_cast<node_connection*>( index.internalPointer() );//       qDebug() << __FUNCTION__ << symbol( nc->symbol_index ) << nc->symbol_index;      return symbol( nc->symbol_index() ) ;    }  if ( role == customRole::IdRole )    if ( n->getObjectType() == NODE || n->getObjectType() == NODE_CONNECTION )      return n->getId();  switch ( index.column() ) {  case 0:    switch ( role ) {    case Qt::DecorationRole:      if ( n->getObjectType() == NODE )        return QIcon( ":/icons/node.png" );      if ( n->getObjectType() == NODE_CONNECTION )        return QIcon( ":/icons/connect.png" );    }    break;  case 1:    switch ( role ) {    case Qt::ToolTipRole:      break;    case Qt::WhatsThisRole:      break;    case Qt::TextAlignmentRole://           if (index.column() == 1)//             return Qt::AlignHCenter;//           if (index.column() == 2)//             return Qt::AlignHCenter;      break;    case customRole::SortRole:    case Qt::DecorationRole:      if ( n->getObjectType() == NODE ) {        if ( n->getProperty( "start" ).toBool() ) {          if ( role == customRole::SortRole )            return 1;          return QIcon( ":/icons/startNode.png" );        } else {          if ( role == customRole::SortRole )            return 0;        }      }      break;//     case Qt::BackgroundRole://       break;    }    break;  case 2:    switch ( role ) {    case customRole::SortRole:    case Qt::DecorationRole:      if ( n->getObjectType() == NODE ) {        if ( n->getProperty( "final" ).toBool() ) {          if ( role == customRole::SortRole )            return 1;          return QIcon( ":/icons/finalNode.png" );        } else {          if ( role == customRole::SortRole )            return 0;        }      }      break;    }    break;  case 3:    switch ( role ) {    case customRole::SortRole://.........这里部分代码省略.........
开发者ID:Alexpux,项目名称:automate,代码行数:101,


示例4: dimension

 symbol dimension (const Scope&) const  {        daisy_assert (state != uninitialized);   return symbol (source->dimension ()); }
开发者ID:perabrahamsen,项目名称:daisy-model,代码行数:5,


示例5: sorts

void bv_elim::elim(quantifier* q, quantifier_ref& r) {    svector<symbol>  names, _names;    sort_ref_buffer  sorts(m_manager), _sorts(m_manager);    expr_ref_buffer  pats(m_manager);    expr_ref_buffer  no_pats(m_manager);    expr_ref_buffer  subst_map(m_manager), _subst_map(m_manager);    var_subst        subst(m_manager);    bv_util          bv(m_manager);    expr_ref         new_body(m_manager);    expr*            old_body = q->get_expr();    unsigned num_decls = q->get_num_decls();    family_id bfid = m_manager.get_family_id("bv");    //    // Traverse sequence of bound variables to eliminate    // bit-vecctor variables and replace them by     // Booleans.    //     unsigned var_idx = 0;    for (unsigned i = num_decls; i > 0; ) {        --i;        sort*  s  = q->get_decl_sort(i);        symbol nm = q->get_decl_name(i);        if (bv.is_bv_sort(s)) {            // convert n-bit bit-vector variable into sequence of n-Booleans.            unsigned num_bits = bv.get_bv_size(s);            expr_ref_buffer args(m_manager);            expr_ref bv(m_manager);            for (unsigned j = 0; j < num_bits; ++j) {                std::ostringstream new_name;                new_name << nm.str();                new_name << "_";                new_name << j;                var* v = m_manager.mk_var(var_idx++, m_manager.mk_bool_sort());                                args.push_back(v);                _sorts.push_back(m_manager.mk_bool_sort());                _names.push_back(symbol(new_name.str().c_str()));            }            bv = m_manager.mk_app(bfid, OP_MKBV, 0, 0, args.size(), args.c_ptr());            _subst_map.push_back(bv.get());        }        else {            _subst_map.push_back(m_manager.mk_var(var_idx++, s));            _sorts.push_back(s);            _names.push_back(nm);        }    }    //     // reverse the vectors.    //     SASSERT(_names.size() == _sorts.size());    for (unsigned i = _names.size(); i > 0; ) {        --i;        names.push_back(_names[i]);        sorts.push_back(_sorts[i]);    }    for (unsigned i = _subst_map.size(); i > 0; ) {        --i;        subst_map.push_back(_subst_map[i]);    }    expr* const* sub  = subst_map.c_ptr();    unsigned sub_size = subst_map.size();    subst(old_body, sub_size, sub, new_body);    for (unsigned j = 0; j < q->get_num_patterns(); j++) {        expr_ref pat(m_manager);                subst(q->get_pattern(j), sub_size, sub, pat);        pats.push_back(pat);    }    for (unsigned j = 0; j < q->get_num_no_patterns(); j++) {        expr_ref nopat(m_manager);        subst(q->get_no_pattern(j), sub_size, sub, nopat);        no_pats.push_back(nopat);    }    r = m_manager.mk_quantifier(true,                                 names.size(),                                sorts.c_ptr(),                                names.c_ptr(),                                new_body.get(),                                q->get_weight(),                                q->get_qid(),                                q->get_skid(),                                pats.size(), pats.c_ptr(),                                no_pats.size(), no_pats.c_ptr());}
开发者ID:CharudattaSChitale,项目名称:sygus-comp14,代码行数:90,


示例6: yybesselj

voidyybesselj(void){	double d;	int n;	N = pop();	X = pop();	push(N);	n = pop_integer();	// numerical result	if (isdouble(X) && n != (int) 0x80000000) {		//d = jn(n, X->u.d);		push_double(d);		return;	}	// bessej(0,0) = 1	if (iszero(X) && iszero(N)) {		push_integer(1);		return;	}	// besselj(0,n) = 0	if (iszero(X) && n != (int) 0x80000000) {		push_integer(0);		return;	}	// half arguments	if (N->k == NUM && MEQUAL(N->u.q.b, 2)) {		// n = 1/2		if (MEQUAL(N->u.q.a, 1)) {			push_integer(2);			push_symbol(PI);			divide();			push(X);			divide();			push_rational(1, 2);			power();			push(X);			sine();			multiply();			return;		}		// n = -1/2		if (MEQUAL(N->u.q.a, -1)) {			push_integer(2);			push_symbol(PI);			divide();			push(X);			divide();			push_rational(1, 2);			power();			push(X);			cosine();			multiply();			return;		}		// besselj(x,n) = (2/x) (n-sgn(n)) besselj(x,n-sgn(n)) - besselj(x,n-2*sgn(n))		push_integer(MSIGN(N->u.q.a));		SGN = pop();		push_integer(2);		push(X);		divide();		push(N);		push(SGN);		subtract();		multiply();		push(X);		push(N);		push(SGN);		subtract();		besselj();		multiply();		push(X);		push(N);		push_integer(2);		push(SGN);		multiply();		subtract();		besselj();		subtract();		return;	}//.........这里部分代码省略.........
开发者ID:AnderainLovelace,项目名称:Taumath,代码行数:101,


示例7: D_symbol

void D_symbol(const SYMBOL *Symb, double x0, double y0,	      const RGBA_Color *line_color,	      const RGBA_Color *fill_color){    symbol(Symb, x0, y0, fill_color, line_color, line_color);}
开发者ID:felipebetancur,项目名称:grass-ci,代码行数:6,


示例8: main

int main(int argc, char *argv[]){    struct thread *thread;    enum pause_reason reason;    struct variable *var;#if ! NO_ARGV_0    char *argv0 = "mindy";#endif    exec_file_name = argv[0];    init_color(false);    init();    thread = thread_make(symbol("main"));    *thread->sp++ = make_raw_function("startup", obj_Nil,                                      true, obj_False, false,                                      obj_Nil, obj_ObjectClass,                                      startup);    while (*++argv != NULL) {        if (strcmp(*argv, "-f") == 0) {            if (*++argv == NULL)                missing_arg("-f");            load(*argv);#if ! NO_SHARP_BANG        } else if (strcmp(*argv, "-x") == 0) {            if (*++argv == NULL)                missing_arg("-f");#if ! NO_ARGV_0            if (strcmp(*argv, "-") != 0)                argv0 = *argv;#endif            load(*argv);            argv += 1;            break;#endif#if ! NO_ARGV_0        } else if (strcmp(*argv, "-0") == 0) {            if (*++argv == NULL)                missing_arg("-0");            argv0 = *argv;#endif        } else {            break;        }    }#if ! NO_ARGV_0        *thread->sp++ = make_byte_string(argv0);    /* pass command name */#endif    while (*argv != NULL)        *thread->sp++ = make_byte_string(*argv++);    finalize_modules();    while (1) {        thread_restart(thread);        reason = do_stuff();        if (reason != pause_NothingToRun)            invoke_debugger(reason);        var = find_variable(module_BuiltinStuff, symbol("exit"),                            false, false);        if (var == NULL)            lose("main undefined?");        thread = thread_make(symbol("exit"));        *thread->sp++ = var->value;    }    return 0;}
开发者ID:sparkhom,项目名称:mindy,代码行数:74,


示例9: EVAL

///////////////////////////////// FIXME - make it loop over //   - eval_ast//   - apply// astEVAL (ast tree, environment::ptr a_env){  for (;;)  {    if (!tree)      return tree;    if (tree->type () != node_type_enum::LIST)      return eval_ast (tree, a_env);    // not as_or_throw - we know the type    auto root_list = tree->as<ast_node_list> ();    if (root_list->empty ())      return tree;    //    auto fn_handle_def = [root_list, &a_env]()    {      if (root_list->size () != 3)        raise<mal_exception_eval_invalid_arg> (root_list->to_string ());      const auto& key = (*root_list)[1]->as_or_throw<ast_node_symbol, mal_exception_eval_invalid_arg> ()->symbol ();      ast_node::ptr value = EVAL ((*root_list)[2], a_env);      a_env->set (key, value);      return value;    };    // tco    auto fn_handle_let_tco = [root_list, &a_env]() -> tco    {      if (root_list->size () != 3)        raise<mal_exception_eval_invalid_arg> (root_list->to_string ());      const ast_node_container_base* let_bindings = nullptr;      const auto root_list_arg_1 = (*root_list)[1];      switch (root_list_arg_1->type ())      {      case node_type_enum::LIST:      case node_type_enum::VECTOR:        let_bindings = root_list_arg_1->as<ast_node_container_base> ();        break;      default:        raise<mal_exception_eval_invalid_arg> (root_list_arg_1->to_string ());      };      //      auto let_env = environment::make (a_env);      if (let_bindings->size () % 2 != 0)        raise<mal_exception_eval_invalid_arg> (let_bindings->to_string ());            for (size_t i = 0, e = let_bindings->size(); i < e; i += 2)      {        const auto& key = (*let_bindings)[i]->as_or_throw<ast_node_symbol, mal_exception_eval_invalid_arg> ()->symbol ();        ast_node::ptr value = EVAL ((*let_bindings)[i + 1], let_env);        let_env->set (key, value);      }      return {(*root_list)[2], let_env};    };    // tco    auto fn_handle_apply_tco= [&tree, &a_env]() -> tco    {      ast_node::ptr new_node = eval_ast (tree, a_env);      auto callable_list = new_node->as_or_throw<ast_node_list, mal_exception_eval_not_list> ();      const size_t list_size = callable_list->size ();      if (list_size == 0)        raise<mal_exception_eval_not_callable> (callable_list->to_string ());      auto && callable_node = (*callable_list)[0]->as_or_throw<ast_node_callable, mal_exception_eval_not_callable> ();      return callable_node->call_tco (call_arguments (callable_list, 1, list_size - 1));    };    // tco    auto fn_handle_do_tco = [root_list, &a_env]() -> tco    {      const size_t list_size = root_list->size ();      if (list_size < 2)        raise<mal_exception_eval_invalid_arg> (root_list->to_string ());      for (size_t i = 1, e = list_size - 1; i < e; ++i)      {        /*retVal = */EVAL ((*root_list)[i], a_env);      }      return {(*root_list)[list_size - 1], a_env};    };    // tco//.........这里部分代码省略.........
开发者ID:alantsev,项目名称:mal,代码行数:101,


示例10: while

void smt2_parsert::operator()(){  char ch;  unsigned open_parentheses=0;  while(in.get(ch))  {    switch(ch)    {    case ' ':    case '/n':    case '/r':    case '/t':      // skip any whitespace      break;        case ';': // comment      // skip until newline      while(in.get(ch) && ch!='/n')        ; // ignore      break;        case '(':      // produce sub-expression      open_parentheses++;      open_expression();      break;          case ')':      // done with sub-expression      if(open_parentheses==0) // unexpected ')'. This is an error;        return;            open_parentheses--;      close_expression();            if(open_parentheses==0)        return; // done              break;          case '|': // quoted symbol      get_quoted_symbol();      symbol();      if(open_parentheses==0) return; // done      break;          case '"': // string literal      get_string_literal();      symbol();      if(open_parentheses==0) return; // done      break;    default: // likely a simple symbol      get_simple_symbol(ch);      symbol();      if(open_parentheses==0) return; // done    }  }  if(open_parentheses==0)  {      // Hmpf, eof before we got anything. Blank file!  }  else  {    // Eof before end of expression. Error!  }}
开发者ID:rbavishi,项目名称:iCBMC,代码行数:70,


示例11: remElement

 --------- 	2002-02-08 : First version 	2002-02-20 : New description of the API, non recursive lmap and reverse 	2002-03-29 : Added function remElement(e,set), corrected comment error	***********************************************************************************************************************************************************/#include <stdlib.h>#include "list.hh"#include "compatibility.hh"#include <map>#include <cstdlib>// predefined symbols CONS and NILSym CONS = symbol("cons");Sym NIL  = symbol("nil");// predefined nil treeTree nil = tree(NIL);//------------------------------------------------------------------------------// Printing of trees with special case for lists//------------------------------------------------------------------------------static bool printlist (Tree l, FILE* out){	if (isList(l)) {				char sep = '(';
开发者ID:gauravchawla03,项目名称:Stanford,代码行数:31,


示例12: boxIdent

Tree boxIdent(const char* name)		{ return tree(BOXIDENT, tree(symbol(name)) ); }
开发者ID:EBone,项目名称:faust-1,代码行数:1,


示例13: symbol

 *  Boxes are created using five main connection operations : sequential (:), *  parallel (,), split (<:), merge (:>), and recursive (~). */#include <stdio.h>#include <string.h>#include "boxes.hh"#include "ppbox.hh"#include "prim2.hh"#include "xtended.hh"/*****************************************************************************							    	Identifiers*****************************************************************************/Sym BOXIDENT = symbol ("BoxIdent");Tree boxIdent(const char* name)		{ return tree(BOXIDENT, tree(symbol(name)) ); }bool isBoxIdent(Tree t)				{ return t->node() == Node(BOXIDENT); }bool isBoxIdent(Tree t0, const char** str){	Tree t1; Sym s;	if ( isTree(t0, BOXIDENT, t1) && isSym(t1->node(), &s) ) {		*str = name(s);		return true;	} else {		return false;	}}
开发者ID:EBone,项目名称:faust-1,代码行数:29,


示例14: sort_info

sort * fpa_decl_plugin::mk_rm_sort() {    return m_manager->mk_sort(symbol("RoundingMode"), sort_info(m_family_id, ROUNDING_MODE_SORT));}
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:3,


示例15: shadername

std::stringShaderInstance::print (const ShaderGroup &group){    std::stringstream out;    out << "Shader " << shadername() << "/n";    out << "  symbols:/n";    for (size_t i = 0;  i < m_instsymbols.size();  ++i) {        const Symbol &s (*symbol(i));        s.print (out, 256);    }#if 0    out << "  int consts:/n    ";    for (size_t i = 0;  i < m_iconsts.size();  ++i)        out << m_iconsts[i] << ' ';    out << "/n";    out << "  float consts:/n    ";    for (size_t i = 0;  i < m_fconsts.size();  ++i)        out << m_fconsts[i] << ' ';    out << "/n";    out << "  string consts:/n    ";    for (size_t i = 0;  i < m_sconsts.size();  ++i)        out << "/"" << Strutil::escape_chars(m_sconsts[i]) << "/" ";    out << "/n";#endif    out << "  code:/n";    for (size_t i = 0;  i < m_instops.size();  ++i) {        const Opcode &op (m_instops[i]);        if (i == (size_t)maincodebegin())            out << "(main)/n";        out << "    " << i << ": " << op.opname();        bool allconst = true;        for (int a = 0;  a < op.nargs();  ++a) {            const Symbol *s (argsymbol(op.firstarg()+a));            out << " " << s->name();            if (s->symtype() == SymTypeConst) {                out << " (";                s->print_vals(out,16);                out << ")";            }            if (op.argread(a))                allconst &= s->is_constant();        }        for (size_t j = 0;  j < Opcode::max_jumps;  ++j)            if (op.jump(j) >= 0)                out << " " << op.jump(j);//        out << "    rw " << Strutil::format("%x",op.argread_bits())//            << ' ' << op.argwrite_bits();        if (op.argtakesderivs_all())            out << " %derivs(" << op.argtakesderivs_all() << ") ";        if (allconst)            out << "  CONST";        std::string filename = op.sourcefile().string();        size_t slash = filename.find_last_of ("/");        if (slash != std::string::npos)            filename.erase (0, slash+1);        if (filename.length())            out << "  (" << filename << ":" << op.sourceline() << ")";        out << "/n";    }    if (nconnections()) {        out << "  connections upstream:/n";        for (int i = 0, e = nconnections(); i < e; ++i) {            const Connection &c (connection(i));            out << "    " << c.dst.type.c_str() << ' '                << symbol(c.dst.param)->name();            if (c.dst.arrayindex >= 0)                out << '[' << c.dst.arrayindex << ']';            out << " upconnected from layer " << c.srclayer << ' ';            const ShaderInstance *up = group[c.srclayer];            out << "(" << up->layername() << ") ";            out << "    " << c.src.type.c_str() << ' '                << up->symbol(c.src.param)->name();            if (c.src.arrayindex >= 0)                out << '[' << c.src.arrayindex << ']';            out << "/n";        }    }    return out.str ();}
开发者ID:rlmh,项目名称:OpenShadingLanguage,代码行数:79,


示例16: test_finite_product_relation

    void test_finite_product_relation(smt_params fparams, params_ref& params) {        ast_manager m;        register_engine re;        context ctx(m, re, fparams);        ctx.updt_params(params);        dl_decl_util dl_util(m);        relation_manager & rmgr = ctx.get_rel_context()->get_rmanager();        relation_plugin & rel_plugin = *rmgr.get_relation_plugin(params.get_sym("default_relation", symbol("sparse")));        ENSURE(&rel_plugin);        finite_product_relation_plugin plg(rel_plugin, rmgr);        sort_ref byte_srt_ref(dl_util.mk_sort(symbol("BYTE"), 256), m);        relation_sort byte_srt = byte_srt_ref;        relation_signature sig2;        sig2.push_back(byte_srt);        sig2.push_back(byte_srt);        relation_signature sig3(sig2);        sig3.push_back(byte_srt);        relation_signature sig4(sig3);        sig4.push_back(byte_srt);        app_ref seven_ref(dl_util.mk_numeral(7, byte_srt), m);        app_ref nine_ref(dl_util.mk_numeral(9, byte_srt), m);        relation_element seven = seven_ref;        relation_element nine = nine_ref;        relation_fact f7(m);        f7.push_back(seven);        relation_fact f9(m);        f9.push_back(nine);        relation_fact f77(f7);        f77.push_back(seven);        relation_fact f79(f7);        f79.push_back(nine);        relation_fact f97(f9);        f97.push_back(seven);        relation_fact f99(f9);        f99.push_back(nine);        relation_fact f779(f77);        f779.push_back(nine);        relation_fact f799(f79);        f799.push_back(nine);        relation_fact f977(f97);        f977.push_back(seven);        relation_fact f7797(f779);        f7797.push_back(seven);        relation_fact f7997(f799);        f7997.push_back(seven);        bool table_cols2[] = { true, false };        bool table_cols3[] = { true, false, false };        bool table_cols4[] = { true, true, false, false };        scoped_rel<relation_base> r1 = plg.mk_empty(sig2, table_cols2);        scoped_rel<relation_base> r2 = r1->clone();        scoped_rel<relation_base> r3 = r2->clone();        ENSURE(!r1->contains_fact(f77));        r1->add_fact(f77);        ENSURE(r1->contains_fact(f77));        r2->add_fact(f79);        r3->add_fact(f99);        r2->display( std::cout << "r2 0/n");        scoped_rel<relation_base> r4 = r2->clone();        r2->display( std::cout << "r2 1/n");        r4->display( std::cout << "r4 0/n");        ENSURE(!r4->contains_fact(f77));        ENSURE(r4->contains_fact(f79));        r4->add_fact(f77);        r4->display( std::cout << "r4 1/n");        ENSURE(r4->contains_fact(f77));        ENSURE(r4->contains_fact(f79));        r4->add_fact(f99);        r4->display( std::cout << "r4 2/n");        ENSURE(r4->contains_fact(f99));        std::cout << "------ testing union ------/n";        r2->display( std::cout << "r2/n");        scoped_ptr<relation_union_fn> union_op = rmgr.mk_union_fn(*r1, *r2, r3.get());        ENSURE(union_op);        (*union_op)(*r1, *r2, r3.get());        r1->display( std::cout << "r1/n");        r2->display( std::cout << "r2/n");        r3->display( std::cout << "r3/n");        ENSURE(r1->contains_fact(f77));        ENSURE(r1->contains_fact(f79));        ENSURE(!r1->contains_fact(f99));//.........这里部分代码省略.........
开发者ID:NikolajBjorner,项目名称:z3,代码行数:101,


示例17: ASSERT

boolShaderInstance::mergeable (const ShaderInstance &b, const ShaderGroup &g) const{    // Must both be instances of the same master -- very fast early-out    // for most potential pair comparisons.    if (master() != b.master())        return false;    // If the shaders haven't been optimized yet, they don't yet have    // their own symbol tables and instructions (they just refer to    // their unoptimized master), but they may have an "instance    // override" vector that describes which parameters have    // instance-specific values or connections.    bool optimized = (m_instsymbols.size() != 0 || m_instops.size() != 0);    // Same instance overrides    if (m_instoverrides.size() || b.m_instoverrides.size()) {        ASSERT (! optimized);  // should not be post-opt        ASSERT (m_instoverrides.size() == b.m_instoverrides.size());        for (size_t i = 0, e = m_instoverrides.size();  i < e;  ++i) {            if ((m_instoverrides[i].valuesource() == Symbol::DefaultVal ||                 m_instoverrides[i].valuesource() == Symbol::InstanceVal) &&                (b.m_instoverrides[i].valuesource() == Symbol::DefaultVal ||                 b.m_instoverrides[i].valuesource() == Symbol::InstanceVal)) {                // If both params are defaults or instances, let the                // instance parameter value checking below handle                // things. No need to reject default-vs-instance                // mismatches if the actual values turn out to be the                // same later.                continue;            }            if (! (equivalent(m_instoverrides[i], b.m_instoverrides[i]))) {                const Symbol *sym = mastersymbol(i);  // remember, it's pre-opt                const Symbol *bsym = b.mastersymbol(i);                if (! sym->everused_in_group() && ! bsym->everused_in_group())                    continue;                return false;            }            // But still, if they differ in their lockgeom'edness, we can't            // merge the instances.            if (m_instoverrides[i].lockgeom() != b.m_instoverrides[i].lockgeom()) {                return false;            }        }    }    // Make sure that the two nodes have the same parameter values.  If    // the group has already been optimized, it's got an    // instance-specific symbol table to check; but if it hasn't been    // optimized, we check the symbol table in the master.    for (int i = firstparam();  i < lastparam();  ++i) {        const Symbol *sym = optimized ? symbol(i) : mastersymbol(i);        if (! sym->everused_in_group())            continue;        if (sym->typespec().is_closure())            continue;   // Closures can't have instance override values        if ((sym->valuesource() == Symbol::InstanceVal || sym->valuesource() == Symbol::DefaultVal)            && memcmp (param_storage(i), b.param_storage(i),                       sym->typespec().simpletype().size())) {            return false;        }    }    if (m_run_lazily != b.m_run_lazily) {        return false;    }    // The connection list need to be the same for the two shaders.    if (m_connections.size() != b.m_connections.size()) {        return false;    }    if (m_connections != b.m_connections) {        return false;    }    // Make sure system didn't ask for instances that query userdata to be    // immune from instance merging.    if (! shadingsys().m_opt_merge_instances_with_userdata        && (userdata_params() || b.userdata_params())) {        return false;    }    // If there are no "local" ops or symbols, this instance hasn't been    // optimized yet.  In that case, we've already done enough checking,    // since the masters being the same and having the same instance    // params and connections is all it takes.  The rest (below) only    // comes into play after instances are more fully elaborated from    // their masters in order to be optimized.    if (!optimized) {        return true;    }    // Same symbol table    if (! equivalent (m_instsymbols, b.m_instsymbols)) {        return false;    }    // Same opcodes to run    if (! equivalent (m_instops, b.m_instops)) {//.........这里部分代码省略.........
开发者ID:rlmh,项目名称:OpenShadingLanguage,代码行数:101,


示例18: test_functional_columns

    void test_functional_columns(smt_params fparams, params_ref& params) {        ast_manager m;        register_engine re;        context ctx(m, re, fparams);        rel_context_base& rctx = *ctx.get_rel_context();        ctx.updt_params(params);        relation_manager & rmgr(rctx.get_rmanager());        sparse_table_plugin & plugin =             static_cast<sparse_table_plugin &>(*rctx.get_rmanager().get_table_plugin(symbol("sparse")));        ENSURE(&plugin);        table_signature sig2;        sig2.push_back(2);        sig2.push_back(2);        sig2.set_functional_columns(1);        ENSURE(plugin.can_handle_signature(sig2));                table_fact f00;        f00.push_back(0);        f00.push_back(0);        table_fact f01;        f01.push_back(0);        f01.push_back(1);        table_fact f11;        f11.push_back(1);        f11.push_back(1);        {            table_aptr t0 = plugin.mk_empty(sig2);            ENSURE(t0->empty());            t0->add_fact(f00);            ENSURE(!t0->empty());            ENSURE(t0->get_size_estimate_rows()==1);            t0->add_fact(f01);            ENSURE(t0->get_size_estimate_rows()==1);            t0->add_fact(f11);            ENSURE(t0->get_size_estimate_rows()==2);            unsigned rem_cols0[]={0};            scoped_ptr<table_transformer_fn> project0 = rmgr.mk_project_fn(*t0, 1, rem_cols0);            table_aptr t1 = (*project0)(*t0);            ENSURE(t1->get_size_estimate_rows()==2);            ENSURE(t1->get_signature().functional_columns()==0); //project on non-functional column cancels functional            unsigned rem_cols1[]={1};            scoped_ptr<table_transformer_fn> project1 = rmgr.mk_project_fn(*t0, 1, rem_cols1);            table_aptr t2 = (*project1)(*t0);            ENSURE(t2->get_size_estimate_rows()==2);            idx_set acc;            collector_of_reduced * reducer = alloc(collector_of_reduced, acc);            scoped_ptr<table_transformer_fn> rproject = rmgr.mk_project_with_reduce_fn(*t0, 1, rem_cols0, reducer);            table_aptr rt = (*rproject)(*t0);            ENSURE(acc.num_elems()==1);            ENSURE(rt->get_size_estimate_rows()==1);        }        {            table_aptr t0 = plugin.mk_empty(sig2);            t0->add_fact(f01);            unsigned join_cols[]={1};            scoped_ptr<table_join_fn> join0 = rmgr.mk_join_fn(*t0, *t0, 1, join_cols, join_cols);            table_aptr t1 = (*join0)(*t0, *t0);            ENSURE(t1->get_signature().size()==4);            ENSURE(t1->get_signature().functional_columns()==2);            table_fact f0011;            f0011.push_back(0);            f0011.push_back(0);            f0011.push_back(1);            f0011.push_back(1);            ENSURE(t1->contains_fact(f0011));            table_fact f0111 = f0011;            f0111[1] = 1;            ENSURE(!t1->contains_fact(f0111));        }        {            table_aptr t0 = plugin.mk_empty(sig2);            t0->display(std::cout<<"0:");            ENSURE(t0->get_signature().functional_columns()==1);                        table_fact aux_fact;            aux_fact = f01;            TRUSTME( t0->suggest_fact(aux_fact) );            t0->display(std::cout<<"1:");            ENSURE(t0->contains_fact(f01));            ENSURE(aux_fact[1]==1);            aux_fact = f00;            TRUSTME( !t0->suggest_fact(aux_fact) );            t0->display(std::cout<<"2:");            ENSURE(t0->contains_fact(f01));            ENSURE(!t0->contains_fact(f00));            ENSURE(aux_fact[1]==1);            t0->ensure_fact(f00);            t0->display(std::cout<<"3:");            ENSURE(t0->contains_fact(f00));//.........这里部分代码省略.........
开发者ID:NikolajBjorner,项目名称:z3,代码行数:101,


示例19: mk_qfidl_tactic

tactic * mk_qfidl_tactic(ast_manager & m, params_ref const & p) {    params_ref main_p;    main_p.set_bool("elim_and", true);    main_p.set_bool("blast_distinct", true);    main_p.set_bool("som", true);    params_ref lhs_p;    lhs_p.set_bool("arith_lhs", true);    params_ref lia2pb_p;    lia2pb_p.set_uint("lia2pb_max_bits", 4);    params_ref pb2bv_p;    pb2bv_p.set_uint("pb2bv_all_clauses_limit", 8);    params_ref pull_ite_p;    pull_ite_p.set_bool("pull_cheap_ite", true);    pull_ite_p.set_bool("local_ctx", true);    pull_ite_p.set_uint("local_ctx_limit", 10000000);    tactic * preamble_st = and_then(and_then(mk_simplify_tactic(m),                                             mk_fix_dl_var_tactic(m),                                             mk_propagate_values_tactic(m),                                             mk_elim_uncnstr_tactic(m)                                             ),                                    and_then(mk_solve_eqs_tactic(m),                                             using_params(mk_simplify_tactic(m), lhs_p),                                             mk_propagate_values_tactic(m),                                             mk_normalize_bounds_tactic(m),                                             mk_solve_eqs_tactic(m)));            params_ref bv_solver_p;    // The cardinality constraint encoding generates a lot of shared if-then-else's that can be flattened.    // Several of them are simplified to and/or. If we flat them, we increase a lot the memory consumption.    bv_solver_p.set_bool("flat", false);     bv_solver_p.set_bool("som", false);     // dynamic psm seems to work well.    bv_solver_p.set_sym("gc", symbol("dyn_psm"));    tactic * bv_solver = using_params(and_then(mk_simplify_tactic(m),                                               mk_propagate_values_tactic(m),                                               mk_solve_eqs_tactic(m),                                               mk_max_bv_sharing_tactic(m),                                               mk_bit_blaster_tactic(m),                                               mk_aig_tactic(),                                               mk_sat_tactic(m)),                                      bv_solver_p);    tactic * try2bv =         and_then(using_params(mk_lia2pb_tactic(m), lia2pb_p),                 mk_propagate_ineqs_tactic(m),                 using_params(mk_pb2bv_tactic(m), pb2bv_p),                 fail_if(mk_not(mk_is_qfbv_probe())),                 bv_solver);        params_ref diff_neq_p;    diff_neq_p.set_uint("diff_neq_max_k", 25);    tactic * st = cond(mk_and(mk_lt(mk_num_consts_probe(), mk_const_probe(static_cast<double>(BIG_PROBLEM))),                              mk_and(mk_not(mk_produce_proofs_probe()),                                     mk_not(mk_produce_unsat_cores_probe()))),                       using_params(and_then(preamble_st,                                             or_else(using_params(mk_diff_neq_tactic(m), diff_neq_p),                                                     try2bv,                                                     mk_smt_tactic())),                                    main_p),                       mk_smt_tactic());        st->updt_params(p);    return st;}
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:74,


示例20: while

void Moc::parse(){    QList<NamespaceDef> namespaceList;    bool templateClass = false;    while (hasNext()) {        Token t = next();        switch (t) {            case NAMESPACE: {                int rewind = index;                if (test(IDENTIFIER)) {                    if (test(EQ)) {                        // namespace Foo = Bar::Baz;                        until(SEMIC);                    } else if (!test(SEMIC)) {                        NamespaceDef def;                        def.name = lexem();                        next(LBRACE);                        def.begin = index - 1;                        until(RBRACE);                        def.end = index;                        index = def.begin + 1;                        namespaceList += def;                        index = rewind;                    }                }                break;            }            case SEMIC:            case RBRACE:                templateClass = false;                break;            case TEMPLATE:                templateClass = true;                break;            case MOC_INCLUDE_BEGIN:                currentFilenames.push(symbol().unquotedLexem());                break;            case MOC_INCLUDE_END:                currentFilenames.pop();                break;            case Q_DECLARE_INTERFACE_TOKEN:                parseDeclareInterface();                break;            case Q_DECLARE_METATYPE_TOKEN:                parseDeclareMetatype();                break;            case USING:                if (test(NAMESPACE)) {                    while (test(SCOPE) || test(IDENTIFIER))                        ;                    next(SEMIC);                }                break;            case CLASS:            case STRUCT: {                if (currentFilenames.size() <= 1)                    break;                ClassDef def;                if (!parseClassHead(&def))                    continue;                while (inClass(&def) && hasNext()) {                    if (next() == Q_OBJECT_TOKEN) {                        def.hasQObject = true;                        break;                    }                }                if (!def.hasQObject)                    continue;                for (int i = namespaceList.size() - 1; i >= 0; --i)                    if (inNamespace(&namespaceList.at(i)))                        def.qualified.prepend(namespaceList.at(i).name + "::");                knownQObjectClasses.insert(def.classname);                knownQObjectClasses.insert(def.qualified);                continue; }            default: break;        }        if ((t != CLASS && t != STRUCT)|| currentFilenames.size() > 1)            continue;        ClassDef def;        if (parseClassHead(&def)) {            FunctionDef::Access access = FunctionDef::Private;            for (int i = namespaceList.size() - 1; i >= 0; --i)                if (inNamespace(&namespaceList.at(i)))                    def.qualified.prepend(namespaceList.at(i).name + "::");            while (inClass(&def) && hasNext()) {                switch ((t = next())) {                case PRIVATE:                    access = FunctionDef::Private;                    if (test(Q_SIGNALS_TOKEN))                        error("Signals cannot have access specifier");                    break;                case PROTECTED:                    access = FunctionDef::Protected;                    if (test(Q_SIGNALS_TOKEN))//.........这里部分代码省略.........
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:101,


示例21: D_symbol2

/*! * /brief draw a symbol at pixel coordinates (alternate) * * Draws a symbol (one of $GISBASE/etc/symbols/) to the active display. * The same as D_symbol(), but it uses a primary and secondary color * instead of line and fill color. The primary color is used to draw * stroke lines (STRINGs) and as the fill color for polygons. The secondary * color is used for polygon outlines. * *  /param Symb The symbol name (e.g. basic/circle) *  /param x0   The starting x display coordinate (pixel) *  /param y0   The starting y display coordinate (pixel) *  /param primary_color  Primary draw color *  /param secondary_color  Secondary draw color *  /return void */void D_symbol2(const SYMBOL *Symb, double x0, double y0,	       const RGBA_Color *primary_color,	       const RGBA_Color *secondary_color){    symbol(Symb, x0, y0, primary_color, secondary_color, primary_color);}
开发者ID:felipebetancur,项目名称:grass-ci,代码行数:22,


示例22: ctx_solver_simplify_tactic

 ctx_solver_simplify_tactic(ast_manager & m, params_ref const & p = params_ref()):     m(m), m_params(p), m_solver(m, m_front_p),  m_arith(m), m_mk_app(m), m_fn(m), m_num_steps(0) {     sort* i_sort = m_arith.mk_int();     m_fn = m.mk_func_decl(symbol(0xbeef101), i_sort, m.mk_bool_sort()); }
开发者ID:sukwon0709,项目名称:byterun,代码行数:5,


示例23: yypower

voidyypower(void){	int n;	p2 = pop();	p1 = pop();	// both base and exponent are rational numbers?	if (isrational(p1) && isrational(p2)) {		push(p1);		push(p2);		qpow();		return;	}	// both base and exponent are either rational or double?	if (isnum(p1) && isnum(p2)) {		push(p1);		push(p2);		dpow();		return;	}	if (istensor(p1)) {		power_tensor();		return;	}	if (p1 == symbol(E) && car(p2) == symbol(LOG)) {		push(cadr(p2));		return;	}	if ((p1 == symbol(MINFTY) || p1 == symbol(INFTY)) && isnegativeterm(p2)) {		push_integer(0);		return;	}	if (iszero(p1) && isnegativeterm(p2)) {		push_symbol(INFTY);		return;	}	if (p1 == symbol(E) && p2 == symbol(MINFTY)) {				push_integer(0);		return;	}	if (p1 == symbol(E) && isdouble(p2)) {		push_double(exp(p2->u.d));		return;	}	//	1 ^ a		->	1	//	a ^ 0		->	1	if (equal(p1, one) || iszero(p2)) {		push(one);		return;	}	//	a ^ 1		->	a	if (equal(p2, one)) {		push(p1);		return;	}	//	(a * b) ^ c	->	(a ^ c) * (b ^ c)	if (car(p1) == symbol(MULTIPLY)) {		p1 = cdr(p1);		push(car(p1));		push(p2);		power();		p1 = cdr(p1);		while (iscons(p1)) {			push(car(p1));			push(p2);			power();			multiply();			p1 = cdr(p1);		}		return;	}	//	(a ^ b) ^ c	->	a ^ (b * c)	if (car(p1) == symbol(POWER)) {		push(cadr(p1));		push(caddr(p1));		push(p2);		multiply();		power();		return;	}//.........这里部分代码省略.........
开发者ID:gbl08ma,项目名称:eigenmath,代码行数:101,


示例24: absval

voidabsval(void){	int h;	save();	p1 = pop();	if (istensor(p1)) {		absval_tensor();		restore();		return;	}	if (isnum(p1)) {		push(p1);		if (isnegativenumber(p1))			negate();		restore();		return;	}	if (iscomplexnumber(p1)) {		push(p1);		push(p1);		conjugate();		multiply();		push_rational(1, 2);		power();		restore();		return;	}	// abs(1/a) evaluates to 1/abs(a)	if (car(p1) == symbol(POWER) && isnegativeterm(caddr(p1))) {		push(p1);		reciprocate();		absval();		reciprocate();		restore();		return;	}	// abs(a*b) evaluates to abs(a)*abs(b)	if (car(p1) == symbol(MULTIPLY)) {		h = tos;		p1 = cdr(p1);		while (iscons(p1)) {			push(car(p1));			absval();			p1 = cdr(p1);		}		multiply_all(tos - h);		restore();		return;	}	if (isnegativeterm(p1) || (car(p1) == symbol(ADD) && isnegativeterm(cadr(p1)))) {		push(p1);		negate();		p1 = pop();	}	push_symbol(ABS);	push(p1);	list(2);	restore();}
开发者ID:AnderainLovelace,项目名称:ForumlaZ-WH,代码行数:70,


示例25: symbol

// Return symbol of atomic number 'i'const char* ElementMap::symbol(Atom* i){	return symbol(i->element());}
开发者ID:trisyoungs,项目名称:duq,代码行数:5,


示例26: while

void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed){    currentFilenames.push(filename);    preprocessed.reserve(preprocessed.size() + symbols.size());    while (hasNext()) {        Token token = next();        switch (token) {        case PP_INCLUDE:        {            int lineNum = symbol().lineNum;            QByteArray include;            bool local = false;            if (test(PP_STRING_LITERAL)) {                local = lexem().startsWith('/"');                include = unquotedLexem();            } else                continue;            until(PP_NEWLINE);            // #### stringery            QFileInfo fi;            if (local)                fi.setFile(QFileInfo(QString::fromLocal8Bit(filename.constData())).dir(), QString::fromLocal8Bit(include.constData()));            for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) {                const IncludePath &p = Preprocessor::includes.at(j);                fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData()));                // try again, maybe there's a file later in the include paths with the same name                // (186067)                if (fi.isDir()) {                    fi = QFileInfo();                    continue;                }            }            if (!fi.exists() || fi.isDir())                continue;            include = fi.canonicalFilePath().toLocal8Bit();            if (Preprocessor::preprocessedIncludes.contains(include))                continue;            Preprocessor::preprocessedIncludes.insert(include);            QFile file(QString::fromLocal8Bit(include.constData()));            if (!file.open(QFile::ReadOnly))                continue;            QByteArray input = file.readAll();            file.close();            if (input.isEmpty())                continue;            Symbols saveSymbols = symbols;            int saveIndex = index;            // phase 1: get rid of backslash-newlines            input = cleaned(input);            // phase 2: tokenize for the preprocessor            symbols = tokenize(input);            input.clear();            index = 0;            // phase 3: preprocess conditions and substitute macros            preprocessed += Symbol(0, MOC_INCLUDE_BEGIN, include);            preprocess(include, preprocessed);            preprocessed += Symbol(lineNum, MOC_INCLUDE_END, include);            symbols = saveSymbols;            index = saveIndex;            continue;        }        case PP_DEFINE:        {            next(IDENTIFIER);            QByteArray name = lexem();            int start = index;            until(PP_NEWLINE);            Macro macro;            macro.symbols.reserve(index - start - 1);            for (int i = start; i < index - 1; ++i)                macro.symbols += symbols.at(i);            macros.insert(name, macro);            continue;        }        case PP_UNDEF: {            next(IDENTIFIER);            QByteArray name = lexem();            until(PP_NEWLINE);            macros.remove(name);            continue;        }        case PP_IDENTIFIER:        {//             if (macros.contains(symbol()))//                 ;        }            // we _could_ easily substitute macros by the following            // four lines, but we choose not to.//.........这里部分代码省略.........
开发者ID:fluxer,项目名称:katie,代码行数:101,


示例27: if

//!  Update the widget that represents the curve on the legendvoid QwtPlotCurve::updateLegend(QwtLegend *legend) const{    if ( !legend )        return;    QwtPlotItem::updateLegend(legend);    QWidget *widget = legend->find(this);    if ( !widget || !widget->inherits("QwtLegendItem") )        return;    QwtLegendItem *legendItem = (QwtLegendItem *)widget;#if QT_VERSION < 0x040000    const bool doUpdate = legendItem->isUpdatesEnabled();#else    const bool doUpdate = legendItem->updatesEnabled();#endif    legendItem->setUpdatesEnabled(false);    const int policy = legend->displayPolicy();    if (policy == QwtLegend::FixedIdentifier)    {        int mode = legend->identifierMode();        if (mode & QwtLegendItem::ShowLine)            legendItem->setCurvePen(pen());        if (mode & QwtLegendItem::ShowSymbol)            legendItem->setSymbol(symbol());        if (mode & QwtLegendItem::ShowText)            legendItem->setText(title());        else            legendItem->setText(QwtText());        legendItem->setIdentifierMode(mode);    }    else if (policy == QwtLegend::AutoIdentifier)    {        int mode = 0;        if (QwtPlotCurve::NoCurve != style())        {            legendItem->setCurvePen(pen());            mode |= QwtLegendItem::ShowLine;        }        if (QwtSymbol::NoSymbol != symbol().style())        {            legendItem->setSymbol(symbol());            mode |= QwtLegendItem::ShowSymbol;        }        if ( !title().isEmpty() )        {            legendItem->setText(title());            mode |= QwtLegendItem::ShowText;        }        else        {            legendItem->setText(QwtText());        }        legendItem->setIdentifierMode(mode);    }    legendItem->setUpdatesEnabled(doUpdate);    legendItem->update();}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:69,


示例28: write_log

void CIteratorThread::InitIteratorLoop(){	int			e = SUCCESS;	CGrammar	gram;	write_log(prefs.debug_prwin(), "[PrWinThread] Initializing iterator loop/n");	// Set starting status and parameters	iter_vars.set_iterator_thread_running(true);	iter_vars.set_iterator_thread_complete(false);	iter_vars.set_iterator_thread_progress(0);	iter_vars.set_nit(10000); //!! f$prwin_number_of_iterations")	iter_vars.set_f$p(p_symbol_engine_prwin->nopponents_for_prwin());	iter_vars.set_br(p_betround_calculator->betround());	for (int i=0; i<k_number_of_cards_per_player; i++)		iter_vars.set_pcard(i, p_scraper->card_player((int) p_symbol_engine_userchair->userchair(), i));	for (int i=0; i<k_number_of_community_cards; i++)		iter_vars.set_ccard(i, p_scraper->card_common(i));	iter_vars.set_prwin(0);	iter_vars.set_prtie(0);	iter_vars.set_prlos(0);	// player cards	CardMask_RESET(_plCards);	CardMask_RESET(_comCards);	_nplCards = _ncomCards = 0;	// Counters	_win = _tie = _los = 0;	// setup masks	for (int i=0; i<k_number_of_cards_per_player; i++)	{		if (iter_vars.pcard(i) != CARD_BACK && iter_vars.pcard(i) != CARD_NOCARD)		{			CardMask_SET(_plCards, iter_vars.pcard(i));			_nplCards++;		}	}	for (int i=0; i<k_number_of_community_cards; i++)	{		if (iter_vars.ccard(i) != CARD_BACK && iter_vars.ccard(i) != CARD_NOCARD)		{			CardMask_SET(_comCards, iter_vars.ccard(i));			_ncomCards++;		}	}	//Weighted prwin only for nopponents <=13	e = SUCCESS;	_willplay = (int) gram.CalcF$symbol(p_formula, "f$willplay", &e);	e = SUCCESS;	_wontplay = (int) gram.CalcF$symbol(p_formula, "f$wontplay", &e);	e = SUCCESS;	_mustplay = (int) gram.CalcF$symbol(p_formula, "f$mustplay", &e);	e = SUCCESS;	_topclip = (int) gram.CalcF$symbol(p_formula, "f$topclip", &e);	// Call prw1326 callback if needed	if (_prw1326.useme==1326 && 		_prw1326.usecallback==1326 && 		(p_betround_calculator->betround()!=1 || _prw1326.preflop==1326) )	{		_prw1326.prw_callback(); //Matrix 2008-05-09	}}
开发者ID:buranela,项目名称:OpenHoldemV12,代码行数:68,


示例29: tst1

static void tst1() {    symbol s1("foo");    symbol s2("boo");    symbol s3("foo");    ENSURE(s1 != s2);    ENSURE(s1 == s3);    std::cout << s1 << " " << s2 << " " << s3 << "/n";    ENSURE(s1 == "foo");    ENSURE(s1 != "boo");    ENSURE(s2 != "foo");    ENSURE(s3 == "foo");    ENSURE(s2 == "boo");    ENSURE(lt(s2, s1));    ENSURE(!lt(s1, s2));    ENSURE(!lt(s1, s3));    ENSURE(lt(symbol("abcc"), symbol("abcd")));    ENSURE(!lt(symbol("abcd"), symbol("abcc")));    ENSURE(lt(symbol("abc"), symbol("abcc")));    ENSURE(!lt(symbol("abcd"), symbol("abc")));    ENSURE(lt(symbol(10), s1));    ENSURE(!lt(s1, symbol(10)));    ENSURE(lt(symbol(10), symbol(20)));    ENSURE(!lt(symbol(20), symbol(10)));    ENSURE(!lt(symbol(10), symbol(10)));    ENSURE(lt(symbol("a"), symbol("b")));    ENSURE(!lt(symbol("z"), symbol("b")));    ENSURE(!lt(symbol("zzz"), symbol("b")));    ENSURE(lt(symbol("zzz"), symbol("zzzb")));}
开发者ID:NikolajBjorner,项目名称:z3,代码行数:30,


示例30: symbol_enforce_type_assert

void symbol_enforce_type_assert(arg_list_t **a, int type){	*a = symbol();	arg_enforce_type_assert(a, type);}
开发者ID:OldRepoPreservation,项目名称:freyja,代码行数:5,



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


C++ symbolTable函数代码示例
C++ sym_tristate_within_range函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。