ADMB Documentation  11.1.1733
 All Classes Files Functions Variables Typedefs Friends Defines
admodhd.h
Go to the documentation of this file.
00001 /*
00002  * $Id: admodhd.h 1732 2014-03-04 19:23:42Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  *
00007  * ADModelbuilder and associated libraries and documentations are
00008  * provided under the general terms of the "BSD" license.
00009  *
00010  * License:
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions are
00014  * met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright
00017  * notice, this list of conditions and the following disclaimer.
00018  *
00019  * 2.  Redistributions in binary form must reproduce the above copyright
00020  * notice, this list of conditions and the following disclaimer in the
00021  * documentation and/or other materials provided with the distribution.
00022  *
00023  * 3.  Neither the name of the  University of California, Otter Research,
00024  * nor the ADMB Foundation nor the names of its contributors may be used
00025  * to endorse or promote products derived from this software without
00026  * specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00029  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00030  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00031  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00032  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00033  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00034  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00035  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00036  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  */
00045 #ifndef __ADMOD3D__
00046 #define __ADMOD3D__
00047 
00048 #if defined(__GNUC__)
00049   #if (__GNUC__ < 3)
00050     #pragma interface
00051   #endif
00052 #else
00053   #pragma interface
00054 #endif
00055 
00056 #include <admodel.h>
00057 
00062 class param_init_d3array: public named_dvar3_array,public initial_params
00063 {
00064 public:
00065   virtual void set_value(const dvar_vector& x, const int& ii, const dvariable& pen);
00066   virtual void copy_value_to_vector(const dvector& x, const int& ii);
00067   virtual void restore_value_from_vector(const dvector&, const int&);
00068   virtual void set_value_inv(const dvector& x, const int& ii);
00069   virtual int size_count(void);
00070   virtual void save_value(void);
00071   virtual void save_value(const ofstream& ofs, int prec);
00072   virtual void restore_value(const ifstream& ifs);
00073   void report_value(void);
00074   //virtual void read_value(void);
00075   virtual const char * label(void);
00076   virtual void sd_scale(const dvector& d, const dvector& x, const int& ii);
00077   virtual void hess_scale(const dvector& d, const dvector& x, const int& ii){};
00078 
00079 public:
00080   void allocate(int smin,int smax,int rmin,int rmax,int cmin,int cmax,
00081     int phase_start=1,const char * = "UNNAMED");
00082   void allocate(int smin,int smax,int rmin,int rmax,int cmin,int cmax,
00083     const char * = "UNNAMED");
00084   void allocate(int smin, int smax, const ivector& rmin, const ivector& rmax,
00085     int cmin,int cmax,int phase_start=1,const char * = "UNNAMED");
00086   void allocate(int smin, int smax, const ivector& rmin, const ivector& rmax,
00087     int cmin,int cmax, const char * = "UNNAMED");
00088   void allocate(int smin, int smax, const ivector& rmin, int rmax, int cmin,
00089     int cmax,int phase_start=1,const char * = "UNNAMED");
00090   void allocate(int smin, int smax, const ivector& rmin, int rmax, int cmin,
00091     int cmax,const char * = "UNNAMED");
00092   void allocate(int smin, int smax, int rmin, const ivector& rmax, int cmin,
00093     int cmax,int phase_start=1,const char * = "UNNAMED");
00094   void allocate(int smin, int smax, int rmin, const ivector& rmax, int cmin,
00095     int cmax,const char * = "UNNAMED");
00096   param_init_d3array(void);
00097 };
00098 
00103 class param_init_bounded_d3array: public param_init_d3array
00104 {
00105   double minb;
00106   double maxb;
00107 public:
00108   virtual void set_value(const dvar_vector& x, const int& ii, const dvariable& pen);
00109   virtual void set_value_inv(const dvector& x, const int& ii);
00110   virtual void sd_scale(const dvector& d, const dvector& x, const int& ii);
00111   virtual void hess_scale(const dvector& d, const dvector& x, const int& ii){};
00112 
00113 public:
00114   void allocate(int smin,int smax,int rmin,int rmax,int cmin,int cmax,
00115     double _minb,double _maxb,
00116     int phase_start=1,const char * = "UNNAMED");
00117   void allocate(int smin,int smax,int rmin,int rmax,int cmin,int cmax,
00118     double _minb,double _maxb,const char * = "UNNAMED");
00119   void allocate(int smin, int smax, const ivector& rmin, int rmax, int cmin, int cmax,
00120     double _minb,double _maxb,
00121     int phase_start=1,const char * = "UNNAMED");
00122   void allocate(int smin, int smax, const ivector& rmin,int rmax,int cmin,int cmax,
00123     double _minb,double _maxb,const char * = "UNNAMED");
00124   void allocate(int smin, int smax, const ivector& rmin, const ivector& rmax, int cmin, int cmax,
00125     double _minb,double _maxb,
00126     int phase_start=1,const char * = "UNNAMED");
00127   void allocate(int smin, int smax, const ivector& rmin, const ivector& rmax, int cmin, int cmax,
00128     double _minb,double _maxb,const char * = "UNNAMED");
00129   void allocate(int smin, int smax, int rmin, const ivector& rmax, int cmin, int cmax,
00130     double _minb,double _maxb,
00131     int phase_start=1,const char * = "UNNAMED");
00132   void allocate(int smin, int smax, int rmin, const ivector& rmax, int cmin, int cmax,
00133     double _minb,double _maxb,const char * = "UNNAMED");
00134 
00135   param_init_bounded_d3array(void);
00136 };
00137 #endif
00138