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

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

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

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

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

示例1: CalcMaxPasteRange

/** * Calculate how far tiles can be altered beyond a given paste area bound. * * When pasting, some tiles around the paste area may be altered (during terraforming). * The function return the limit on how far it can happen. Calculations are not exact, * the goal is to give a safe range that will include any possible case. * * Result is based on current and desired heights at neighbour corners of the paste area. * * @param curr_h1 Current height on the first corner. * @param curr_h2 Current height on the second corner. * @param new_h1 Desired height on the first corner. * @param new_h2 Desired height on the second corner. * @param length Distance (in tiles) between corners. * @return How far (in tiles) terraforming can reach beyond the given bound. * * @pre Tile heights and the length can't create an impossible layout, heights can't differ *      too much: /n *      <tt> Delta(curr_h1, curr_h2) <= length </tt> /n *      <tt> Delta(new_h1, new_h2) <= length </tt> /n * * @see CopyPasteAreasMayColide */static uint CalcMaxPasteRange(uint curr_h1, uint new_h1, uint curr_h2, uint new_h2, uint length){	uint min_curr_h = CeilDiv(max<int>(curr_h1 + curr_h2 - length, 0), 2);	uint max_curr_h = min((curr_h1 + curr_h2 + length) / 2, MAX_TILE_HEIGHT);	uint min_new_h = CeilDiv(max<int>(new_h1 + new_h2 - length, 0), 2);	uint max_new_h = min((new_h1 + new_h2 + length) / 2, MAX_TILE_HEIGHT);	return max(Delta(max_new_h, min_curr_h), Delta(max_curr_h, min_new_h));}
开发者ID:koreapyj,项目名称:openttd-yapp,代码行数:32,


示例2: simdmaxbitsd1_length

/* maxbit over |length| integers with provided initial value */uint32_t simdmaxbitsd1_length(uint32_t initvalue, const uint32_t * in,                uint32_t length) {    __m128i newvec;    __m128i oldvec;    __m128i initoffset;    __m128i accumulator;    const __m128i *pin;    uint32_t tmparray[4];    uint32_t k = 1;    uint32_t acc;    assert(length > 0);    pin = (const __m128i *)(in);    initoffset = _mm_set1_epi32(initvalue);    switch (length) {      case 1:        newvec = _mm_set1_epi32(in[0]);        break;      case 2:        newvec = _mm_setr_epi32(in[0], in[1], in[1], in[1]);        break;      case 3:        newvec = _mm_setr_epi32(in[0], in[1], in[2], in[2]);        break;      default:        newvec = _mm_loadu_si128(pin);        break;    }    accumulator = Delta(newvec, initoffset);    oldvec = newvec;    /* process 4 integers and build an accumulator */    while (k * 4 + 4 <= length) {        newvec = _mm_loadu_si128(pin + k);        accumulator = _mm_or_si128(accumulator, Delta(newvec, oldvec));        oldvec = newvec;        k++;    }    /* extract the accumulator as an integer */    _mm_storeu_si128((__m128i *)(tmparray), accumulator);    acc = tmparray[0] | tmparray[1] | tmparray[2] | tmparray[3];    /* now process the remaining integers */    for (k *= 4; k < length; k++)        acc |= in[k] - (k == 0 ? initvalue : in[k - 1]);    /* return the number of bits */    return bits(acc);}
开发者ID:NaveenSigmoid,项目名称:simdcomp,代码行数:52,


示例3: test1

unsigned test1(unsigned sx,unsigned sy) {  AlphaFunc func1(sx,sy);  DrawAlgo::LineAlphaFunc<UInt> func2(sx,sy);  unsigned ret=0;  for(unsigned d=0; d<=sx ;d++)    {     Replace_max(ret,Delta(func1.alpha0(d,sx,sy),func2.alpha0(d,sx,sy)));     Replace_max(ret,Delta(func1.alpha1(d,sx,sy),func2.alpha1(d,sx,sy)));    }  return ret; }
开发者ID:SergeyStrukov,项目名称:CCore-2-xx,代码行数:15,


示例4: simdmaxbitsd1

/* maxbit over 128 integers (SIMDBlockSize) with provided initial value */uint32_t simdmaxbitsd1(uint32_t initvalue, const uint32_t * in) {    __m128i  initoffset = _mm_set1_epi32 (initvalue);    const __m128i* pin = (const __m128i*)(in);    __m128i newvec = _mm_loadu_si128(pin);    __m128i accumulator = Delta(newvec , initoffset);    __m128i oldvec = newvec;    uint32_t k = 1;    for(; 4*k < SIMDBlockSize; ++k) {        newvec = _mm_loadu_si128(pin+k);        accumulator = _mm_or_si128(accumulator,Delta(newvec , oldvec));        oldvec = newvec;    }    initoffset = oldvec;    return maxbitas32int(accumulator);}
开发者ID:NaveenSigmoid,项目名称:simdcomp,代码行数:16,


示例5: solReal

void TPZArtDiff::ContributeImplDiff(int dim, TPZFMatrix<REAL> &jacinv, TPZVec<FADREAL> &sol, TPZVec<FADREAL> &dsol, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, REAL weight,  REAL timeStep, REAL deltaX){    TPZVec<STATE> solReal(sol.NElements());    int i;    for(i = 0; i < sol.NElements(); i++)		solReal[i] = sol[i].val();	    REAL delta = Delta(deltaX, solReal);    REAL constant = /*-*/ delta * weight * timeStep;	    TPZVec<TPZVec<FADREAL> > TauDiv;	    PrepareFastDiff(dim, jacinv, sol, dsol, TauDiv);	    TPZVec<FADREAL> Diff;    TPZVec<REAL> gradv(dim);	    int j, k, l;    int nstate = dim + 2;    int neq = sol[0].size();    int nshape = neq/nstate;	    for(l=0;l<nshape;l++)	{		for(k=0;k<dim;k++)			gradv[k] = dsol[k].dx/*fastAccessDx*/(/*k+*/l*nstate);// always retrieving this information from the first state variable...		ODotOperator(gradv, TauDiv, Diff);		for(i=0;i<nstate;i++)		{			ef(i+l*nstate,0) += constant * Diff[i].val();			for(j=0;j<neq;j++)				ek(i+l*nstate, j) -= constant * Diff[i].dx/*fastAccessDx*/(j);		}	}}
开发者ID:labmec,项目名称:neopz,代码行数:35,


示例6: Bp

TSIL_COMPLEX Bp (TSIL_REAL X, TSIL_REAL Y, TSIL_COMPLEX S, TSIL_REAL QQ){  if (X < TSIL_TOL) {    TSIL_Warn("Bp", "B(x',y) is undefined for x=0.");    return TSIL_Infinity;  }  if (TSIL_CABS(1.0L - S/(X+Y+2.0L*TSIL_SQRT(X*Y))) < TSIL_TOL) {    TSIL_Warn("Bp", "B(x',y) is undefined at s = (sqrt(x) + sqrt(y))^2.");    return TSIL_Infinity;  }  if (TSIL_CABS(S) < TSIL_TOL) {    if (TSIL_FABS(1.0L - X/Y) < TSIL_TOL)      return (-0.5L/X);    else      return 1.0L/(Y-X) + Y*TSIL_LOG(X/Y)/((Y-X)*(Y-X));  }  if (TSIL_CABS(1.0L - (X + Y - 2.0L*TSIL_SQRT(X*Y))/S) < TSIL_TOL)     return (1.0L - TSIL_SQRT(Y/X) +0.5L*TSIL_LOG(Y/X))/(X + Y - 2.0L*TSIL_SQRT(X*Y));  else    return ((X-Y-S)*B(X,Y,S,QQ) + (X+Y-S)*TSIL_LOG(X/QQ) 	    -2.0L*A(Y,QQ) + 2.0L*(S-X))/Delta(S,X,Y);}
开发者ID:pathron,项目名称:softsusy,代码行数:25,


示例7: Delta

void TPZArtDiff::ContributeFastestImplDiff_dim(TPZFMatrix<REAL> &jacinv, TPZVec<STATE> &sol, TPZFMatrix<STATE> &dsol, TPZFMatrix<REAL> &phi, TPZFMatrix<REAL> &dphi, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, REAL weight, REAL timeStep, REAL deltaX){    REAL delta = Delta(deltaX, sol);    REAL constant = /*-*/ weight * delta * timeStep;    REAL buff;	    TPZVec<TPZVec<STATE> > TauDiv;    TPZVec<TPZDiffMatrix<STATE> > dTauDiv;	    PrepareFastestDiff<dim>( jacinv, sol, dsol, phi, dphi, TauDiv, dTauDiv);	    int i, j, k, l;    int nshape = dphi.Cols();    int nstate = dim + 2;    int neq = nstate * nshape;	    // ODotProduct speeded up	    for(l=0;l<nshape;l++)		for(i=0;i<nstate;i++)			for(k=0;k<dim;k++)			{				buff = dphi(k,l) * constant;				ef(i+l*nstate,0) += buff * TauDiv[k][i];				for(j=0;j<neq;j++)					ek(i+l*nstate,j) -= buff * dTauDiv[k](i,j);			}}
开发者ID:labmec,项目名称:neopz,代码行数:28,


示例8: BMsubst

int BMsubst(char *S, char *T){    int n =  mstrlen(S), m =  mstrlen(T), i, k;    int **del = Delta(S);    k = i = n - 1;    for (k = n - 1; k < m; k += del[n - i - 1][(int) T[k]], i = n - 1)    {        while (T[k] == S[i])        {            if (i == 0)            {                for (i = 0; i < n; ++i)                {                    free(del[i]);                }                free(del);                return k;            }            --i;            --k;        }    }    for (i = 0; i < n; i++)    {        free(del[i]);    }    free(del);    return (k<m)? k:m;}
开发者ID:BuDashka,项目名称:UniWork_course1,代码行数:29,


示例9: Delta

ulen ScrollShape::delta(uCoord delta,uCoord len,uCoord dlen) const {  if( total<=page ) return 0;    uCoord ext=2*dlen;    if( len<=ext ) return 0;    len-=ext;    if( len<=dlen ) return 0;    if( Delta(total,dlen,len)<page ) return Delta(total,delta,len);    return Delta(total-page,delta,len-dlen); }
开发者ID:SergeyStrukov,项目名称:CCore,代码行数:16,


示例10: autonomous

task autonomous(){    StartTask(descore);    StartTask(velocitycalculator);    if(SensorValue[J1]) // blue    {        if(SensorValue[J2]) //normal        {            // RAM            ArmWall();            ForwardTillStop(127);        }        else // oppo        {            Gamma();        }    }    else // red    {        if(SensorValue[J2]) // normal        {            Beta();        }        else // oppo        {            Delta();        }    }    StopTask(velocitycalculator);}
开发者ID:Skeer,项目名称:5000A,代码行数:35,


示例11: if

// Update cameravoid _Camera::Update(double FrameTime) {	LastPosition = Position;	// Cap distance	if(TargetPosition.z <= 1.0f)		TargetPosition.z = 1.0f;	else if(TargetPosition.z >= Far)		TargetPosition.z = Far;	// Update position	glm::vec2 Delta(TargetPosition - Position);	if(std::abs(Delta.x) > 0.01f)		Position.x += Delta.x / UpdateDivisor;	else		Position.x = TargetPosition.x;	if(std::abs(Delta.y) > 0.01f)		Position.y += Delta.y / UpdateDivisor;	else		Position.y = TargetPosition.y;	// Update distance	float DeltaZ = TargetPosition.z - Position.z;	if(std::abs(DeltaZ) > 0.01f)		Position.z += DeltaZ / UpdateDivisor;	else		Position.z = TargetPosition.z;}
开发者ID:jazztickets,项目名称:ae,代码行数:29,


示例12: NPFDistanceTrack

/** * Calculates the minimum distance traveled to get from t0 to t1 when only * using tracks (ie, only making 45 degree turns). Returns the distance in the * NPF scale, ie the number of full tiles multiplied by NPF_TILE_LENGTH to * prevent rounding. */static uint NPFDistanceTrack(TileIndex t0, TileIndex t1){	const uint dx = Delta(TileX(t0), TileX(t1));	const uint dy = Delta(TileY(t0), TileY(t1));	const uint straightTracks = 2 * min(dx, dy); // The number of straight (not full length) tracks	/* OPTIMISATION:	 * Original: diagTracks = max(dx, dy) - min(dx,dy);	 * Proof:	 * (dx+dy) - straightTracks  == (min + max) - straightTracks = min + max - 2 * min = max - min */	const uint diagTracks = dx + dy - straightTracks; // The number of diagonal (full tile length) tracks.	/* Don't factor out NPF_TILE_LENGTH below, this will round values and lose	 * precision */	return diagTracks * NPF_TILE_LENGTH + straightTracks * NPF_TILE_LENGTH * STRAIGHT_TRACK_LENGTH;}
开发者ID:andrew889,项目名称:OpenTTD,代码行数:22,


示例13: taylorSample

/** An sample for taylor expansion of logdet(X). */void taylorSample() {  std::string ans;  char rowChar[5];  int rowTmp = ROW;  sprintf(rowChar, "%d", rowTmp);  std::string row = rowChar;  // Initialize the matrices.  symbolic_matrix_type X("X", ROW, COL);  symbolic_matrix_type X0("X0", ROW, COL);  symbolic_matrix_type Delta("(X-X0)", ROW, COL);      AMD::SymbolicScalarMatlab a2("1/2!");  AMD::SymbolicScalarMatlab a3("1/3!");   SymbolicSMFunc r2(a2,ROW,COL);  SymbolicSMFunc r3(a3,ROW, COL);  // Initialize MatrixMatrixFunction.   SymbolicMMFunc fX(X, false);  SymbolicMMFunc fX0(X0, false);  SymbolicMMFunc fDelta(Delta, true);  // Compute Taylor series iteratively.   SymbolicSMFunc f0 =  logdet(fX0);  SymbolicSMFunc f1 = trace(fDelta * transpose(*f0.derivativeFuncVal));  SymbolicSMFunc f2 = trace(fDelta * transpose(*f1.derivativeFuncVal));  SymbolicSMFunc f3 = trace(fDelta * transpose(*f2.derivativeFuncVal));  // Taylor Expansion.   SymbolicSMFunc func = f0 + f1 + r2*f2 + r3*f3;  std::cout<<"The first 4 terms of Taylor Expansion for logdet(X) around X0 is:";  std::cout << std::endl;  std::cout << func.functionVal.getString() << std::endl;}
开发者ID:yyzreal,项目名称:AMD,代码行数:36,


示例14: NS_ENSURE_ARG_POINTER

/* readonly attribute float delta; */NS_IMETHODIMPnsDOMSimpleGestureEvent::GetDelta(double *aDelta){    NS_ENSURE_ARG_POINTER(aDelta);    *aDelta = Delta();    return NS_OK;}
开发者ID:hwine,项目名称:test-mmc,代码行数:8,


示例15: min

/** * Moves some cargo from one designation to another. You can only move * between adjacent designations. E.g. you can keep cargo that was * previously reserved (MTA_LOAD) or you can mark cargo to be transferred * that was previously marked as to be delivered, but you can't reserve * cargo that's marked as to be delivered. */uint VehicleCargoList::Reassign(uint max_move, MoveToAction from, MoveToAction to){	max_move = min(this->action_counts[from], max_move);	assert(Delta((int)from, (int)to) == 1);	this->action_counts[from] -= max_move;	this->action_counts[to] += max_move;	return max_move;}
开发者ID:kestereverts,项目名称:openttd-ijpack,代码行数:15,


示例16: PChannel

TInt DBMLChannel::RequestTimerStampOverhead()	{	TBMTicks t1 = PChannel()->TimerStamp();	TBMTicks t2 = PChannel()->TimerStamp();	iTime = Delta(t1, t2);	NKern::ThreadRequestSignal(&iInterruptThread->iNThread);	return KErrNone;	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:8,


示例17: DragAlphaBody

   double DragAlphaBody(double a)   {      double delta = Delta(a);      double eta = Eta(a);      double c1 = 2 * delta * sqr(a);      double c2 = 3.6 * cube(a) * eta * ((1.36 * ltr) - (0.55 * ln)) /         (PI * db);      return c1 + c2;   }
开发者ID:jahales,项目名称:BIRD,代码行数:10,


示例18: Delta

bool RA::CD2D(const Dim2::Vector &s2, const Dim2::Vector &v2, int D, int B){  if (v2.iszero() && s2.mod < D)    return true;  double delta = Delta(s2, v2, D);  double phi = Phi(s2, v2, D, 1);  if (!v2.iszero() && delta >= 0 && phi >= B)    return true;  return false;}
开发者ID:TCASP,项目名称:TCASP,代码行数:10,


示例19: U64

    // Hash key of the FEN    Key Zob::compute_fen_key (const string &fen, bool c960) const    {        if (fen.empty ()) return U64 (0);        Key fen_key = U64 (0);        File king[CLR_NO] = {F_NO};        istringstream sfen (fen);        uint8_t ch;        sfen >> noskipws;        uint32_t idx;        Square s = SQ_A8;        while ((sfen >> ch) && !isspace (ch))        {            if (isdigit (ch))            {                s += Delta (ch - '0'); // Advance the given number of files            }            else if (isalpha (ch) && (idx = CharPiece.find (ch)) != string::npos)            {                Piece p = Piece (idx);                fen_key ^= _.psq_k[_color (p)][_ptype (p)][s];                ++s;            }            else if (ch == '/')            {                s += DEL_SS;            }        }        sfen >> ch;        if ('w' == ch) fen_key ^= _.mover_side;        sfen >> ch;        if (c960)        {            while ((sfen >> ch) && !isspace (ch))            {                Color c = isupper (ch) ? WHITE : BLACK;                uint8_t sym = tolower (ch);                if ('a' <= sym && sym <= 'h')                {                    fen_key ^= _.castle_right[c][(king[c] < to_file (sym)) ? CS_K : CS_Q];                }                else                {                    return U64 (0);                }            }        }        else        {            while ((sfen >> ch) && !isspace (ch))
开发者ID:Kikirrus,项目名称:DON,代码行数:55,


示例20: Delta

void WalkRegion::setPos(int x, int y) {	// Calculate the difference between old and new position	Vertex Delta(x - _position.x, y - _position.y);	// Move all the nodes	for (uint i = 0; i < _nodes.size(); i++)		_nodes[i] += Delta;	// Move regions	Region::setPos(x, y);}
开发者ID:dergunov,项目名称:scummvm,代码行数:11,


示例21: OnTick

	virtual void OnTick()	{		/* Scroll up newsmessages from the bottom in steps of 4 pixels */		int y = max(this->top - 4, _screen.height - this->height - this->status_height - this->chat_height);		if (y == this->top) return;		if (this->viewport != NULL) this->viewport->top += y - this->top;		int diff = Delta(this->top, y);		this->top = y;		SetDirtyBlocks(this->left, this->top, this->left + this->width, this->top + this->height + diff);	}
开发者ID:oshepherd,项目名称:openttd-progsigs,代码行数:13,


示例22: GetAvailableVideoMode

static void GetAvailableVideoMode(uint *w, uint *h){	/* No video modes, so just try it and see where it ends */	if (_num_resolutions == 0) return;	/* is the wanted mode among the available modes? */	for (int i = 0; i != _num_resolutions; i++) {		if (*w == _resolutions[i].width && *h == _resolutions[i].height) return;	}	/* use the closest possible resolution */	int best = 0;	uint delta = Delta(_resolutions[0].width, *w) * Delta(_resolutions[0].height, *h);	for (int i = 1; i != _num_resolutions; ++i) {		uint newdelta = Delta(_resolutions[i].width, *w) * Delta(_resolutions[i].height, *h);		if (newdelta < delta) {			best = i;			delta = newdelta;		}	}	*w = _resolutions[best].width;	*h = _resolutions[best].height;}
开发者ID:Ayutac,项目名称:OpenTTD,代码行数:23,


示例23: RK4_adaptive_step

double RK4_adaptive_step(               // returns adapted time step    Matrix<double,1>& x,                // solution vector    double dt,                          // initial time step    Matrix<double,1> flow(Matrix<double,1>&),  // derivative vector    double accuracy)                    // desired accuracy{    // from Numerical Recipes    const double SAFETY = 0.9, PGROW = -0.2, PSHRINK = -0.25,                 ERRCON = 1.89E-4, TINY = 1.0E-30;    int n = x.size();    Matrix<double,1> scale = flow(x), x_half(n), Delta(n);    for (int i = 0; i < n; i++)        scale[i] = abs(x[i]) + abs(scale[i] * dt) + TINY;    double error = 0;    while (true) {        dt /= 2;        x_half = x;        RK4_step(x_half, dt, flow);        RK4_step(x_half, dt, flow);        dt *= 2;        Matrix<double,1> x_full = x;        RK4_step(x_full, dt, flow);        for (int i = 0; i < n; i++)            Delta[i] = x_half[i] - x_full[i];        error = 0;        for (int i = 0; i < n; i++)            error = max(abs(Delta[i] / scale[i]), error);        error /= accuracy;        if (error <= 1)            break;        double dt_temp = SAFETY * dt * pow(error, PSHRINK);        if (dt >= 0)            dt = max(dt_temp, 0.1 * dt);        else            dt = min(dt_temp, 0.1 * dt);        if (abs(dt) == 0.0) {            cerr << " step size underflow" << endl;            exit(1);        }    }    if (error > ERRCON)        dt *= SAFETY * pow(error, PGROW);    else        dt *= 5.0;    for (int i = 0; i < n; i++)        x[i] = x_half[i] + Delta[i] / 15.0;    return dt;}
开发者ID:BLesnau,项目名称:CSE872Project,代码行数:48,


示例24: generate_steps

void generate_steps(const GameState& gs, std::vector<Delta> *steps){  const Board& not_frozen = ~frozen_pieces(gs, gs.get_color());  for (unsigned int dir_empty = NORTH; dir_empty < num_directions(); ++dir_empty) {    Board pieces_with_step = adj_step(gs, gs.get_color(), dir_empty) & not_frozen;    assert((pieces_with_step & gs.get_color_board(gs.get_color())) == pieces_with_step);    while(!pieces_with_step.is_empty()) {      uint8_t mobile_idx = pieces_with_step.idx_and_reset();      assert(gs.get_all_const().contains(mobile_idx));      steps->push_back(Delta(step_from_gs(gs, mobile_idx, dir_empty)));    }  }}
开发者ID:kwmsmith,项目名称:bot-rhadamanthus,代码行数:17,


示例25: generate_pushes

void generate_pushes(const GameState& gs, std::vector<Delta> *pushes){  const uint8_t pushing_color = gs.get_color();  const uint8_t pushed_color = other_color(gs.get_color());  const Board& pushing_mobile = ~frozen_pieces(gs, gs.get_color());  Board pushed_with_adj_empty[4];  // The body of generate_pushes() takes the perspective of the pushed piece.    // dir_pushed_from is the direction from which the pushing piece comes from.  // dir_pushed is the direction the pushed piece is pushed to.  for (unsigned int dir = NORTH; dir < num_directions(); ++dir) {    pushed_with_adj_empty[dir] = adj_empty(gs, pushed_color, dir);  }  for (unsigned int dir_pushed_from = NORTH; dir_pushed_from < num_directions(); ++dir_pushed_from) {    // the mobile pushing pieces with an adjacent weaker piece.    // We use the opp_dir(dir_pushed_from) here since we are talking about the pushing piece.    const Board& pushing_pieces_with_adj_lt =       adj_enemy_lt(gs, pushing_color, opp_dir(dir_pushed_from)) & pushing_mobile;    for (unsigned int dir_pushed = NORTH; dir_pushed < num_directions(); ++dir_pushed) {      if (dir_pushed_from == dir_pushed) continue;      // TODO: Try and make symmetric with generate_pulls() -- simplify inner loop here...      Board pushing_pieces =         is_adjacent(pushing_pieces_with_adj_lt, pushed_with_adj_empty[dir_pushed],            opp_dir(dir_pushed_from));      Board pushed_pieces =         is_adjacent(pushed_with_adj_empty[dir_pushed], pushing_pieces_with_adj_lt, dir_pushed_from);      while(!pushed_pieces.is_empty()) {        assert(!pushing_pieces.is_empty());        uint8_t pushed_idx = pushed_pieces.idx_and_reset();        uint8_t pusher_idx = pushing_pieces.idx_and_reset();        assert(gs.get_all_const().contains(pushed_idx));        assert(gs.get_all_const().contains(pusher_idx));        pushes->push_back(Delta(step_from_gs(gs, pushed_idx, dir_pushed),              step_from_gs(gs, pusher_idx, opp_dir(dir_pushed_from))));      }    }  }}
开发者ID:kwmsmith,项目名称:bot-rhadamanthus,代码行数:46,


示例26: main

int main(int argc, char* argv[ ]) {	double v, w, x, y, z;	double timer = omp_get_wtime();	int thread_count = 1;	if (argc>1)		thread_count = strtol(argv[1], NULL, 10);#	pragma omp parallel num_threads(thread_count)  	{#		pragma omp sections		{#			pragma omp section			{				v = Alpha( );				printf("v = %lf/n", v);			}#			pragma omp section			{				w = Beta( );				printf("w = %lf/n", w);			}		}#		pragma omp sections		{#			pragma omp section			{				x = Gamma(v, w);				printf("x = %lf/n", x);			}#			pragma omp section			{				y = Delta( );				printf("y = %lf/n", y);			}		}	}	z = Epsilon(x, y);	printf("z = %lf/n", z);	timer = omp_get_wtime() - timer;	printf("timer = %lf/n", timer);	return 0;}
开发者ID:mwleeds,项目名称:cs403,代码行数:46,


示例27: while

	bool PointsGroup::CheckAdjacence(DoubleList* list) const	{		auto cit = list->begin();		if (list->size() < 2) return true;		double max = -DBL_MAX, min = DBL_MAX;		while (cit != list->end())		{			if(max < *cit)				max = *cit;			if(min > *cit)				min = *cit;			cit++;		}		double delta = std::fabs((max - min)/(max + min));				return delta < Delta();	}
开发者ID:dailypips,项目名称:prism,代码行数:17,


示例28: propertylist

SimplePropertySet<string, double> propertylist() {	SimplePropertySet<string, double> result;	result.add (Property<string, double> ("Option Value", Price() ) );	result.add (Property<string, double> ("Delta",Delta() ) );	result.add (Property<string, double> ("Gamma",Gamma() ) );	result.add (Property<string, double> ("Vega",Vega() ) );	result.add (Property<string, double> ("Vega",Theta() ) );	result.add (Property<string, double> ("Rho",Rho() ) );	result.add (Property<string, double> ("Cost of Carry",Coc() ) );										// Cost of carry		cout << "counbt " << result.Count();	return result;}
开发者ID:JinhuiAchilles,项目名称:C_Github,代码行数:17,



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


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