Definition at line 444 of file Bayes.h. References Impala::Core::Database::RawDataSet::GetFilePathAnnotation(), and mAnnoVidSet. Referenced by SaveMatrix(). 00445 { 00446 // mMatrixFile, mProb_c_g, mConceptNum, mGenreNum 00447 00448 std::string fName = mAnnoVidSet->GetFilePathAnnotation(name,true,false); 00449 /*String strAnnoSetName = mAnnoSetName; 00450 strAnnoSetName.resize(strAnnoSetName.size()-4); 00451 String fName = "../" + strAnnoSetName + "/Annotations/" + name;*/ 00452 00453 FILE* fp = fopen(fName.c_str(),"wb"); 00454 00455 if (NULL == fp) 00456 { 00457 std::cout << "File has existed, or path does NOT exist: [" << name << "]" << std::endl; 00458 return; 00459 } 00460 00461 fwrite(&nRow, sizeof(int), 1, fp); //mConceptNum 00462 fwrite(&nCol, sizeof(int), 1, fp); //mGenreNum 00463 00464 for (int i=0; i<nRow; i++) 00465 { 00466 for (int j=0; j<nCol; j++) 00467 { 00468 //printf("%.3f ", matrix[i][j]); 00469 fwrite( &(matrix[i][j]), sizeof(double), 1, fp); 00470 } 00471 //std::cout << std::endl; 00472 00473 } 00474 fclose(fp); 00475 00476 }
Here is the call graph for this function:
|