Click here to Skip to main content
15,920,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hello ,Everbody! Pin
Hamid_RT12-Apr-07 2:42
Hamid_RT12-Apr-07 2:42 
AnswerRe: Hello ,Everbody! Pin
rp_suman12-Apr-07 3:41
rp_suman12-Apr-07 3:41 
QuestionRe: Hello ,Everbody! Pin
Hamid_RT19-Apr-07 8:00
Hamid_RT19-Apr-07 8:00 
AnswerRe: answer to WhiteSky Pin
Max.Payne19-Apr-07 22:10
Max.Payne19-Apr-07 22:10 
GeneralRe: answer to WhiteSky Pin
Hamid_RT20-Apr-07 20:11
Hamid_RT20-Apr-07 20:11 
GeneralRe: answer to WhiteSky Pin
Max.Payne20-Apr-07 20:35
Max.Payne20-Apr-07 20:35 
GeneralRe: answer to WhiteSky Pin
Hamid_RT21-Apr-07 5:54
Hamid_RT21-Apr-07 5:54 
QuestionOwner drawn List box...problem in setting item height. Pin
Sameer_Thakur12-Apr-07 0:15
Sameer_Thakur12-Apr-07 0:15 
AnswerRe: Owner drawn List box...problem in setting item height. Pin
CPallini12-Apr-07 20:59
mveCPallini12-Apr-07 20:59 
GeneralRe: Owner drawn List box...problem in setting item height. Pin
Vobulator21-Jul-10 4:23
Vobulator21-Jul-10 4:23 
QuestionRegistry editor Pin
prathuraj12-Apr-07 0:16
prathuraj12-Apr-07 0:16 
AnswerRe: Registry editor Pin
Rajesh R Subramanian12-Apr-07 1:53
professionalRajesh R Subramanian12-Apr-07 1:53 
AnswerRe: Registry editor Pin
Roger Stoltz12-Apr-07 2:29
Roger Stoltz12-Apr-07 2:29 
AnswerRe: Registry editor Pin
Hamid_RT19-Apr-07 21:56
Hamid_RT19-Apr-07 21:56 
QuestionProblem with Mnemonics of a Group box Pin
sw@thi12-Apr-07 0:14
sw@thi12-Apr-07 0:14 
QuestionProblem in running Window service Pin
ArunkumarSundaravelu11-Apr-07 23:43
ArunkumarSundaravelu11-Apr-07 23:43 
AnswerRe: Problem in running Window service Pin
bob1697212-Apr-07 5:40
bob1697212-Apr-07 5:40 
QuestionMemory Leak Pin
Rassul Yunussov11-Apr-07 23:30
Rassul Yunussov11-Apr-07 23:30 
QuestionRe: Memory Leak Pin
Mark Salsbery12-Apr-07 7:50
Mark Salsbery12-Apr-07 7:50 
AnswerRe: Memory Leak Pin
Rassul Yunussov12-Apr-07 22:43
Rassul Yunussov12-Apr-07 22:43 
Well, i looked in the task manager - when this process is running the momory grows up.
Here is code in pre tags
UINT __cdecl CGNTGDALDlg::GNTClassificationFunction( LPVOID pParam )
{
	ThreadStruct* pStruct = (ThreadStruct*)pParam;
	int n = pStruct->pDlg->m_Image.GetHeight();
	int m = pStruct->pDlg->m_Image.GetWidth();
	int LineLength = pStruct->pDlg->m_Image.GetPitch();
	unsigned char* Bitmap = (unsigned char*)pStruct->pDlg->m_Image.GetBits();
	Bitmap+=LineLength*pStruct->Offset;
	if(pStruct->pDlg->m_floatingWindowSize==0)
	{
		__declspec(align(16)) float* pInputs =(float*) _aligned_malloc(pStruct->pDlg->m_poDataset->GetRasterCount()*sizeof(float),16);
		for(int i =pStruct->Offset;i<pStruct->End;i++)
			{
				for(int j = abs(LineLength%m),l=0;j<m*3,l<m;j+=3,l++)
				{
						double distance;
						CGNTNeuron* pNeuron;
						double Norm = 0;
						for(int k = 0;k<pStruct->pDlg->m_poDataset->GetRasterCount();k++)
						{
							pInputs[k] = pStruct->pDlg->m_pImageMatrix[k][i][m-l-1];
							Norm+=pInputs[k];
						}
						Norm = sqrt(Norm);
						for(int k = 0;k<pStruct->pDlg->m_poDataset->GetRasterCount();k++)
							pInputs[k]/=Norm;
						EnterCriticalSection(&pStruct->pDlg->m_CriticalSection);
						unsigned int value = pStruct->pDlg->m_pGNTNet->Propagate(pInputs,distance,&pNeuron);		
						LeaveCriticalSection(&pStruct->pDlg->m_CriticalSection);
						
						*(Bitmap-LineLength-j-1) = GetRValue(value);//eto krasnii
						*(Bitmap-LineLength-j-2) = GetGValue(value);//eto zelenii
						*(Bitmap-LineLength-j-3) = GetBValue(value);//eto sinii
				}
				Bitmap+=LineLength;
			}
		_aligned_free(pInputs);
	}
	else
	{
		__declspec(align(16)) float* pInputs =(float*) _aligned_malloc(pStruct->pDlg->m_floatingWindowSize*pStruct->pDlg->m_floatingWindowSize*pStruct->pDlg->m_poDataset->GetRasterCount()*sizeof(float),16);
		for(int i =pStruct->Offset;i<pStruct->End;i++)
			{
				if(i<pStruct->pDlg->m_poDataset->GetRasterYSize()-pStruct->pDlg->m_floatingWindowSize)
				for(int j = abs(LineLength%m),l=0;j<m*3,l<m;j+=3,l++)
				{
					if(l<pStruct->pDlg->m_poDataset->GetRasterXSize()-pStruct->pDlg->m_floatingWindowSize)
					{
							double distance;
							CGNTNeuron* pNeuron;
							int ll = 0;
							double Norm = 0;
							for(int k = 0;k<pStruct->pDlg->m_poDataset->GetRasterCount();k++)
								for(int ii = i;ii<i+pStruct->pDlg->m_floatingWindowSize;ii++)
									for(int jj = l;jj<l+pStruct->pDlg->m_floatingWindowSize;jj++)
									{
										pInputs[ll++] = pStruct->pDlg->m_pImageMatrix[k][ii][m-jj-1];
										Norm+=pStruct->pDlg->m_pImageMatrix[k][ii][m-jj-1]*pStruct->pDlg->m_pImageMatrix[k][ii][m-jj-1];
									}
							Norm = sqrt(Norm);
							for(int k = 0;k<pStruct->pDlg->m_poDataset->GetRasterCount()*pStruct->pDlg->m_floatingWindowSize*pStruct->pDlg->m_floatingWindowSize;k++)
								pInputs[k]/=Norm;
							EnterCriticalSection(&pStruct->pDlg->m_CriticalSection);
							unsigned int Value  = pStruct->pDlg->m_pGNTNet->Propagate(pInputs,distance,&pNeuron);		
							LeaveCriticalSection(&pStruct->pDlg->m_CriticalSection);
							*(Bitmap-LineLength-j-1) = GetRValue(Value);//eto krasnii
							*(Bitmap-LineLength-j-2) = GetGValue(Value);//eto zelenii
							*(Bitmap-LineLength-j-3) = GetBValue(Value);//eto sinii

					}
				}
				Bitmap+=LineLength;
		}
		_aligned_free(pInputs);
	}
	return 0;
}

GeneralRe: Memory Leak Pin
Mark Salsbery13-Apr-07 7:23
Mark Salsbery13-Apr-07 7:23 
GeneralRe: Memory Leak Pin
Rassul Yunussov15-Apr-07 18:33
Rassul Yunussov15-Apr-07 18:33 
QuestionKEYEVENTF_UNICODE macro Pin
Syamlal S Nair11-Apr-07 23:20
Syamlal S Nair11-Apr-07 23:20 
AnswerRe: KEYEVENTF_UNICODE macro Pin
Gospodin Baron12-Apr-07 3:19
Gospodin Baron12-Apr-07 3:19 
GeneralRe: KEYEVENTF_UNICODE macro Pin
Syamlal S Nair16-Apr-07 22:47
Syamlal S Nair16-Apr-07 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.