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

void Impala::Core::Table::Bayes::DumpMatrix ( char *  name,
double **  matrix,
int  nRow,
int  nCol,
const char *  file,
bool  bDumpFloat = true 
) [inline]

Definition at line 404 of file Bayes.h.

00405     {
00406         FILE* fp = fopen(file, "wt");
00407         if (NULL == fp)
00408         {
00409             std::cout << "File path does NOT exist: " << file << std::endl;
00410             return;
00411         }
00412 
00413         fprintf(fp,"%d\t%d\n",nRow,nCol);
00414 
00415         // dump order: row 0, row 1, ...
00416         for (int j=0; j<nCol; j++)
00417         {
00418             for (int i=0; i<nRow; i++)
00419             {
00420                 if (bDumpFloat)
00421                     fprintf(fp,"%.3f\t", matrix[i][j]);
00422                 else
00423                     fprintf(fp,"%d\t",  int(matrix[i][j]) );
00424             }
00425             fprintf(fp,"\n");
00426         }
00427 
00428         fclose(fp);
00429     }


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