Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

void Impala::Core::Table::Bayes::SaveMatrixConceptConditionalProbability ( String  name,
double **  matrix,
int &  nRow,
int &  nCol 
) [inline]

Definition at line 498 of file Bayes.h.

References Impala::Core::Database::RawDataSet::GetFilePathAnnotation(), mAnnoImgSet, mAnnoVidSet, and mIsImageSet.

Referenced by SaveMatrix().

00499     {
00500         // mMatrixFile, mProb_c_g, mConceptNum, mGenreNum
00501 
00502         std::string fName;
00503         if (mIsImageSet)
00504             fName = mAnnoImgSet->GetFilePathAnnotation(name,true,false);
00505         else
00506             fName = mAnnoVidSet->GetFilePathAnnotation(name,true,false);
00507         /*String strAnnoSetName = mAnnoSetName;
00508         strAnnoSetName.resize(strAnnoSetName.size()-4);
00509         String fName = "../" + strAnnoSetName + "/Annotations/" + name;*/
00510 
00511         FILE* fp = fopen(fName.c_str(),"wb");
00512 
00513         if (NULL == fp)
00514         {
00515             std::cout << "File has existed, or path does NOT exist: [" << name << "]" << std::endl;
00516             return;
00517         }
00518 
00519         fwrite(&nRow, sizeof(int), 1, fp);  //mConceptNum
00520         fwrite(&nCol, sizeof(int), 1, fp);  //mGenreNum
00521 
00522         // data file: first column, second column, ...
00523         // be sure to be consistent with load funcion
00524         for (int i=0; i<nRow; i++)
00525         {
00526             for (int j=0; j<nCol; j++)
00527             {
00528                 //printf("%.3f ", matrix[i][j]);
00529                 fwrite( &(matrix[i][j]), sizeof(double), 1, fp);
00530             }
00531             //std::cout << std::endl;
00532 
00533         }
00534         fclose(fp);
00535 
00536     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:20:47 2011 for ImpalaSrc by  doxygen 1.5.1