• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Calculate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Calculate

void CDrawDoc::NewStructure(int number) {
	StructureNumber = number;
	int i;

	for (i=1;i<=ct.numofbases;i++) {
		if (ct.basepr[number][i]) {
			Calculate();
			nopair = false;
			return;
		}
	}
	nopair = true;
}
开发者ID:franfyh,项目名称:structureanalysis,代码行数:13,代码来源:DrawDoc.cpp


示例17: max

// 得到趋势信号
int CTechnique::GetTrendIntensity(int nIndex, CSPDWordArray & adwDays,
								 UINT itsLong, UINT itsShort, UINT * pnCode )
{
	if( pnCode )	*pnCode	=	ITSC_NOTHING;
	if( nIndex <= 0 )
		return ITS_NOTHING;

	int	nRet	=	ITS_NOTHING;
	for( int k=1; k<adwDays.GetSize(); k++ )
	{
		double	dMALast1, dMALast2, dMANow1, dMANow2;
		if( !Calculate( &dMALast1, nIndex-1, min(adwDays[k-1],adwDays[k]), FALSE )
			|| !Calculate( &dMALast2, nIndex-1, max(adwDays[k-1],adwDays[k]), FALSE )
			|| !Calculate( &dMANow1, nIndex, min(adwDays[k-1],adwDays[k]), FALSE )
			|| !Calculate( &dMANow2, nIndex, max(adwDays[k-1],adwDays[k]), FALSE ) )
			return ITS_NOTHING;
		
		if( dMANow1 >= dMALast1 && dMANow2 >= dMALast2
			&& dMANow1 > dMANow2 && (dMANow1-dMANow2)>=(dMALast1-dMALast2)
			&& (ITS_ISBUY(nRet) || 1==k) )
		{
			if( pnCode )	*pnCode	=	ITSC_LONG;
			nRet	=	itsLong;
		}
		else if( dMANow1 <= dMALast1 && dMANow2 <= dMALast2
			&& dMANow1 < dMANow2 && (dMANow1-dMANow2)<=(dMALast1-dMALast2)
			&& (ITS_ISSELL(nRet) || 1==k) )
		{
			if( pnCode )	*pnCode	=	ITSC_SHORT;
			nRet	=	itsShort;
		}
		else
		{
			if( pnCode )	*pnCode	=	ITSC_NOTHING;
			return ITS_NOTHING;
		}
	}
	return nRet;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:40,代码来源:Technique.cpp


示例18: Destroy

//---------------------------------------------------------
bool CSG_Regression::Calculate(int nValues, double *x, double *y, TSG_Regression_Type Type)
{
	bool	bResult;

	Destroy();

	m_nValues	= nValues;
	m_x			= x;
	m_y			= y;

	bResult		= Calculate(Type);

	return( bResult );
}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:15,代码来源:mat_regression.cpp


示例19: Release

void SceneAnimator::Init(const aiScene* pScene){// this will build the skeleton based on the scene passed to it and CLEAR EVERYTHING
	if(!pScene->HasAnimations()) return;
	Release();
	
	Skeleton = CreateBoneTree( pScene->mRootNode, NULL);
	ExtractAnimations(pScene);
	
	for (unsigned int i = 0; i < pScene->mNumMeshes;++i){
		const aiMesh* mesh = pScene->mMeshes[i];
		
		for (unsigned int n = 0; n < mesh->mNumBones;++n){
			const aiBone* bone = mesh->mBones[n];
			std::map<std::string, cBone*>::iterator found = BonesByName.find(bone->mName.data);
			if(found != BonesByName.end()){// FOUND IT!!! woohoo, make sure its not already in the bone list
				bool skip = false;
				for(size_t j(0); j< Bones.size(); j++){
					std::string bname = bone->mName.data;
					if(Bones[j]->Name == bname) {
						skip = true;// already inserted, skip this so as not to insert the same bone multiple times
						break;
					}
				}
				if(!skip){// only insert the bone if it has not already been inserted
					std::string tes = found->second->Name;
					TransformMatrix(found->second->Offset, bone->mOffsetMatrix);
					found->second->Offset.Transpose();// transpoce their matrix to get in the correct format
					Bones.push_back(found->second);
					BonesToIndex[found->first] = (unsigned int)Bones.size()-1;
				}
			} 
		}
	}
	Transforms.resize( Bones.size());
	float timestep = 1.0f/30.0f;// 30 per second
	for(size_t i(0); i< Animations.size(); i++){// pre calculate the animations
		SetAnimIndex((unsigned int)i);
		float dt = 0;
		for(float ticks = 0; ticks < Animations[i].Duration; ticks += Animations[i].TicksPerSecond/30.0f){
			dt +=timestep;
			Calculate(dt);
			Animations[i].Transforms.push_back(std::vector<mat4>());
			std::vector<mat4>& trans = Animations[i].Transforms.back();
			for( size_t a = 0; a < Transforms.size(); ++a){
				mat4 rotationmat =  Bones[a]->Offset * Bones[a]->GlobalTransform;
				trans.push_back(rotationmat);
			}
		}
	}
	OUTPUT_DEBUG_MSG("Finished loading animations with "<<Bones.size()<<" bones");
}
开发者ID:LazyNarwhal,项目名称:Destination_Toolkit,代码行数:50,代码来源:cAnimationController.cpp


示例20:

// 得到趋势信号
int CTechnique::GetTrendIntensity1( int nIndex, UINT itsLong, UINT itsShort, UINT *pnCode )
{
	if( pnCode )	*pnCode	=	ITSC_NOTHING;
	if( nIndex <= 0 )
		return ITS_NOTHING;

	double	dLast = 0, dNow = 0;
	if( !Calculate( &dLast, nIndex-1, FALSE )
		|| !Calculate( &dNow, nIndex, FALSE ) )
		return ITS_NOTHING;

	if( dNow > dLast )
	{
		if( pnCode )	*pnCode	=	ITSC_LONG;
		return itsLong;
	}
	if( dNow < dLast )
	{
		if( pnCode )	*pnCode	=	ITSC_SHORT;
		return itsShort;
	}
	return ITS_NOTHING;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:24,代码来源:Technique.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CalculateMeleeDamageForce函数代码示例发布时间:2022-05-30
下一篇:
C++ CalcMuzzlePoint函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap