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

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

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

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

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

示例1: socialServerStart

bool socialServerStart(SocialServer *self) {    special("======================");    special("==== Social server ===");    special("======================");    if (!(serverStart(self->server))) {        error("Cannot start the Server.");        return false;    }    return true;}
开发者ID:Smallthing,项目名称:R1EMU,代码行数:12,


示例2: main

intmain (int argc, char *argv[]){  tests_start_mpfr ();  special ();  test_specialz (mpfr_add_z, mpz_add, "add");  test_specialz (mpfr_sub_z, mpz_sub, "sub");  test_specialz (mpfr_mul_z, mpz_mul, "mul");  test_genericz (2, 100, 100, mpfr_add_z, "add");  test_genericz (2, 100, 100, mpfr_sub_z, "sub");  test_genericz (2, 100, 100, mpfr_mul_z, "mul");  test_genericz (2, 100, 100, mpfr_div_z, "div");  test_genericq (2, 100, 100, mpfr_add_q, "add");  test_genericq (2, 100, 100, mpfr_sub_q, "sub");  test_genericq (2, 100, 100, mpfr_mul_q, "mul");  test_genericq (2, 100, 100, mpfr_div_q, "div");  test_specialq (2, 100, 100, mpfr_mul_q, mpq_mul, "mul");  test_specialq (2, 100, 100, mpfr_div_q, mpq_div, "div");  test_specialq (2, 100, 100, mpfr_add_q, mpq_add, "add");  test_specialq (2, 100, 100, mpfr_sub_q, mpq_sub, "sub");  test_cmp_z (2, 100, 100);  test_cmp_q (2, 100, 100);  test_cmp_f (2, 100, 100);  check_for_zero ();  tests_end_mpfr ();  return 0;}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.toolchain,代码行数:33,


示例3: main

intmain(int argc, char *argv[]){	int *pr_arr, pr_len, n_found;	int max = 1;  /* max number of prime search. this grows '*10' */	int i, tmp;	long sum;	n_found = 0;	sum = 0L;	tmp = 4;  /* for skip 2,3,5,7 */	while (1) {		/* we grow search range to 10,100,1000.. */		max *= 10;		if (primes_under(max, &pr_arr, &pr_len))			errx(1, "fail primes_under(%d)", max);		for (i = tmp; i < pr_len; i++) {			if (special(pr_arr[i], pr_arr, pr_len)) {				sum += pr_arr[i];				n_found++;				if (n_found == NEED_NFOUND)					break;  /* out to for-loop */			}		}		if (n_found == NEED_NFOUND)			break;  /* out to while-loop */		tmp = pr_len;  /* skip already checked for next loop */		free(pr_arr);	}	printf("%ld/n", sum);	return 0;}
开发者ID:tachama,项目名称:project-euler,代码行数:33,


示例4: main

intmain (int argc, char **argv){  mpfr_t x;  tests_start_mpfr ();  special ();  check_inexact ();  check("1.0", 3, MPFR_RNDN, "3.3333333333333331483e-1");  check("1.0", 3, MPFR_RNDZ, "3.3333333333333331483e-1");  check("1.0", 3, MPFR_RNDU, "3.3333333333333337034e-1");  check("1.0", 3, MPFR_RNDD, "3.3333333333333331483e-1");  check("1.0", 2116118, MPFR_RNDN, "4.7256343927890600483e-7");  check("1.098612288668109782", 5, MPFR_RNDN, "0.21972245773362195087");  mpfr_init2 (x, 53);  mpfr_set_ui (x, 3, MPFR_RNDD);  mpfr_log (x, x, MPFR_RNDD);  mpfr_div_ui (x, x, 5, MPFR_RNDD);  if (mpfr_cmp_str1 (x, "0.21972245773362189536"))    {      printf ("Error in mpfr_div_ui for x=ln(3), u=5/n");      exit (1);    }  mpfr_clear (x);  test_generic_ui (2, 200, 100);  tests_end_mpfr ();  return 0;}
开发者ID:Kirija,项目名称:XPIR,代码行数:34,


示例5: fillstruct

glui32 fillstruct(strid_t stream, const unsigned *info, glui32 *dest,		  glui32 (*special)(strid_t)){  unsigned char buffer[4];  unsigned e;  glui32 len = 0;;  for(e = 0; info[e]; e++) {    if(info[e] == 0x8000) {      *dest++ = special(stream);      len++;    }    else if(info[e] > 4) {      unsigned i;      for(i = 0; i < info[e]; i++) {	*dest++ = glk_get_char_stream(stream);	len++;      }    } else {      glk_get_buffer_stream(stream, (char *) buffer, info[e]);      switch(info[e]) {      case 1: *dest = MSBdecode1(buffer); break;      case 2: *dest = MSBdecode2(buffer); break;      case 3: *dest = MSBdecode3(buffer); break;      case 4: *dest = MSBdecode4(buffer); break;      }      dest++;      len+=info[e];    }  }  return len;}
开发者ID:BPaden,项目名称:garglk,代码行数:33,


示例6: assert

ReservedSpaceReservedSpace::last_part(size_t partition_size, size_t alignment) {  assert(partition_size <= size(), "partition failed");  ReservedSpace result(base() + partition_size, size() - partition_size,                       alignment, special(), executable());  return result;}
开发者ID:stkaushal,项目名称:jdk8_tl,代码行数:7,


示例7:

//! This function is called once per simulation step, allowing the//! constraint to be "motorized" according to some response.void OscHinge2ODE::simulationCallback(){    ODEConstraint& me = *static_cast<ODEConstraint*>(special());    dReal angle1 = dJointGetHinge2Angle1(me.joint());    dReal rate1 = dJointGetHinge2Angle1Rate(me.joint());    dReal addtorque1 =        - m_response->m_stiffness.m_value*angle1        - m_response->m_damping.m_value*rate1;#if 0  // TODO: dJointGetHinge2Angle2 is not yet available in ODE.    dReal angle2 = dJointGetHinge2Angle2(me.joint());#else    dReal angle2 = 0;#endif    dReal rate2 = dJointGetHinge2Angle2Rate(me.joint());    dReal addtorque2 =        - m_response->m_stiffness.m_value*angle2        - m_response->m_damping.m_value*rate2;    m_torque1.m_value = addtorque1;    m_torque2.m_value = addtorque2;    dJointAddHinge2Torques(me.joint(), addtorque1, addtorque2);}
开发者ID:funkmeisterb,项目名称:dimple,代码行数:29,


示例8: simulationCallback

void OscFreeODE::simulationCallback(){    ODEConstraint& me = *static_cast<ODEConstraint*>(special());    const dReal *pos1 = dBodyGetPosition(me.body1());    const dReal *pos2 = dBodyGetPosition(me.body2());    const dReal *vel1 = dBodyGetLinearVel(me.body1());    const dReal *vel2 = dBodyGetLinearVel(me.body2());    dReal force[3];    force[0] =        - ((pos2[0]-pos1[0]-m_initial_distance[0])           * m_response->m_stiffness.m_value)        - (vel2[0]-vel1[0]) * m_response->m_damping.m_value;    force[1] =        - ((pos2[1]-pos1[1]-m_initial_distance[1])           * m_response->m_stiffness.m_value)        - (vel2[1]-vel1[1]) * m_response->m_damping.m_value;    force[2] =        - ((pos2[2]-pos1[2]-m_initial_distance[2])           * m_response->m_stiffness.m_value)        - (vel2[2]-vel1[2]) * m_response->m_damping.m_value;    dBodyAddForce(me.body1(), -force[0], -force[1], -force[2]);    dBodyAddForce(me.body2(),  force[0],  force[1],  force[2]);}
开发者ID:funkmeisterb,项目名称:dimple,代码行数:30,


示例9: main

intmain (void){    mp_prec_t p;    MPFR_TEST_USE_RANDS ();    tests_start_mpfr ();    special ();    particular_cases ();    check_pow_ui ();    check_pow_si ();    check_special_pow_si ();    pow_si_long_min ();    for (p = 2; p < 100; p++)        check_inexact (p);    underflows ();    overflows ();    x_near_one ();    test_generic (2, 100, 100);    test_generic_ui (2, 100, 100);    test_generic_si (2, 100, 100);    data_check ("data/pow275", mpfr_pow275, "mpfr_pow275");    tests_end_mpfr ();    return 0;}
开发者ID:mmanley,项目名称:Antares,代码行数:29,


示例10: actual_committed_size

size_t VirtualSpace::actual_committed_size() const {  // Special VirtualSpaces commit all reserved space up front.  if (special()) {    return reserved_size();  }  size_t committed_low    = pointer_delta(_lower_high,  _low_boundary,         sizeof(char));  size_t committed_middle = pointer_delta(_middle_high, _lower_high_boundary,  sizeof(char));  size_t committed_high   = pointer_delta(_upper_high,  _middle_high_boundary, sizeof(char));#ifdef ASSERT  size_t lower  = pointer_delta(_lower_high_boundary,  _low_boundary,         sizeof(char));  size_t middle = pointer_delta(_middle_high_boundary, _lower_high_boundary,  sizeof(char));  size_t upper  = pointer_delta(_upper_high_boundary,  _middle_high_boundary, sizeof(char));  if (committed_high > 0) {    assert(committed_low == lower, "Must be");    assert(committed_middle == middle, "Must be");  }  if (committed_middle > 0) {    assert(committed_low == lower, "Must be");  }  if (committed_middle < middle) {    assert(committed_high == 0, "Must be");  }  if (committed_low < lower) {    assert(committed_high == 0, "Must be");    assert(committed_middle == 0, "Must be");  }#endif  return committed_low + committed_middle + committed_high;}
开发者ID:mur47x111,项目名称:JDK8-concurrent-tagging,代码行数:35,


示例11: assert

size_t PSVirtualSpaceHighToLow::expand_into(PSVirtualSpace* other_space,                                            size_t bytes) {  assert(is_aligned(bytes), "arg not aligned");  assert(grows_down(), "this space must grow down");  assert(other_space->grows_up(), "other space must grow up");  assert(reserved_low_addr() == other_space->reserved_high_addr(),         "spaces not contiguous");  assert(special() == other_space->special(), "one space is special in memory, the other is not");  DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this));  DEBUG_ONLY(PSVirtualSpaceVerifier other_verifier(other_space));  size_t bytes_needed = bytes;  // First use the uncommitted region in this space.  size_t tmp_bytes = MIN2(uncommitted_size(), bytes_needed);  if (tmp_bytes > 0) {    if (expand_by(tmp_bytes)) {      bytes_needed -= tmp_bytes;    } else {      return 0;    }  }  // Next take from the uncommitted region in the other space, and commit it.  tmp_bytes = MIN2(other_space->uncommitted_size(), bytes_needed);  if (tmp_bytes > 0) {    char* const commit_base = committed_low_addr() - tmp_bytes;    if (other_space->special() ||        os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) {      // Reduce the reserved region in the other space.      other_space->set_reserved(other_space->reserved_low_addr(),                                other_space->reserved_high_addr() - tmp_bytes,                                other_space->special());      // Grow both reserved and committed in this space.      _reserved_low_addr -= tmp_bytes;      _committed_low_addr -= tmp_bytes;      bytes_needed -= tmp_bytes;    } else {      return bytes - bytes_needed;    }  }  // Finally take from the already committed region in the other space.  tmp_bytes = bytes_needed;  if (tmp_bytes > 0) {    // Reduce both committed and reserved in the other space.    other_space->set_committed(other_space->committed_low_addr(),                               other_space->committed_high_addr() - tmp_bytes);    other_space->set_reserved(other_space->reserved_low_addr(),                              other_space->reserved_high_addr() - tmp_bytes,                              other_space->special());    // Grow both reserved and committed in this space.    _reserved_low_addr -= tmp_bytes;    _committed_low_addr -= tmp_bytes;  }  return bytes;}
开发者ID:shelan,项目名称:jdk9-mirror,代码行数:60,


示例12: OscFree

OscFreeODE::OscFreeODE(dWorldID odeWorld, dSpaceID odeSpace,                         const char *name, OscBase* parent,                         OscObject *object1, OscObject *object2)    : OscFree(name, parent, object1, object2){    m_response = new OscResponse("response",this);    // The "Free" constraint is not actually an ODE constraint.    // However, we need an ODEConstraint to remember the objects so    // that they can receive forces and torques.    m_pSpecial = new ODEConstraint(this, NULL, odeWorld, odeSpace,                                   object1, object2);    ODEConstraint& cons = *static_cast<ODEConstraint*>(special());    const dReal *pos1 = dBodyGetPosition(cons.body1());    const dReal *pos2 = dBodyGetPosition(cons.body2());    m_initial_distance[0] = pos2[0] - pos1[0];    m_initial_distance[1] = pos2[1] - pos1[1];    m_initial_distance[2] = pos2[2] - pos1[2];    printf("[%s] Free constraint created between %s and %s./n",           simulation()->type_str(),           object1->c_name(), object2->c_name());}
开发者ID:funkmeisterb,项目名称:dimple,代码行数:26,


示例13: main

int main(int argc, char ** argv){	int option = -1;	if( argc <= 1 || ( (option = atoi(argv[1])) < 0 ) ){		print_usage();	}	int count = 0;	if(argc >= 3)		count = atoi(argv[2]);	printf("Welcome to effectTest, option %d, count %d/n", option, count);	switch(option){		case 0:			functional(count);			break;		case 1:			left();			break;		case 2:			right();			break;		case 3:			duplicate();			break;		case 4:				invalid();			break;		case 5:			special();			break;		case 9:			other();			break;	}	return 0;}
开发者ID:movingname,项目名称:cruiser-psu,代码行数:34,


示例14: on_density

void OscSphereODE::on_density(){    ODEObject *ode_object = static_cast<ODEObject*>(special());    dMassSetSphere(&ode_object->mass(), m_density.m_value, m_radius.m_value);    dBodySetMass(ode_object->body(), &ode_object->mass());    m_mass.m_value = ode_object->mass().mass;}
开发者ID:funkmeisterb,项目名称:dimple,代码行数:8,


示例15:

void G1PageBasedVirtualSpace::print_on(outputStream* out) {  out->print   ("Virtual space:");  if (special()) out->print(" (pinned in memory)");  out->cr();  out->print_cr(" - committed: " SIZE_FORMAT, committed_size());  out->print_cr(" - reserved:  " SIZE_FORMAT, reserved_size());  out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  p2i(_low_boundary), p2i(_high_boundary));}
开发者ID:koutheir,项目名称:incinerator-hotspot,代码行数:8,


示例16: menu

voidmenu(int value){  if(value < 0)    special(-value, 0, 0);  else    key((unsigned char) value, 0, 0);}
开发者ID:AlexGreulich,项目名称:HRTFVR,代码行数:8,


示例17: testSpecial

void testSpecial() {	int x = 10;	for ( int i = 1; i < x; i+=2 ) {		special( i );	}}
开发者ID:MrLi008,项目名称:visualstudio2013_,代码行数:8,


示例18: print

void VirtualSpace::print() {  tty->print   ("Virtual space:");  if (special()) tty->print(" (pinned in memory)");  tty->cr();  tty->print_cr(" - committed: " SIZE_FORMAT, committed_size());  tty->print_cr(" - reserved:  " SIZE_FORMAT, reserved_size());  tty->print_cr(" - [low, high]:     [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  low(), high());  tty->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  low_boundary(), high_boundary());}
开发者ID:stkaushal,项目名称:jdk8_tl,代码行数:9,


示例19: on_mass

void OscSphereODE::on_mass(){    ODEObject *ode_object = static_cast<ODEObject*>(special());    dMassSetSphereTotal(&ode_object->mass(), m_mass.m_value, m_radius.m_value);    dBodySetMass(ode_object->body(), &ode_object->mass());    dReal volume = 4*M_PI*m_radius.m_value*m_radius.m_value*m_radius.m_value/3;    m_density.m_value = m_mass.m_value / volume;}
开发者ID:funkmeisterb,项目名称:dimple,代码行数:9,


示例20: on_radius

void OscSphereODE::on_radius(){    ODEObject *ode_object = static_cast<ODEObject*>(special());    dGeomSphereSetRadius(ode_object->geom(), m_radius.m_value);    // reset the mass to maintain same density    dMassSetSphere(&ode_object->mass(), m_density.m_value, m_radius.m_value);    m_mass.m_value = ode_object->mass().mass;}
开发者ID:funkmeisterb,项目名称:dimple,代码行数:10,


示例21: htmlencode

void htmlencode(std::ostream &out, const std::wstring &value){  for (size_t i=0; i<value.length(); ++i) {    if (special(value[i])) {      out << "&#" << (int) value[i] << ";";    } else {      out << (char) value[i];    }  }}
开发者ID:sdouma,项目名称:450-Compiler-Project,代码行数:10,


示例22: l_eval

/* Evaluate an S-expression */longl_eval(long s){  long  v, f, a, av[2];  int n;  switch(D_GET_TAG(s)){  case TAG_NIL:        /* self-evaluating objects */  case TAG_T:  case TAG_INT:    v = s;    break;  case TAG_SYMB:       /* symbol ... refer to the symbol table */    if ((v = t_symb_val[D_GET_DATA(s)]) == TAG_UNDEF)      return err_msg(errmsg_sym_undef, 1, s);    break;  case TAG_CONS:       /* cons ... function call */    f = l_car(s);   /* function name or lambda exp */    a = l_cdr(s);   /* actual argument list */#ifndef minimalistic    if ((D_GET_TAG(f) == TAG_CONS) && (D_GET_TAG(l_car(f)) == TAG_SYMB)         && ((D_GET_DATA(l_car(f)) == KW_LAMBDA))){   /* lambda exp */      if (eval_args(f, a, av, FTYPE_ANY_ARGS) < 0)        return -1;      v = apply(l_cdr(f), av[0], list_len(l_car(l_cdr(f))));    } else#endif        if (D_GET_TAG(f) == TAG_SYMB){      n = FTYPE_GET_NARGS(t_symb_ftype[D_GET_DATA(f)]);      switch (FTYPE_GET_TYPE(t_symb_ftype[D_GET_DATA(f)])){      case FTYPE_UNDEF:        return err_msg(errmsg_func_undef, 1, f);      case FTYPE_SPECIAL:        v = special(f, a);        break;      case FTYPE_SYS:        if (eval_args(f, a, av, n) < 0)          return -1;        v = fcall(f, av/*, n*/);        break;      case FTYPE_USER:        if (eval_args(f, a, av, FTYPE_ANY_ARGS) < 0)          return -1;        v = apply(f, av[0], n);      }    } else {      return err_msg(errmsg_ill_call, 1, s);    }    break;  }  return v;}
开发者ID:meesokim,项目名称:z88dk,代码行数:56,


示例23: switch

void Arg::dump(PrintStream& out) const{    switch (m_kind) {    case Invalid:        out.print("<invalid>");        return;    case Tmp:        out.print(tmp());        return;    case Imm:        out.print("$", m_offset);        return;    case Imm64:        out.printf("$0x%llx", static_cast<long long unsigned>(m_offset));        return;    case Addr:        if (offset())            out.print(offset());        out.print("(", base(), ")");        return;    case Index:        if (offset())            out.print(offset());        out.print("(", base(), ",", index());        if (scale() != 1)            out.print(",", scale());        out.print(")");        return;    case Stack:        if (offset())            out.print(offset());        out.print("(", pointerDump(stackSlot()), ")");        return;    case CallArg:        if (offset())            out.print(offset());        out.print("(callArg)");        return;    case RelCond:        out.print(asRelationalCondition());        return;    case ResCond:        out.print(asResultCondition());        return;    case DoubleCond:        out.print(asDoubleCondition());        return;    case Special:        out.print(pointerDump(special()));        return;    }    RELEASE_ASSERT_NOT_REACHED();}
开发者ID:srinivas-kakarla,项目名称:WebKitForWayland,代码行数:54,


示例24: unsetspec

static voidunsetspec(struct tbl *vp){	/*	 * AT&T ksh man page says OPTIND, OPTARG and _ lose special	 * meaning, but OPTARG does not (still set by getopts) and _ is	 * also still set in various places. Don't know what AT&T does	 * for HISTSIZE, HISTFILE. Unsetting these in AT&T ksh does not	 * loose the 'specialness': IFS, COLUMNS, PATH, TMPDIR	 */	switch (special(vp->name)) {#ifdef __OS2__	case V_BEGINLIBPATH:	case V_ENDLIBPATH:	case V_LIBPATHSTRICT:		setextlibpath(vp->name, "");		return;#endif#if HAVE_PERSISTENT_HISTORY	case V_HISTFILE:		sethistfile(NULL);		return;#endif	case V_IFS:		set_ifs(TC_IFSWS);		break;	case V_PATH:		afree(path, APERM);		strdupx(path, def_path, APERM);		/* clear tracked aliases */		flushcom(true);		break;#ifndef MKSH_NO_CMDLINE_EDITING	case V_TERM:		x_initterm(null);		return;#endif	case V_TMPDIR:		/* should not become unspecial */		if (tmpdir) {			afree(tmpdir, APERM);			tmpdir = NULL;		}		break;	case V_LINENO:	case V_RANDOM:	case V_SECONDS:	case V_TMOUT:		/* AT&T ksh leaves previous value in place */		unspecial(vp->name);		break;	}}
开发者ID:tomgrean,项目名称:mksh,代码行数:54,


示例25: main

intmain (void){  tests_start_mpfr ();  special ();  test_generic (2, 100, 2);  tests_end_mpfr ();  return 0;}
开发者ID:119,项目名称:aircam-openwrt,代码行数:11,


示例26: main

intmain (void){  test (ecvt_tests, ecvt, "ecvt");  test (fcvt_tests, fcvt, "fcvt");  test_r (ecvt_tests, ecvt_r, "ecvt_r");  test_r (fcvt_tests, fcvt_r, "fcvt_r");  special ();  return error_count;}
开发者ID:ZoneMo,项目名称:Learn-SourceCode,代码行数:11,



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


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