當前位置: 首頁>>代碼示例>>C++>>正文


C++ Calculate函數代碼示例

本文整理匯總了C++中Calculate函數的典型用法代碼示例。如果您正苦於以下問題:C++ Calculate函數的具體用法?C++ Calculate怎麽用?C++ Calculate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Calculate函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: main

void main(){
	int count = 0;
	double Numbers[30],Answer;
	char symbols[30];
	count = Input(Numbers,symbols);
	Print(Numbers, symbols, count);
	Answer = Calculate(Numbers, symbols, &count);

	printf(" = %.1f\n", Answer);
}
開發者ID:MasaCode,項目名稱:C-Language,代碼行數:10,代碼來源:Calculator.c

示例2: Calculate

void LinearRegression::addXY(const double& x, const double& y)
{
	n++;
	sumX += x;
	sumY += y;
	sumXsquared += x * x;
	sumYsquared += y * y;
	sumXY += x * y;
	Calculate();
}
開發者ID:Bannenberg,項目名稱:UArmForArduino,代碼行數:10,代碼來源:linreg.cpp

示例3: SendLogMessage

//---------------------------------------------------------------------------
bool mmImages::mmCalcMethod::Execute(void)
{
	SendLogMessage(mmLog::debug,mmString(L"Start Execute"));

	bool v_bResult = Calculate();

	SendLogMessage(mmLog::debug,mmString(L"End Execute"));

	return v_bResult;
}
開發者ID:ogx,項目名稱:Calculation2D,代碼行數:11,代碼來源:mmCalcMethod.cpp

示例4: main

void main(int argc, char **argv)
{
	setlocale(0, "Russian");
	double s1 = Calculate(mt1, len(mt1));
	double s2 = Calculate(mt2, len(mt2));
	double s3 = Calculate(mt3, len(mt3));

	double max_value = max(max(s1, s2), s3);

	printf("Максимальное значение %0.1lf содержится в:\n", s1);
	if (max_value == s1)
		printf(" mt1", s1);
	if (max_value == s2)
		printf(" mt2", s1);
	if (max_value == s3)
		printf(" mt3", s1);

	printf("\n");
}
開發者ID:Guard96,項目名稱:2014,代碼行數:19,代碼來源:Lab01.cpp

示例5: Calculate

int FGTurboProp::InitRunning(void)
{
  FDMExec->SuspendIntegration();
  Cutoff=false;
  Running=true;  
  N2=16.0;
  Calculate();
  FDMExec->ResumeIntegration();
  return phase==tpRun;
}
開發者ID:DolanP,項目名稱:jsbsim-dll,代碼行數:10,代碼來源:FGTurboProp.cpp

示例6: while

void Decision::run()
{
    while(ros::ok())
    {
        Calculate();
        ros::spinOnce();
        loop_rate.sleep();
    }

}
開發者ID:chicagoedt,項目名稱:iarc_software,代碼行數:10,代碼來源:Tap_Decision.cpp

示例7: Calculate

bool FGAtmosphere::Run(bool Holding)
{
  if (FGModel::Run(Holding)) return true;
  if (Holding) return false;

  Calculate(in.altitudeASL);

  Debug(2);
  return false;
}
開發者ID:stumposs,項目名稱:FG_MSVS_Build,代碼行數:10,代碼來源:FGAtmosphere.cpp

示例8: CommandWhile

// ***************************************************************************
// Function:    CommandWhile
// Description: Our '/while' command
// Usage:       /while (<conditions>)
// ***************************************************************************
VOID CommandWhile(PSPAWNINFO pChar, PCHAR szLine)
{
    CHAR szCond[MAX_STRING] = {0};
    if (!gMacroBlock) {
        MacroError("Can only use /while during a macro.");
        return;
    }
   bRunNextCommand = TRUE;
   if (szLine[0]!='(')
   {
       FatalError("Failed to parse /while command.  Expected () around conditions.");
      SyntaxError("Usage: /while (<conditions>)");
        return;
   }
   PCHAR pEnd=&szLine[1];
   DWORD nParens=1;
   while(1)
   {
      if (*pEnd=='(')
         nParens++;
      else if (*pEnd==')')
      {
         nParens--;
         if (nParens==0)
         {
            pEnd++;
            if (*pEnd!=0)
            {
               FatalError("Failed to parse /while command. Parameters after conditions.");
               SyntaxError("Usage: /while (<conditions>)");
               return;
            }
            break;
         }
      }
      else if (*pEnd==0)
      {
         FatalError("Failed to parse /while command.  Could not find conditions to evaluate.");
         SyntaxError("Usage: /while (<conditions>)");
         return;
      }
      ++pEnd;
   } // while

   strcpy(szCond,szLine);

   DOUBLE Result=0;
   if (!Calculate(szCond,Result))
   {
      FatalError("Failed to parse /while condition '%s', non-numeric encountered",szCond);
      return;
   }
   if (Result==0)
      EndWhile(pChar, gMacroBlock);
}
開發者ID:Cilraaz,項目名稱:MacroQuest2,代碼行數:60,代碼來源:MQ2Bucles.cpp

示例9:

const TRotation& KVFlowTensor::GetAziReacPlaneRotation()
{
    // Returns the azimuthal rotation around the beam axis required
    // to put the X-axis in the reaction plane defined by the beam axis
    // and the major axis (largest eignevalue) of the ellipsoid.
    // The azimuthal angle of the rotation is that of the major axis
    // in the forward direction.

    if (!fCalculated) Calculate();
    return fAziReacPlane;
}
開發者ID:jdfrankland,項目名稱:kaliveda,代碼行數:11,代碼來源:KVFlowTensor.cpp

示例10: main

void main(int argc, char **argv)
{
    setlocale(0, "");
    int s1 = Calculate(mt1, len(mt1));
    int s2 = Calculate(mt2, len(mt2));
    int s3 = Calculate(mt3, len(mt3));

    int u = max(max(s1,s2),s3);

    printf("Больше сумма элементов, не попадающих в заданный диапазон [%i; %i] содержится в:\n", TrgetNumber1, TrgetNumber2);
    if(u==s1)
        printf(" mt1");
    if(u==s2)
        printf(" mt2");
    if(u==s3)
        printf(" mt3");

    printf("\n");
    system("pause");
}
開發者ID:apcel,項目名稱:ivb-3-14,代碼行數:20,代碼來源:lab1.cpp

示例11: main

int main(void)
{
	struct Points *Field; 
	struct Cluster *Clusters;
	int Width, Height;
	int NumOfPoints;
	int NumOfClusters;
	Field = Init(&Height,&Width,&NumOfPoints);
	Clusters = Calculate(Field, Height, Width, &NumOfClusters, NumOfPoints);
	Output_Data(Clusters, Field, NumOfClusters);
	return 0;
}
開發者ID:StaVorosh,項目名稱:K-Means-method,代碼行數:12,代碼來源:main.c

示例12: Calculate

void BroadCollisionStrategy::Detect(
	int nLayer,
	Player * pPlayer,
	Stack * stack,
	list<Space *> * retVal)
{
	Calculate(
		nLayer,
		pPlayer, 
		stack, 
		retVal);
}
開發者ID:rmbernardi,項目名稱:video-game-pc-phase-2,代碼行數:12,代碼來源:BroadCollisionStrategy.cpp

示例13: Calculate

void LinearRegression::addXY(const double& x, const double& y, bool auto_calculate)
{
    n++;
    sumX += x;
    sumY += y;
    sumXsquared += x * x;
    sumYsquared += y * y;
    sumXY += x * y;
    
    if(auto_calculate)
		Calculate();
}
開發者ID:dvinc,項目名稱:moos-ivp-ENSTABretagne,代碼行數:12,代碼來源:linreg.cpp

示例14: Calculate

int FGTurbine::InitRunning(void)
{
  FDMExec->SuspendIntegration();
  Cutoff=false;
  Running=true;  
  N1_factor = MaxN1 - IdleN1;
  N2_factor = MaxN2 - IdleN2;      
  N2 = IdleN2 + ThrottlePos * N2_factor;
  N1 = IdleN1 + ThrottlePos * N1_factor;
  Calculate();
  FDMExec->ResumeIntegration();
  return phase==tpRun;
}
開發者ID:airware,項目名稱:jsbsim,代碼行數:13,代碼來源:FGTurbine.cpp

示例15:

ROOT_FEATURE_CALCULATOR_TEMPLATE
vector<typename ROOT_FEATURE_CALCULATOR_TEMPLATE1::StringBatch>
ROOT_FEATURE_CALCULATOR_TEMPLATE1::Calculate(
    const SyntaxTree& tree)
{
    const vector<SyntaxNode>& nodes = tree.GetNodes();
    vector<StringBatch> features;
    for (size_t nodeIndex = 0; nodeIndex < nodes.size(); ++nodeIndex)
    {
        features.emplace_back(Calculate(nodes[nodeIndex], tree));
    }
    return features;
}
開發者ID:Samsung,項目名稱:veles.nlp,代碼行數:13,代碼來源:RootFeatureCalculatorRus.hpp


注:本文中的Calculate函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。