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


C++ Analyze函數代碼示例

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


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


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