Revision 752 branches/threaded2/src/linad99/newfmin.cpp

newfmin.cpp (revision 752)
13 13
 * \file
14 14
 * Description not yet available.
15 15
 */
16

  
16
#include <thread>
17
#include <sstream>
18
#include <cassert>
17 19
#include <fvar.hpp>
18 20
#if defined(__SPDLL__)
19 21
#  if !defined(linux)
......
153 155
    }
154 156
  }
155 157
int log_values_switch=0;
156
ofstream logstream("fmin.log");
158
ofstream logstream;
157 159

  
158 160
/**
159 161
 * Description not yet available.
......
161 163
 */
162 164
void print_values(const double& f, const dvector & x,const dvector& g)
163 165
{
166
  if (!logstream.is_open())
167
  {
168
    std::thread::id this_thread_id = std::this_thread::get_id();
169
    std::ostringstream oss;
170
    oss << *ad_comm::adprogram_name << this_thread_id << "-fmin.log";
171
    logstream.open(oss.str().c_str());
172
  }
164 173
  logstream << setprecision(13) << f << endl;
165 174
  logstream << setprecision(13) << x << endl;
166 175
  logstream << setprecision(13) << g << endl;

Also available in: Unified diff