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 }
|