Definition at line 100 of file TrecSVM.h. References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CPB(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), mDataFile, mFirstTime, and mNrFeatures. 00101 { 00102 if ((featVec->CW() * featVec->CH()) != mNrFeatures) 00103 { 00104 std::cout << "AddAnno : wrong number of features" << std::endl; 00105 return; 00106 } 00107 FILE *fp; 00108 std::string wMode = (mFirstTime) ? "w" : "a"; 00109 mFirstTime = false; 00110 if ((fp = fopen(mDataFile.c_str(), wMode.c_str())) == 0) 00111 { 00112 std::cout << "TrecSVM::AddAnno : Unable to write to " 00113 << mDataFile << std::endl; 00114 return; 00115 } 00116 00117 fprintf(fp, "%d", con); 00118 int f = 1; 00119 for (int y=0 ; y<featVec->CH() ; y++) 00120 { 00121 for (int x=0 ; x<featVec->CW() ; x++) 00122 { 00123 Real64 val = *(featVec->CPB(x, y)); 00124 fprintf(fp, " %d:%f", f++, val); 00125 } 00126 } 00127 fprintf(fp, "\n"); 00128 fclose(fp); 00129 }
Here is the call graph for this function:
|