PerfTestFile Class Reference

List of all members.

Public Member Functions

 PerfTestFile (const char *name)
 ~PerfTestFile (void)
bool IsGood (void)
void Store (int numPoints, float timeTaken, int algorithm, BfldInterpMethod::InterpMethod_t interp)

Private Attributes

ofstream * outFile

Static Private Attributes

static const char kHeader [40] = "BField Performance Test Results"

Detailed Description

Definition at line 18 of file TestPerf.cc.


Constructor & Destructor Documentation

PerfTestFile::PerfTestFile ( const char *  name  ) 

Definition at line 233 of file TestPerf.cc.

References kHeader, and outFile.

00233                                               {
00234   outFile = 0;
00235   outFile = new ofstream(fileName,ios::out);
00236   if(outFile->good())
00237     (*outFile) << kHeader << endl << endl;
00238 }

PerfTestFile::~PerfTestFile ( void   ) 

Definition at line 240 of file TestPerf.cc.

References outFile.

00240                                 {
00241   if(outFile)
00242     delete outFile;
00243 }


Member Function Documentation

bool PerfTestFile::IsGood ( void   ) 

Definition at line 245 of file TestPerf.cc.

References outFile.

00245                               {
00246   return (!outFile) ? false : outFile->good();
00247 }

void PerfTestFile::Store ( int  numPoints,
float  timeTaken,
int  algorithm,
BfldInterpMethod::InterpMethod_t  interp 
)

Definition at line 249 of file TestPerf.cc.

References bfld::AsString(), kAlgRect, and outFile.

Referenced by BenchmarkPerformance().

00250                                                                 {
00251 
00252   if(algorithm == kAlgRect)
00253     (*outFile) << "Algorithm: Rect2d" << endl;
00254   else
00255     (*outFile) << "Algorithm: Voronoi" << endl;
00256 
00257   (*outFile) << "Interpolation: " << BfldInterpMethod::AsString(interp)
00258              << endl;
00259   (*outFile) << "CPU time taken: " << timeTaken << endl;
00260   // (*outFile) << "Estimated memory usage: " << numPoints << endl;
00261   // Currently we don't have a valid way of estimating this at runtime.
00262   (*outFile) << " --- " << endl;
00263 }


Member Data Documentation

const char PerfTestFile::kHeader[40] = "BField Performance Test Results" [static, private]

Definition at line 29 of file TestPerf.cc.

Referenced by PerfTestFile().

ofstream* PerfTestFile::outFile [private]

Definition at line 28 of file TestPerf.cc.

Referenced by IsGood(), PerfTestFile(), Store(), and ~PerfTestFile().


The documentation for this class was generated from the following file:

Generated on 16 Jan 2018 for loon by  doxygen 1.6.1