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


C++ Forward函数代码示例

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


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

示例1: while

Token LexicalAnalysis::GetKeywordOrIdentifier(string& _string)
{
	while (IsAlphaOrUnderline(*m_bufferMoved))
	{
		_string += *m_bufferMoved;
		if (!Forward())
			return ERROR;
	}
	while (IsAlphaOrNumberOrUnderline(*m_bufferMoved))
	{
		_string += *m_bufferMoved;
		if (!Forward())
			return ERROR;
	}
	for (int i = 0; i < m_keywordLen; ++i)
	{
		if (_string == m_keyword[i])
		{
			//the word is a keyword
			return (Token)i;
		}
	}

	//the word is an id
	return ID;
}
开发者ID:NinjaRhyme,项目名称:LexicalAnalysis,代码行数:26,代码来源:LexicalAnalysis.cpp

示例2: ResetParameter

void FFN<
LayerTypes, OutputLayerType, InitializationRuleType, PerformanceFunction
>::Predict(arma::mat& predictors, arma::mat& responses)
{
  deterministic = true;

  arma::mat responsesTemp;
  ResetParameter(network);
  Forward(arma::mat(predictors.colptr(0), predictors.n_rows, 1, false, true),
      network);
  OutputPrediction(responsesTemp, network);

  responses = arma::mat(responsesTemp.n_elem, predictors.n_cols);
  responses.col(0) = responsesTemp.col(0);

  for (size_t i = 1; i < predictors.n_cols; i++)
  {
    Forward(arma::mat(predictors.colptr(i), predictors.n_rows, 1, false, true),
        network);

    responsesTemp = arma::mat(responses.colptr(i), responses.n_rows, 1, false,
        true);
    OutputPrediction(responsesTemp, network);
    responses.col(i) = responsesTemp.col(0);
  }
}
开发者ID:GYengera,项目名称:mlpack,代码行数:26,代码来源:ffn_impl.hpp

示例3: WdeWriteSymInfo

void WdeWriteSymInfo( WdeInfoStruct *is, bool same_as_last, char *s )
{
    bool    dirty;
    OBJPTR  obj;

    if( is->res_info->hash_table != NULL ) {
        dirty = WdeIsHashTableTouched( is->res_info->hash_table );
        if( dirty && (obj = GetMainObject()) != NULL ) {
            Forward( obj, RESOLVE_SYMBOL, NULL, NULL );
            Forward( obj, RESOLVE_HELPSYMBOL, NULL, NULL );   /* JPK */
        }
        if( !same_as_last || dirty ) {
            WdeAddSymbolsToComboBox( is->res_info->hash_table,
                                     WdeInfoWindow, IDB_INFO_IDSTR );
            WdeUntouchHashTable( is->res_info->hash_table );
        }
    } else {
        if( !same_as_last ) {
            SendDlgItemMessage( WdeInfoWindow, IDB_INFO_IDSTR, CB_RESETCONTENT, 0, 0 );
        }
    }

    if( s != NULL ) {
        WdeSetComboWithStr( s, WdeInfoWindow, IDB_INFO_IDSTR );
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:26,代码来源:wdeinfo.c

示例4: RedIsolationPickupAutonomous

void RedIsolationPickupAutonomous()
{
  SensorValue[Gyroscope] = 0;
  StartTask(KeepArmInPosition);

  armPosition = minArm;
  Intake(127);
  Forward(45, 125, "none");
  StopMoving();


  Backward(127, 90, "none");
  Intake(0);
  StopMoving();

  TurnLeftDegrees(40);

  armPosition = midGoalHeight;
  wait10Msec(70);
  Intake(127);
  Forward(100, 60, "none");
  StopMoving();
  armPosition = midGoalHeight - 100;
  wait10Msec(50);
  StopTask(KeepArmInPosition);

  StopArm();

  StartTask(StayInPosition);
  wait10Msec(500);
  Intake(0);
  wait10Msec(1000);
  StopTask(StayInPosition);
}
开发者ID:joseph-zhong,项目名称:Robotics,代码行数:34,代码来源:1492xBot.c

示例5: GoStart

//Go to the start
void GoStart(void)
{
    int count=0;
    //turn left twice
    LeftTurn();
    LeftTurn();
    //go back 8 squares
    while(count<8)
    {
        //increment counters
        count++;
        Forward();
    }
    //reset current count back to zero
    count=0;
    //turn left
    LeftTurn();
    //go forward 3 squares you are at start
    while(count<2)
    {
        //increment counters
        count++;
        Forward();
    }
     	motor[motorB]=0;
			motor[motorC]=0;
      wait1Msec(1000);
}
开发者ID:c15314356,项目名称:Robotics_Project,代码行数:29,代码来源:project_xv6.c

示例6: Domain

Vector ADFun<Base>::ForOne(const Vector &x, size_t j)
{	size_t j1;

	size_t n = Domain();
	size_t m = Range();

	// check Vector is Simple Vector class with Base type elements
	CheckSimpleVector<Base, Vector>();

	CPPAD_ASSERT_KNOWN(
		x.size() == n,
		"ForOne: Length of x not equal domain dimension for f"
	);
	CPPAD_ASSERT_KNOWN(
		j < n,
		"ForOne: the index j is not less than domain dimension for f"
	);

	// point at which we are evaluating the second partials
	Forward(0, x);

	// direction in which are are taking the derivative
	Vector dx(n);
	for(j1 = 0; j1 < n; j1++)
		dx[j1] = Base(0);
	dx[j] = Base(1);

	// dimension the return value
	Vector dy(m);

	// compute the return value
	dy = Forward(1, dx);

	return dy;
}
开发者ID:iagomosqueira,项目名称:FLasher,代码行数:35,代码来源:for_one.hpp

示例7: Domain

Vector ADFun<Base>::Hessian(const Vector &x, size_t i)
{	size_t j;
	size_t k;
	size_t l;

	size_t n = Domain();
	size_t m = Range();

	// check Vector is Simple Vector class with Base type elements
	CheckSimpleVector<Base, Vector>();

	CppADUsageError(
		x.size() == n,
		"Hessian: length of x not equal domain dimension for f"
	); 
	CppADUsageError(
		i < m,
		"Hessian: index i is not less than range dimension for f"
	);

	// point at which we are evaluating the Hessian
	Forward(0, x);

	// define the return value
	Vector hes(n * n);

	// direction vector for calls to forward
	Vector u(n);
	for(j = 0; j < n; j++)
		u[j] = Base(0);

	// direction vector for calls to reverse
	Vector w(m);
	for(l = 0; l < m; l++)
		w[l] = Base(0);
	w[i] = Base(1);

	// location for return values from Reverse
	Vector ddw(n * 2);

	// loop over forward direstions
	for(j = 0; j < n; j++)
	{	// evaluate partials of entire function w.r.t. j-th coordinate
		u[j] = Base(1);
		Forward(1, u);
		u[j] = Base(0);

		// evaluate derivative of partial corresponding to F_i
		ddw = Reverse(2, w);

		// return desired components
		for(k = 0; k < n; k++)
			hes[k * n + j] = ddw[k * 2 + 1];
	}
		
	return hes;
}
开发者ID:cran,项目名称:RMC,代码行数:57,代码来源:hessian.hpp

示例8: RedInteractionCurvyAutonomous

void RedInteractionCurvyAutonomous()
{
  Intake(127);
  Forward(127, 40, "none");
  Intake(0);
  VariableMove(20, 127, 80);
  SensorValue[Gyroscope] = 0;
  Forward(127, 80, "none");
  StopMoving();
  StartTask(StayInPosition);
  wait10Msec(1500);
  StopTask(StayInPosition);
}
开发者ID:joseph-zhong,项目名称:Robotics,代码行数:13,代码来源:1492xBot.c

示例9: BSF

typeMoveList *MyPositionalGain(typePos *Position, typeMoveList *List, int av)
{
    uint64 empty = ~Position->OccupiedBW, U, T;
    int to, sq;
    typeMoveList *sm, *p, *q;
    int move;
    sm = List;
    for (U = ForwardShift(BitboardMyP & SecondSixthRanks) & empty; U; BitClear(sq, U))
    {
        to = BSF(U);
        if (OnThirdRank(to) && Position->sq[Forward(to)] == 0)
            AddGain(List, (Backward(to) << 6) | Forward(to), EnumMyP, Forward(to));
        AddGain(List, (Backward(to) << 6) | to, EnumMyP, to);
    }
    for (U = BitboardMyN; U; BitClear(sq, U))
    {
        sq = BSF(U);
        T = AttN[sq] & empty;
        AddGainTo(T, EnumMyN);
    }
    for (U = BitboardMyBL; U; BitClear(sq, U))
    {
        sq = BSF(U);
        T = AttB(sq) & empty;
        AddGainTo(T, EnumMyBL);
    }
    for (U = BitboardMyBD; U; BitClear(sq, U))
    {
        sq = BSF(U);
        T = AttB(sq) & empty;
        AddGainTo(T, EnumMyBD);
    }
    for (U = BitboardMyR; U; BitClear(sq, U))
    {
        sq = BSF(U);
        T = AttR(sq) & empty;
        AddGainTo(T, EnumMyR);
    }
    for (U = BitboardMyQ; U; BitClear(sq, U))
    {
        sq = BSF(U);
        T = AttQ(sq) & empty;
        AddGainTo(T, EnumMyQ);
    }
    sq = MyKingSq;
    T = AttK[sq] & empty &(~OppAttacked);
    AddGainTo(T, EnumMyK);
    List->move = 0;
    Sort;
    return List;
}
开发者ID:ZirconiumX,项目名称:Firenzina,代码行数:51,代码来源:move_gen.c

示例10: Domain

Vector ADFun<Base>::Hessian(const Vector &x, const Vector &w)
{	size_t j;
	size_t k;

	size_t n = Domain();

	// check Vector is Simple Vector class with Base type elements
	CheckSimpleVector<Base, Vector>();

	CPPAD_ASSERT_KNOWN(
		size_t(x.size()) == n,
		"Hessian: length of x not equal domain dimension for f"
	);
	CPPAD_ASSERT_KNOWN(
		size_t(w.size()) == Range(),
		"Hessian: length of w not equal range dimension for f"
	);

	// point at which we are evaluating the Hessian
	Forward(0, x);

	// define the return value
	Vector hes(n * n);

	// direction vector for calls to forward
	Vector u(n);
	for(j = 0; j < n; j++)
		u[j] = Base(0);


	// location for return values from Reverse
	Vector ddw(n * 2);

	// loop over forward directions
	for(j = 0; j < n; j++)
	{	// evaluate partials of entire function w.r.t. j-th coordinate
		u[j] = Base(1);
		Forward(1, u);
		u[j] = Base(0);

		// evaluate derivative of partial corresponding to F_i
		ddw = Reverse(2, w);

		// return desired components
		for(k = 0; k < n; k++)
			hes[k * n + j] = ddw[k * 2 + 1];
	}

	return hes;
}
开发者ID:barak,项目名称:CppAD-1,代码行数:50,代码来源:hessian.hpp

示例11: WdeSOP

void WdeSOP( OBJPTR obj, OBJPTR parent )
{
    LIST       *ilist, *tlist, *clist;
    WdeResInfo *info;
    RECT        orect;
    OBJPTR      sib;
    OBJ_ID      id;
    bool        clear;
    POINT       origin;

    info = WdeGetCurrentRes();
    if( info == NULL ) {
        return;
    }
    GetClientRect( info->edit_win, &orect );

    GetOffset( &origin );
    OffsetRect( &orect, origin.x, origin.y );

    if( parent == NULL ) {
        GetObjectParent( obj, &parent );
        if( parent == NULL ) {
            return;
        }
    }

    Forward( parent, GET_SUBOBJ_LIST, &tlist, NULL );

    if( tlist != NULL && WdeFindObjectsInRect( &orect, &ilist, tlist ) && ilist != NULL ) {
        clist = NULL;
        tlist = NULL;
        for( ; ilist != NULL; ilist = ListConsume( ilist ) ) {
            sib = ListElement( ilist );
            if( (Forward( sib, IS_OBJECT_CLEAR, &clear, NULL ) && clear) ||
                (Forward( sib, IDENTIFY, &id, NULL ) && id == DIALOG_OBJ) ) {
                WdeInsertObject( &clist, sib );
            } else {
                WdeInsertObject( &tlist, sib );
            }
        }
        if( clist != NULL ) {
            WdeListConcat( &tlist, clist, 0 );
            ListFree( clist );
        }
        if( tlist != NULL ) {
            WdeReorderObjectWindows( tlist );
            ListFree( tlist );
        }
    }
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:50,代码来源:wdezordr.c

示例12: ForwardBackwardAdv

 Dtype ForwardBackwardAdv(const vector<Blob<Dtype>* > & bottom) {
   Dtype loss;
   Forward(bottom, &loss);
   Backward();
   BackwardAdv();
   return loss;
 }
开发者ID:taehoonlee,项目名称:caffe,代码行数:7,代码来源:net.hpp

示例13: Domain

Vector ADFun<Base>::Jacobian(const Vector &x)
{	size_t i;
	size_t n = Domain();
	size_t m = Range();

	CPPAD_ASSERT_KNOWN(
		size_t(x.size()) == n,
		"Jacobian: length of x not equal domain dimension for F"
	);

	// point at which we are evaluating the Jacobian
	Forward(0, x);

	// work factor for forward mode
	size_t workForward = n;

	// work factor for reverse mode
	size_t workReverse = 0;
	for(i = 0; i < m; i++)
	{	if( ! Parameter(i) )
			++workReverse;
	}

	// choose the method with the least work
	Vector jac( n * m );
	if( workForward <= workReverse )
		JacobianFor(*this, x, jac);
	else	JacobianRev(*this, x, jac);

	return jac;
}
开发者ID:iagomosqueira,项目名称:FLasher,代码行数:31,代码来源:jacobian.hpp

示例14: DBGERR

bool Transceiver::Onward(IMFrame & frame)
{
        if ((frame.Header.DestinationId==myId) || (myId==0))
        {
          return false;    //this frame is for me
        }
        else
        {
           if (!Connected())
           {
              DBGERR("&NOTCNT");
              return true;
           }

           if (frame.Header.ReceiverId==myId)
           {
             if (frame.Forward())
                Forward(frame);
             else {
                Backward(frame);
             }
           } else {
              DBGERR("&NOTMY");
           }
           return true;
        }

}
开发者ID:Slyb00ts,项目名称:imwave,代码行数:28,代码来源:imtrans.cpp

示例15: WdeSetDialogMode

bool WdeSetDialogMode( WORD id )
{
    OBJPTR        obj;
    WdeOrderMode  mode;

    switch( id ) {
    case IDM_SET_ORDER:
        mode = WdeSetOrder;
        break;
    case IDM_SET_TABS:
        mode = WdeSetTabs;
        break;
    case IDM_SET_GROUPS:
        mode = WdeSetGroups;
        break;
    }

    if( (obj = WdeGetCurrentDialog()) != NULL ) {
        if( Forward( obj, SET_ORDER_MODE, &mode, NULL ) ) {
            return( TRUE );
        }
    }

    return( FALSE );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:25,代码来源:wdemain.c


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