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

C++ Analyze函数代码示例

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

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



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

示例1: Analyze

void AbstractTarget::AllocateArrays(int sizeX, int sizeY, int sizeZ, bool bWithIxyz)
{
	if ((sizeX != nx) || (sizeY != ny) || (sizeZ != nz))
	{
		int del = Analyze(sizeX);
		if (del > 0) maxJx += del;
		nx = sizeX;
		del = Analyze(sizeY);
		if (del > 0) maxJy += del;
		ny = sizeY;
		del = Analyze(sizeZ);
		if (del > 0) maxJz += del;
		nz = sizeZ;
		nat = nx * ny * nz;
		iocc = (bool *)realloc(iocc, nat * sizeof(bool));
		memset(iocc, 0, nat * sizeof(bool));
		icomp.Deallocate();
		icomp.Dimension(nat, 3);
		icomp.Clear();
		if (bWithIxyz)
		{
			ixyz.Deallocate();
			ixyz.Dimension(nat, 3);
			ixyz.Clear();
		}
	}
}
开发者ID:jstotero,项目名称:ddscatcpp,代码行数:27,代码来源:AbstractTarget.cpp


示例2: Analyze

bool DependenciesAnalyzer::Analyze()
{
    if (layout)
        return Analyze(layout->GetEvents(), true);
    else if (externalEvents)
        return Analyze(externalEvents->GetEvents(), true);

    std::cout << "ERROR: DependenciesAnalyzer called without any layout or external events.";
    return false;
}
开发者ID:Slulego,项目名称:GD,代码行数:10,代码来源:DependenciesAnalyzer.cpp


示例3: Analyze

	bool Analyze(int aKindPai[], int zipai)
	{
		if (aKindPai[0] == 0) {

			return true;	
		}

		//寻找第一张字牌
		int j = 1;
		for (j = 1; j < 10; j ++) {

			if (aKindPai[j] != 0) 
				break;
		}

		bool result;
		if (aKindPai[j] >= 3)	//作为壳子
		{
			aKindPai[j] -= 3;
			aKindPai[0] -= 3;
			result = Analyze(aKindPai, zipai);
			//还原这三张
			aKindPai[j] += 3;
			aKindPai[0] +=3;
			return result;
		}

		//作为顺牌
		if ((!zipai) && (j < 8) 
			&& (aKindPai[j+1] > 0)
			&& (aKindPai[j+2]) > 0)
		{
			//除去这三张
			aKindPai[j] --;
			aKindPai[j+1] --;
			aKindPai[j+2] --;
			aKindPai[0] -= 3;
			result = Analyze(aKindPai, zipai);
			//还原这三张顺子
			aKindPai[j] ++;
			aKindPai[j+1] ++;
			aKindPai[j+2] ++;
			aKindPai[0] += 3;
			return result;
		}

		return false;
	}
开发者ID:liuwanbing,项目名称:liuwanbing,代码行数:48,代码来源:basic_algorithms.cpp


示例4: SetFieldBinary

int CAPETag::SetFieldBinary(const str_utf16 * pFieldName, const void * pFieldValue, int nFieldBytes, int nFieldFlags)
{
    if (m_bAnalyzed == FALSE) { Analyze(); }
    if (pFieldName == NULL) return -1;

    // check to see if we're trying to remove the field (by setting it to NULL or an empty string)
    BOOL bRemoving = (pFieldValue == NULL) || (nFieldBytes <= 0);

    // get the index
    int nFieldIndex = GetTagFieldIndex(pFieldName);
    if (nFieldIndex != -1)
    {
        // existing field

        // fail if we're read-only (and not ignoring the read-only flag)
        if ((m_bIgnoreReadOnly == FALSE) && (m_aryFields[nFieldIndex]->GetIsReadOnly()))
            return -1;
        
        // erase the existing field
        SAFE_DELETE(m_aryFields[nFieldIndex])

        if (bRemoving)
        {
            return RemoveField(nFieldIndex);
        }
    }
    else
    {
        if (bRemoving)
开发者ID:ariasrodolfo,项目名称:monkeys-audio,代码行数:29,代码来源:APETag.cpp


示例5: InitCaption

BOOL CARIB8CharDecode::Caption( const BYTE* pbSrc, DWORD dwSrcSize, vector<CAPTION_DATA>* pCaptionList )
{
	if( pbSrc == NULL || dwSrcSize == 0 || pCaptionList == NULL){
		return FALSE;
	}
	InitCaption();
	m_pCaptionList = pCaptionList;

	BOOL bRet = TRUE;
	DWORD dwReadCount = 0;
	while(dwReadCount<dwSrcSize){
		DWORD dwReadSize = 0;
		BOOL bRet = Analyze(pbSrc+dwReadCount, dwSrcSize-dwReadCount, &dwReadSize );
		if( bRet == TRUE ){
			if( m_strDecode.size() > 0 ){
				CheckModify();
			}
		}else{
			pCaptionList->clear();
			break;
		}
		m_strDecode = "";
		dwReadCount+=dwReadSize;
	}
	return bRet;
}
开发者ID:Velmy,项目名称:EDCB,代码行数:26,代码来源:ARIB8CharDecode.cpp


示例6: HIWORD

BOOL CThhylDlg::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	// TODO: Add your specialized code here and/or call the base class
	const WORD notifycode = HIWORD(wParam);
	const WORD id         = LOWORD(wParam);

	if (id == IDC_RPYFILE) { // “录像文件”编辑框
		if (notifycode == EN_KILLFOCUS) {
			// 焦点离开编辑框时不接受用户在编辑框中输入的路径,除非用户按了回车。
			UpdateData(FALSE);
			return TRUE;
		}
	}

	// menu commands and others
	switch(id)
	{
	case IDM_CHANGEENCODESTART+0: cfg.InfoCode = 932; break;
	case IDM_CHANGEENCODESTART+1: cfg.InfoCode = 936; break;
	case IDM_CHANGEENCODESTART+2: cfg.InfoCode = 950; break;
	case IDM_CHANGEENCODESTART+3: cfg.InfoCode = 0; break;
	default: return CDlgBaseWZ::OnCommand(wParam, lParam);
	}
	
	cfg.CommentCode = cfg.InfoCode;
	if(m_filestatus.IsValid())
		Analyze();
	return TRUE;
}
开发者ID:treejames,项目名称:thhyl,代码行数:29,代码来源:thhylDlg.cpp


示例7: _T

void CThhylDlg::OnEditcomment() 
{
	// TODO: Add your control notification handler code here
	if (!(m_bTHX && m_filestatus.IsValid())) {
		const HWND hRpyFile = ((CButton*)GetDlgItem(IDC_RPYFILE))->GetSafeHwnd();
		LPCTSTR const msgtitle = _T("无法编辑注释。可能的原因:");
		LPCTSTR const msg = _T("1. 红魔乡和妖妖梦的录像文件无法添加注释;\n")
							_T("2. 尚未打开任何文件或文件格式不支持。");
		const HICON icon = AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDR_MAINFRAME));

		if (!ShowBalloonMsg( hRpyFile, msg, msgtitle, TTI_WARNING, FALSE, icon)) {
			// 如果 balloon 不支持,则显示 msgbox
			UserIconedMsgBox(msg, 0, MB_ICONEXCLAMATION, msgtitle);
		}
	}
	else {
		CDlgComment dlg;
		dlg.m_pCommentData = &m_strCurrComment;
		dlg.m_filename = m_rpyfile;
		dlg.m_pRpyData = m_pRpyData;
		dlg.m_dwRpySize = m_dwRpySize;
		if (dlg.DoModal()==IDOK)
			Analyze();
		
		cfg.CommentCodeForEdit = dlg.m_CommentCodeEdit;
	}
}
开发者ID:treejames,项目名称:thhyl,代码行数:27,代码来源:thhylDlg.cpp


示例8: Analyze

void CThhylDlg::OnOption() 
{
	// TODO: Add your control notification handler code here
	CDlgOption dlg;
	if (IDOK == dlg.DoModal() && m_filestatus.IsValid())
		Analyze();
}
开发者ID:treejames,项目名称:thhyl,代码行数:7,代码来源:thhylDlg.cpp


示例9: filter

void CThhylDlg::CopyOrMoveRpy(LPCTSTR DialogTitle, BOOL bCopy)
{
	if (!m_filestatus.IsValid())
		return;
	
	CString filter((LPCTSTR)IDS_DLGFILTER), newfilename;
	
	CFileDialogWZ dlg(FALSE, _T("rpy"), m_rpyfile,
		OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST,
		filter, this);
	dlg.m_ofn.lpstrTitle=DialogTitle;
	if (dlg.DoModal()==IDCANCEL)
		return;
	
	newfilename=dlg.GetPathName();
	
	BOOL result;
	result = bCopy
		? CopyFile(m_rpyfile, newfilename, FALSE)
		: MoveFileEx(m_rpyfile, newfilename, MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH);

	if (result) { //复制/移动成功
		//如果是移动,或者在选项中选中了“打开复制后的目标文件”
		if (!bCopy || HasConfigOption(CFG_COPYOPENDEST)) {
			m_rpyfile = newfilename;
			Analyze();
		}
	}
	else {
		LPCTSTR ErrorMsg;
		ErrorMsg = GetErrorMessage(GetLastError());
		MessageBox( ErrorMsg, DialogTitle, MB_ICONSTOP );
	}
}
开发者ID:treejames,项目名称:thhyl,代码行数:34,代码来源:thhylDlg.cpp


示例10: GetFieldBinary

int CAPETag::GetFieldBinary(const str_utf16 * pFieldName, void * pBuffer, int * pBufferBytes)
{
    if (m_bAnalyzed == FALSE) { Analyze(); }
    
    int nRetVal = ERROR_UNDEFINED;

    if (*pBufferBytes > 0)
    {
        CAPETagField * pAPETagField = GetTagField(pFieldName);
        if (pAPETagField == NULL)
        {
            memset(pBuffer, 0, *pBufferBytes);
            *pBufferBytes = 0;
        }
        else
        {
            if (pAPETagField->GetFieldValueSize() > *pBufferBytes)
            {
                // we'll fail here, because partial data may be worse than no data
                memset(pBuffer, 0, *pBufferBytes);
                *pBufferBytes = pAPETagField->GetFieldValueSize();
            }
            else
            {
                // memcpy
                *pBufferBytes = pAPETagField->GetFieldValueSize();
                memcpy(pBuffer, pAPETagField->GetFieldValue(), *pBufferBytes);
                nRetVal = ERROR_SUCCESS;
            }
        }
    }

    return nRetVal;
}
开发者ID:ariasrodolfo,项目名称:monkeys-audio,代码行数:34,代码来源:APETag.cpp


示例11: UpdateData

void CThhylDlg::OnDropFiles(HDROP hDropInfo) 
{
	// TODO: Add your message handler code here and/or call default
	const UINT nFileCount = ::DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, _MAX_PATH);
	LPTSTR const lpszFileName = new TCHAR[_MAX_PATH];

	for (UINT i=0; i<nFileCount; ++i) {
		::DragQueryFile(hDropInfo, i, lpszFileName,_MAX_PATH);

		if (i==0) { // 第1个文件
			UpdateData(TRUE);
			m_rpyfile = lpszFileName;
			ConvToFullPath();
			UpdateData(FALSE);
		} else //如果拖入了2个或2个以上的文件,则另开一个自身的实例来打开。
			SpawnInstance(lpszFileName);
	}
		
	::DragFinish(hDropInfo);
	delete []lpszFileName;
	
	if (nFileCount > 0) Analyze();

	//CDlgBaseWZ::OnDropFiles(hDropInfo);
}
开发者ID:treejames,项目名称:thhyl,代码行数:25,代码来源:thhylDlg.cpp


示例12: CheckIP138

void Detection::WorkFunc()
{
    CheckIP138();
    CheckIP();
    TestTinydrag();
    Ping();
    GetLocalIP();
    Test9KAPPPAC();
    Test9K();
    Test8888();
    boost::thread work_thread(boost::bind(&Detection::TestTracker, this));
    for (int i = 0; i < 5 * 60; ++i)
    {
        if (i % 3 == 0)
        {
            ++m_progress_pos_;
            if (i % 60 == 0)
            {
                Test9K();
            }
        }
        Sleep(1000);
    }
    Analyze();
    TestBs();
    Test9K();
    WriteTrackerResult();
    Sleep(1000);
    MessageBox("测试完毕!");
}
开发者ID:huangyt,项目名称:MyProjects,代码行数:30,代码来源:Detection.cpp


示例13: iter

double EffectTruncSilence::CalcPreviewInputLength(double /* previewLength */)
{
   double inputLength = mT1 - mT0;
   double minInputLength = inputLength;

   // Master list of silent regions
   RegionList silences;

   // Start with the whole selection silent
   silences.push_back(Region(mT0, mT1));

   SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
   int whichTrack = 0;

   for (Track *t = iter.First(); t; t = iter.Next()) {
      WaveTrack *const wt = static_cast<WaveTrack *>(t);

      RegionList trackSilences;

      sampleCount index = wt->TimeToLongSamples(mT0);
      sampleCount silentFrame = 0; // length of the current silence

      Analyze(silences, trackSilences, wt, &silentFrame, &index, whichTrack, &inputLength, &minInputLength);

      whichTrack++;
   }
   return inputLength;
}
开发者ID:jengelh,项目名称:audacity,代码行数:28,代码来源:TruncSilence.cpp


示例14: ClearTerrainAnalysis

void Terrain::IncTerrainAnalysis( void )
{
	m_reevaluateAnalysis = true;
	m_analysis = (TerrainAnalysisType)((int)m_analysis + 1);
	if(TerrainAnalysis_Count == g_terrain.m_analysis) { g_terrain.m_analysis = TerrainAnalysis_None; }
	ClearTerrainAnalysis();
	Analyze();
}
开发者ID:cs580project,项目名称:RL,代码行数:8,代码来源:terrain.cpp


示例15: Analyze

void IndexTuner::IndexTuneHelper(storage::DataTable* table) {

  // Add required indices
  Analyze(table);

  // Build desired indices
  BuildIndices(table);
}
开发者ID:eric-haibin-lin,项目名称:peloton-1,代码行数:8,代码来源:index_tuner.cpp


示例16: scanf

void Sudoku::ReadIn()
{
	status = UNDETERMINED;

	for (int i = 0; i < 81; i++)
		scanf("%d", &table[i]);

	Analyze();
}
开发者ID:0140454,项目名称:CppCourse,代码行数:9,代码来源:Sudoku.cpp


示例17: iter

bool EffectTruncSilence::FindSilences
   (RegionList &silences, Track *firstTrack, Track *lastTrack)
{
   // Start with the whole selection silent
   Region *sel = new Region;
   sel->start = mT0;
   sel->end = mT1;
   silences.push_back(sel);

   // Remove non-silent regions in each track
   SelectedTrackListOfKindIterator iter(Track::Wave, mTracks);
   int whichTrack = 0;
   bool lastSeen = false;
   for (Track *t = iter.StartWith(firstTrack); !lastSeen && t; t = iter.Next())
   {
      lastSeen = (t == lastTrack);
      WaveTrack *const wt = static_cast<WaveTrack *>(t);

      // Smallest silent region to detect in frames
      sampleCount minSilenceFrames =
         sampleCount(std::max(mInitialAllowedSilence, DEF_MinTruncMs) * wt->GetRate());

      //
      // Scan the track for silences
      //
      RegionList trackSilences;
      trackSilences.DeleteContents(true);

      sampleCount index = wt->TimeToLongSamples(mT0);
      sampleCount silentFrame = 0;

      // Detect silences
      bool cancelled = !(Analyze(silences, trackSilences, wt, &silentFrame, &index, whichTrack));

      // Buffer has been freed, so we're OK to return if cancelled
      if (cancelled)
      {
         ReplaceProcessedTracks(false);
         return false;
      }

      if (silentFrame >= minSilenceFrames)
      {
         // Track ended in silence -- record region
         Region *r = new Region;
         r->start = wt->LongSamplesToTime(index - silentFrame);
         r->end = wt->LongSamplesToTime(index);
         trackSilences.push_back(r);
      }

      // Intersect with the overall silent region list
      Intersect(silences, trackSilences);
      whichTrack++;
   }

   return true;
}
开发者ID:ShockingIce,项目名称:audacity,代码行数:57,代码来源:TruncSilence.cpp


示例18:

CAPETagField * CAPETag::GetTagField(int nIndex)
{
    if (m_bAnalyzed == FALSE) { Analyze(); }

    if ((nIndex >= 0) && (nIndex < m_nFields))
    {
        return m_aryFields[nIndex];
    }

    return NULL;
}
开发者ID:ariasrodolfo,项目名称:monkeys-audio,代码行数:11,代码来源:APETag.cpp


示例19: GetFieldString

int CAPETag::GetFieldString(const str_utf16 * pFieldName, str_utf16 * pBuffer, int * pBufferCharacters)
{
    if (m_bAnalyzed == FALSE) { Analyze(); }

    int nRetVal = ERROR_UNDEFINED;

    if (*pBufferCharacters > 0)
    {
        CAPETagField * pAPETagField = GetTagField(pFieldName);
        if (pAPETagField == NULL)
        {
            // the field doesn't exist -- return an empty string
            memset(pBuffer, 0, *pBufferCharacters * sizeof(str_utf16));
            *pBufferCharacters = 0;
        }
        else if (pAPETagField->GetIsUTF8Text() || (m_nAPETagVersion < 2000))
        {
            // get the value in UTF-16 format
            CSmartPtr<str_utf16> spUTF16;
            if (m_nAPETagVersion >= 2000)
                spUTF16.Assign(GetUTF16FromUTF8((str_utf8 *) pAPETagField->GetFieldValue()), TRUE);
            else
                spUTF16.Assign(GetUTF16FromANSI(pAPETagField->GetFieldValue()), TRUE);

            // get the number of characters
            int nCharacters = (wcslen(spUTF16) + 1);
            if (nCharacters > *pBufferCharacters)
            {
                // we'll fail here, because it's not clear what would get returned (null termination, size, etc.)
                // and we really don't want to cause buffer overruns on the client side
                *pBufferCharacters = nCharacters;
            }
            else
            {
                // just copy in
                *pBufferCharacters = nCharacters;
                memcpy(pBuffer, spUTF16.GetPtr(), *pBufferCharacters * sizeof(str_utf16));
                nRetVal = ERROR_SUCCESS;
            }
        }
        else
        {
            // memset the whole buffer to NULL (so everything left over is NULL terminated)
            memset(pBuffer, 0, *pBufferCharacters * sizeof(str_utf16));

            // do a binary dump (need to convert from wchar's to bytes)
            int nBufferBytes = (*pBufferCharacters - 1) * sizeof(str_utf16);
            nRetVal = GetFieldBinary(pFieldName, pBuffer, &nBufferBytes);
            *pBufferCharacters = (nBufferBytes / sizeof(str_utf16)) + 1;
        }
    }

    return nRetVal;
}
开发者ID:ariasrodolfo,项目名称:monkeys-audio,代码行数:54,代码来源:APETag.cpp


示例20: srand

void Sudoku::GiveQuestion()
{
	srand(time(NULL));

	const int *pTemplate = sudoku_template[rand() % cnt_template];
	int question[81], trans[10] = { 0 };

	/// random
	for (int i = 1; i <= 9; i++)
	{
		int num;

		do
		{
			num = rand() % 9 + 1;
		}while(trans[num]);

		trans[num] = i;
	}
	/// fill
	for (int i = 0; i < 81; i++)
		question[i] = trans[pTemplate[i]];
	/// dig
	for (int c = 0; c < 55; c++)
	{
		int pos;

		memcpy(table, question, sizeof(table));
		do
		{
			pos = rand() % 81;
		} while(table[pos] == EMPTY_CELL);

		table[pos] = EMPTY_CELL;

		Init();
		Analyze();
		backtracking(0);

		if (status == ONE_SOULUTION)
			memcpy(question, table, sizeof(question));
	}

	/*for (int i = 0; i < 9; i++)
	{
		for (int k = 0; k < 9; k++)
		{
			if (!k) printf("%d", question[i*9+k]);
			else printf(" %d", question[i*9+k]);
		}
		putchar('\n');
	}*/
}
开发者ID:0140454,项目名称:CppCourse,代码行数:53,代码来源:Sudoku.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AndroidBitmap_getInfo函数代码示例发布时间:2022-05-30
下一篇:
C++ Ambient_Sounds_Remove_All_Non_Looping_Sounds函数代码示例发布时间: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