Revision 752 branches/threaded2/src/nh99/newmodm2.cpp

newmodm2.cpp (revision 752)
4 4
 * Author: David Fournier
5 5
 * Copyright (c) 2008-2012 Regents of the University of California 
6 6
 */
7
#include <thread>
8
#include <sstream>
7 9
#include <admodel.h>
8 10
#if defined(USE_LAPLACE)
9 11
#  include <df1b2fun.h>
......
21 23
 //char ch;
22 24
 if (!underflow_flag)
23 25
 {
24
    adstring tmpstring="admodel.hes";
25
    if (ad_comm::wd_flag)
26
       tmpstring = ad_comm::adprogram_name + ".hes";
27
    uistream ifs((char*)tmpstring);
26
    std::thread::id this_thread_id = std::this_thread::get_id();
27
    std::ostringstream oss;
28
    oss << *ad_comm::adprogram_name << this_thread_id << ".hes";
29
    uistream ifs(oss.str().c_str());
28 30
    
29 31
  if (!ifs)
30 32
  {
......
256 258
       // set convergence criterion for this phase
257 259
       if (!(!convergence_criteria))
258 260
       {
259
         int ind=min(convergence_criteria.indexmax(),
261
         int ind=min(convergence_criteria->indexmax(),
260 262
           initial_params::current_phase);
261
         fmc.crit=convergence_criteria(ind);
263
         fmc.crit = (*convergence_criteria)(ind);
262 264
       }
263 265
       if (!(!maximum_function_evaluations))
264 266
       {
265
 	int ind=min(maximum_function_evaluations.indexmax(),
267
 	int ind=min(maximum_function_evaluations->indexmax(),
266 268
           initial_params::current_phase);
267
         fmc.maxfn=int(maximum_function_evaluations(ind));
269
         fmc.maxfn=int((*maximum_function_evaluations)(ind));
268 270
       }
269 271
       int itnsave=0;
270 272
       //double weight=pow(50.0,profile_phase)/(sigma*sigma);

Also available in: Unified diff