I added some commands to produce an output file in methods of a given class. This worked perfectly well, and output file was produced during execution. Now that I made major changes to the code (but not at all to the output file commands), I am not producing output correctly anymore? Where can this come from? The code I changed seems not have any connexion to output commands. Constructor looks like
solverMethod::solverMethod(solverInput*inp_):solverMethod(inp_) { ndim = m_input->getNbParams(); bestFuncEval = DBL_MAX; NMAX = m_input->getMaxIter(); FTOL = m_input->getTolerance(); NITER = 0; logMode = true; osOutput.open("F://Output.txt") ; }
where member boolean logMode decide whether comments are active or not.
In different methods, I have code like
if(logMode) { osOutput << "\n"; osOutput << " - - BUILD "; osOutput << "\n"; osOutput << "INITIAL"; osOutput << "\n"; for(int k=0;k<npts;k++) { for(int j=0;j<m_ndim;j++) { osOutput << s_[k][j] ; osOutput << ", "; } } osOutput << "\n"; } to produce comments
and then I have at the end of major method:
// .... osOutput.close(); return true; } Do you have any further info
solverMethod::solverMethod(solverInput*inp_):solverMethod(inp_)- this looks strange does this even work? Do you have a member named "solverMethod" or a base class which is named "solverMethod"? If I try that with g++ it displays an error. What compiler are you using?"F:\\Output.txt"instead ofF://Output.txt"- or is it just a typo?