Hello again! It's to difficult for me to discribe some serious trouble in english.
I find out that one of your procuderes is not correctly works. here are some screens and codes.
This is the place where i fill massives with your method .setcontet. In experiment way i find out that if number consists of more than 2 symbols (23,112,234) it put to massive 4,44.
Code:
void __fastcall Tanaliz::analizbtnClick(TObject *Sender)
{int col,row;
double temp[100][100],indan[100][100];
tabl_dannue->DataSource->DataSet->DisableControls();
tabl_dannue->DataSource->DataSet->First();
for (row=1; row <=tabl_dannue->DataSource->DataSet->RecordCount; row++) {
for (col=1; col<tabl_dannue->Columns->Count; col++) {
temp[row][col]=tabl_dannue->Columns->Items[col]->Field->Value;
}
tabl_dannue->DataSource->DataSet->Next();}
for (col=1; col<tabl_dannue->Columns->Count; col++) {
for (row=1; row <=tabl_dannue->DataSource->DataSet->RecordCount; row++)
{indan[col][row]=temp[row][col];
//tset->Lines->Add(indan[col][row]);
}
}
tabl_dannue->DataSource->DataSet->EnableControls();
alglib::real_1d_array mx;
alglib::real_1d_array my;
double masx[5], masy[5];
double v;
int i,j,t1,t2;
t1=1;t2=1;
for (j=1; j <tabl_dannue->Columns->Count-1; j++)
{
for (i = 0; i <tabl_dannue->DataSource->DataSet->RecordCount; i++) {
v=0;
masx[i]=indan[j][i+1];
masy[i]=indan[j+1][i+1];
Memo2->Lines->Add(FloatToStr(masx[i])+" "+FloatToStr(masy[i]));}
mx.setcontent(tabl_dannue->DataSource->DataSet->RecordCount,masx);
my.setcontent(tabl_dannue->DataSource->DataSet->RecordCount,masy);
real_1d_array x = mx;
real_1d_array y = my;
for (int k = 0; k <tabl_dannue->DataSource->DataSet->RecordCount; k++) {
tset->Lines->Add(FloatToStr(x[k])+" "+FloatToStr(y[k]));
}
tset->Lines->Add("Next-----------"+IntToStr(j));
Memo1->Lines->Add("===столбец "+IntToStr(j)+"-"+IntToStr(j+1));
v = alglib::spearmancorr2(x, y);
Memo1->Lines->Add("Спирман - " +FloatToStr(v));
StringGrid1->Cells[t1][t2]=SimpleRoundTo(v,-4);
v = alglib::pearsoncorr2(x, y);
Memo1->Lines->Add("Пирсон - " +FloatToStr(v));
StringGrid1->Cells[t1][t2+1]=SimpleRoundTo(v,-4);
v = alglib::cov2(x, y);
Memo1->Lines->Add("Ковариация - " +FloatToStr(v));
StringGrid1->Cells[t1][t2+2]=SimpleRoundTo(v,-4);
t1++;}
}
Sorry, дальше на русском.
Заполнение моего массива из таблицы происходит корректно, проверил почисельно.
Возникла проблема при передаче массива в процедуру alglib::pearsoncorr2, alglib::spearmancorr2, alglib::cov2 (другие не проверял) c помощью метода .setcontent.
That is what i mean:
I think that i have only one way to fill massive like string and then send it into procedure.