This function does two things:
Definition at line 216 of file mainPrecomputeKernelMatrix.cpp. References Impala::Core::Training::Equals(), Impala::Core::Feature::FeatureTable::GetQuidTable(), ILOG_ERROR, ILOG_VAR, Impala::MakeString(), Impala::Core::Table::Read(), and Impala::Core::Table::Write(). Referenced by ComputeMatrix(). 00218 { 00219 ILOG_VAR(Application.mainPrecomputeKernelMatrix.CheckQuids); 00220 bool equal = true; 00221 bool fileExists = true; 00222 00223 String basename = resultname + MakeString(part) + "of" + 00224 MakeString(partcount) + ".quids"; 00225 String filename; 00226 if (set2) 00227 { 00228 // try to open for reading 00229 filename = set2->GetFilePathPrecomputedKernels 00230 (basename, set->GetSetName(), false, true); 00231 if (filename.empty()) 00232 { 00233 fileExists = false; 00234 filename = set2->GetFilePathPrecomputedKernels 00235 (basename, set->GetSetName(), true, false); 00236 } 00237 } 00238 else 00239 { 00240 // try to open for reading 00241 filename = set->GetFilePathPrecomputedKernels(basename, "", false, 00242 true); 00243 if (filename.empty()) 00244 { 00245 fileExists = false; 00246 filename = set->GetFilePathPrecomputedKernels(basename, "", true, 00247 false); 00248 } 00249 } 00250 Table::QuidTable* quids = f->GetQuidTable(); 00251 Table::QuidTable* prevquids = new Table::QuidTable; 00252 if (fileExists) 00253 { 00254 Read(prevquids, filename, set->GetDatabase()); 00255 equal = Equals(quids, prevquids); 00256 } 00257 else //we could not read so we try to write 00258 { 00259 if (!Write(quids, filename, set->GetDatabase(), true)) 00260 ILOG_ERROR("could neither read nor write " << filename); 00261 } 00262 delete prevquids; 00263 delete quids; 00264 if(!equal) 00265 { 00266 ILOG_ERROR("the input tables do not have the same Quids"); 00267 exit(0); 00268 } 00269 }
Here is the call graph for this function:
|