9 # if defined(USE_SHARE_FLAGS)
17 cerr <<
" Error -- shared_size_count not defined for this class"
26 cerr <<
" Error -- shared_scaled_set_value_inv not defined for this class"
33 cerr <<
" Error -- shared_scaled_set_value_inv not defined for this class"
64 for (
int i=mmin;i<=mmax;i++)
77 for (
int i=mmin;i<=mmax;i++)
91 for (
int i=mmin;i<=mmax;i++)
108 for (
int i=mmin;i<=mmax;i++)
112 for (
int j=jmin;j<=jmax;j++)
118 (*this)(i,j)=
x(ii+is-1);
134 for (
int i=mmin;i<=mmax;i++)
140 (*this)(i)=
x(ii+is-1);
155 for (
int i=mmin;i<=mmax;i++)
159 for (
int j=jmin;j<=jmax;j++)
176 cerr <<
" setshare not yet defined for this class " <<
endl;
278 cerr <<
"error " <<
endl;
283 int fmin = 0, fmax = 0;
286 for (
int i=imin;i<=imax;i++)
290 for (
int j=jmin;j<=jmax;j++)
306 int fmax1=
integer(sf(imin)(sf(imin).indexmin()));
307 int fmin1=
integer(sf(imin)(sf(imin).indexmin()));
308 for (
int i=imin;i<=imax;i++)
312 for (
int j=jmin;j<=jmax;j++)
327 for (
int i=imin;i<=imax;i++)
331 for (
int j=jmin;j<=jmax;j++)
337 i3_array bmap2(fmin1,fmax1,1,icount2,1,2);
339 for (
int i=imin;i<=imax;i++)
343 for (
int j=jmin;j<=jmax;j++)
346 int ind=++icount2(sfvalue);
347 bmap2(sfvalue,ind,1)=i;
348 bmap2(sfvalue,ind,2)=j;
351 for (
int k=fmin1;k<=fmax1;k++)
358 int i1=bmap2(k,lmin,1);
359 int j1=bmap2(k,lmin,2);
362 for (
int l=lmin+1;l<=lmax;l++)
369 cerr <<
"Sanity error in grouping/active flags"
370 <<
endl <<
"for indices (" << i2 <<
"," << j2 <<
")"
382 ivector processed_flag(fmin1,fmax1);
387 for (
int i=imin;i<=imax;i++)
393 for (
int j=jmin;j<=jmax;j++)
399 if (processed_flag(in)==0)
401 processed_flag(in)=1;
402 for (
int k=in;k<=fmax1;k++)
410 imatrix tmp1(imin,imax,mindx,maxx);
411 for (
int i=imin;i<=imax;i++)
415 for (
int j=jmin;j<=jmax;j++)
420 tmp1(i,j)=indirect(
integer(sf(i)(j)));
428 int itmp=indirect(fmax1);
432 for (
int i=imin;i<=imax;i++)
436 for (
int j=jmin;j<=jmax;j++)
441 if (++counter(tmp1(i,j))==1)
449 i3_array _bmap(1,itmp,1,counter,1,2);
453 for (
int i=imin;i<=imax;i++)
457 for (
int j=jmin;j<=jmax;j++)
462 int ind=++counter(tmp1(i,j));
463 _bmap(tmp1(i,j),ind,1)=i;
464 _bmap(tmp1(i,j),ind,2)=j;
470 for (
int i=1;i<=itmp;i++)
471 cout << _bmap(i) << endl <<
endl;
478 cout << tmp1 <<
endl;
492 cerr <<
"error " <<
endl;
503 for (
int i=imin;i<=imax;i++)
510 ivector processed_flag(fmin1,fmax1);
513 for (
int i=imin;i<=imax;i++)
520 if (processed_flag(in)==0)
522 processed_flag(in)=1;
523 for (
int k=in;k<=fmax1;k++)
532 for (
int i=imin;i<=imax;i++)
538 tmp1(i)=indirect(
integer(sf(i)));
546 int itmp=indirect(fmax1);
550 for (
int i=imin;i<=imax;i++)
555 if (++counter(tmp1(i))==1)
575 cout <<
" Error dim too high" <<
endl;
609 cout << idim1 <<
" " << idim2 <<
endl;
617 if (mmin1 != mmin || mmax1 != mmax ||
618 mmin2 != mmin || mmax2 != mmax)
620 cerr <<
"sanity error" <<
endl;
627 cerr <<
"Error" <<
endl;
index_type * get_shareflags(void)
Uses polymorphism to get index information from various data types to be used in constructing and all...
virtual void shared_set_value_inv(const dvector &, const int &)
index_type * original_sflags
Description not yet available.
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Vector of double precision numbers.
friend dvector value(const dvar_vector &v1)
Description not yet available.
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
void set_shareflags(const index_type &sf)
virtual int shared_size_count(void)
virtual void shared_set_value(const dvar_vector &, const int &, const dvariable &pen)
int & get_dimension(void)
void reset_bmap(const i3_array &af)
void set_activeflags(const index_type &af)
index_type * get_activeflags(void)
void fill_seqadd(int, int)
Fills ivector elements with values starting from base and incremented by offset.
virtual void setshare(const index_type &sf, const index_type &af)
void get_inv_matrix_shared(int _cf)
virtual void shared_set_value_inv(const dvector &, const int &)
void set_bmap(const i3_array &af)
prnstream & endl(prnstream &)
int & get_current_phase(void)
double boundpin(double x, double fmin, double fmax, double s)
Scale model variable over [-1,1]; constant objects.
Array of integers(int) with indexes from index_min to indexmax.
virtual void shared_set_value_inv(const dvector &x, const int &ii)
Description not yet available.
Description not yet available.
i3_array & get_bmap(void)
index_type * get_original_shareflags(void)
shareinfo(const index_type &sf, const index_type &af)
void reset_shareflags(const index_type &sf)
virtual void shared_set_value(const dvar_vector &, const int &, const dvariable &pen)
void initialize(void)
Description not yet available.
void get_inv_vector_shared(int _cf)
virtual int shared_size_count(void)
virtual void setshare(const index_type &sf, const index_type &af)
dvariable boundp(const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
virtual void shared_set_value(const dvar_vector &, const int &, const dvariable &pen)
void set_original_shareflags(const index_type &sf)
virtual void setshare(const index_type &sf, const index_type &af)
virtual void shared_set_value_inv(const dvector &, const int &)
void initialize(int sl, int sh, int nrl, const ivector &nrh, int ncl, const ivector &nch)
index_type * get_invflags(void)
dvector value(const df1_one_vector &v)
Description not yet available.
virtual int shared_size_count(void)
void set_invflags(const index_type &af)
virtual void shared_set_value(const dvar_vector &, const int &, const dvariable &pen)
Fundamental data type for reverse mode automatic differentiation.