Revision 1935 trunk/src/nh99/mod_hess.cpp

mod_hess.cpp (revision 1935)
4 4
 * Author: David Fournier
5 5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7
#if defined(USE_LAPLACE)
8 7
#  include <df1b2fun.h>
9
#else
10 8
#  include <admodel.h>
11
#endif
12 9
//#include <parallel.h>
13 10

  
14 11
void hess_calcreport(int i,int nvar);
......
20 17

  
21 18
void function_minimizer::hess_routine(void)
22 19
{
23
#if defined(USE_LAPLACE)
24 20
  if (random_effects_flag && lapprox !=0 )
25 21
  {
26 22
    hess_routine_random_effects();
27 23
  }
28 24
  else
29 25
  {
30
#endif
31 26
#if !defined(USE_ADPVM)
32 27
    hess_routine_noparallel();
33 28
#else
......
52 47
      cout << "finished hess routine" << endl;
53 48
    }
54 49
#endif
55
#if defined(USE_LAPLACE)
56 50
  }
57
#endif
58 51
}
59 52
void function_minimizer::hess_routine_noparallel(void)
60 53
{
......
435 428
  if (ad_comm::wd_flag)
436 429
     tmpstring = ad_comm::adprogram_name + ".dep";
437 430
  ofstream ofs((char*)tmpstring);
438
#if defined(USE_LAPLACE)
439 431
  if (lapprox)
440 432
  {
441 433
    lapprox->no_function_component_flag=1;
442 434
  }
443
#endif
444 435

  
445 436
  dvariable vf;
446 437
  vf=initial_params::reset(dvar_vector(x));
......
460 451
     ofs << stddev_params::stddevptr[i]->label() << "  ";
461 452
     ofs << stddev_params::stddevptr[i]->size_count() << endl;
462 453
  }
463
#if defined(USE_LAPLACE)
464 454
  if (lapprox)
465 455
  {
466 456
    lapprox->no_function_component_flag=0;
467 457
  }
468
#endif
469 458
  gradient_structure::set_NO_DERIVATIVES();
470 459
}
471 460
/**
......
561 550
     << "sorted:\t" << se << endl;
562 551
     if (se(se.indexmin())<=0.0)
563 552
      {
564
#if defined(USE_LAPLACE)
565 553
        negative_eigenvalue_flag=1;
566
#endif
567 554
        cout << "Warning -- Hessian does not appear to be"
568 555
         " positive definite" << endl;
569 556
      }

Also available in: Unified diff