Revision 1490 trunk/src/df1b2-separable/df1b2f15.cpp

df1b2f15.cpp (revision 1490)
66 66
  pen+=pen1;
67 67
}
68 68

  
69
void set_value(const df1b2vector& _x,const init_df1b2vector& _v, const int& _ii,
70
  double fmin,double fmax,const df1b2variable& fpen,double s);
69 71
/**
70 72
 * Description not yet available.
71 73
 * \param
......
80 82
 * \param sf Scale factor
81 83
 * The function minimizer will work internally with x*df, where x is the parameter in the model.
82 84
 */
83
 void initial_df1b2params::set_scalefactor(const double sf)
84
 {
85
   scalefactor=sf;
86
 }
85
void initial_df1b2params::set_scalefactor(const double sf)
86
{
87
  scalefactor=sf;
88
}
87 89

  
88

  
89

  
90

  
91 90
int initial_df1b2params::set_index(void)
92 91
{
93 92
  int ii=1;
......
117 116

  
118 117
  int mmin=indexmin();
119 118
  int mmax=indexmax();
120
  for (int i=mmin;i<=mmax;i++)
119
  if (scalefactor==0.0)
121 120
  {
122
    (*this)(i) = (x(ii++));
121
    for (int i=mmin;i<=mmax;i++)
122
    {
123
      (*this)(i) = (x(ii++));
124
    }
123 125
  }
126
  else
127
  {
128
    for (int i=mmin;i<=mmax;i++)
129
    {
130
      (*this)(i) = (x(ii++)/scalefactor);
131
    }
132
  }
124 133
}
125 134

  
126 135
/**
......
561 570
     //  << " " << v(ii-1) << " " << x(i) << endl;
562 571
  }
563 572
}
573
void set_value(const df1b2vector& _x,const init_df1b2vector& _v, const int& _ii,
574
  double fmin,double fmax,const df1b2variable& fpen,double s)
575
{
576
  ADUNCONST(int,ii)
577
  ADUNCONST(df1b2vector,x)
578
  ADUNCONST(init_df1b2vector,v)
579
  int min=x.indexmin();
580
  int max=x.indexmax();
581
  for (int i=min;i<=max;i++)
582
  {
583
    x(i)=boundp(v(ii++),fmin,fmax,fpen,s);
584
    //cout << setprecision(15) << fpen << " " << fmin << " " << fmax
585
     //  << " " << v(ii-1) << " " << x(i) << endl;
586
  }
587
}
564 588

  
565 589
/**
566 590
 * Description not yet available.
......
570 594
  const int& ii,const df1b2variable& pen)
571 595
{
572 596
  init_df1b2vector& x=(init_df1b2vector&) _x;
573
  if (initial_params::mc_phase)
597

  
598
  if (scalefactor==0.0)
574 599
  {
575
    ::set_value_mc(*this,x,ii,minb,maxb);
600
    if (initial_params::mc_phase)
601
    {
602
      ::set_value_mc(*this,x,ii,minb,maxb);
603
    }
604
    else
605
    {
606
      ::set_value(*this,x,ii,minb,maxb,pen);
607
    }
576 608
  }
577 609
  else
578 610
  {
579
    ::set_value(*this,x,ii,minb,maxb,pen);
611
    if (initial_params::mc_phase)
612
    {
613
      // should this have scalefactor ??
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff