Revision 1513

trunk/src/nh99/admodel.h (revision 1513)
868 868
  virtual void save_value(void)=0; // save the objects value in a ascii file
869 869
  virtual void bsave_value(void)=0; // save the objects value in a binary file
870 870
  virtual void save_value(const ofstream& ofs, int prec) = 0;
871
  virtual void save_value(const ofstream& ofs, int prec,const dvector&,int& offset) = 0;
871 872
  //virtual void bsave_value(const uostream& ofs) = 0;
872 873
    virtual const char * label()=0;
873 874
  void allocate(int _phase_start);
......
878 879
  initial_params(void);
879 880
  static void xinit(const dvector& x); // get the number of active parameters
880 881
  static void xinit_all(const dvector& x); // get the number of active parameters
882
  static void save_all(const ofstream& _ofs,int prec,const dvector&g);
881 883
  static void set_active_random_effects(void); // get the number of active parameters
882 884
  static void set_active_only_random_effects(void); // get the number of active parameters
883 885
  static void set_inactive_only_random_effects(void); // get the number of active parameters
......
963 965
  virtual void save_value(void);
964 966
  virtual void bsave_value(void);
965 967
  virtual void save_value(const ofstream& ofs, int prec);
968
  virtual void save_value(const ofstream& ofs, int prec,const dvector&,int& offset);
966 969
  virtual void restore_value(const ifstream& ifs);
967 970
  void report_value(void);
968 971
  //virtual void read_value(void);
......
1047 1050
  friend class param_init_bounded_vector_vector;
1048 1051
  virtual const char * label(void);
1049 1052
  virtual void save_value(const ofstream& ofs, int prec);
1053
  virtual void save_value(const ofstream& ofs, int prec,const dvector&,int& offset);
1050 1054
  virtual void restore_value(const ifstream& ifs);
1051 1055
  virtual void save_value(void);
1052 1056
  virtual void bsave_value(void);
......
1117 1121
  virtual void set_value_inv(const dvector& x, const int& ii);
1118 1122
  virtual int size_count(void);
1119 1123
  virtual void save_value(const ofstream& ofs, int prec);
1124
  virtual void save_value(const ofstream& ofs, int prec,const dvector&,int& offset);
1120 1125
  virtual void restore_value(const ifstream& ifs);
1121 1126
  virtual void save_value(void);
1122 1127
  virtual void bsave_value(void);
......
1249 1254
  virtual void set_value_inv(const dvector& x, const int& ii);
1250 1255
  virtual int size_count(void);
1251 1256
  virtual void save_value(void);
1257
  virtual void save_value(const ofstream& ofs, int prec,const dvector&,int& offset);
1252 1258
  virtual void bsave_value(void);
1253 1259
  virtual void save_value(const ofstream& ofs, int prec);
1254 1260
  virtual void restore_value(const ifstream& ifs);
trunk/src/nh99/model12.cpp (revision 1513)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California
5
 * Copyright (c) 2008-2014 Regents of the University of California 
6 6
 */
7 7
#include <admodel.h>
8 8

  
9 9
void initial_params::save(const ofstream& _ofs, int prec)
10
{
11
  ofstream& ofs=(ofstream&)_ofs;
12
  ofs << setw(prec+6) << setshowpoint();
13
  for (int i=0;i<num_initial_params;i++)
10 14
  {
11
    ofstream& ofs=(ofstream&) _ofs;
12
    ofs << setw(prec+6) << setshowpoint();
13
    for (int i=0;i<num_initial_params;i++)
14
    {
15
      (varsptr[i])->save_value(ofs,prec);
16
    }
15
    (varsptr[i])->save_value(ofs,prec);
17 16
  }
17
}
18 18

  
19 19
void param_init_number::save_value(const ofstream& _ofs, int prec)
20
  {
21
    ofstream& ofs=(ofstream&) _ofs;
22
    #ifndef __ZTC__
23
      ofs << setprecision(prec) << dvariable(*this) << endl;
24
    #else
25
      ofs << setw(prec+6) << setprecision(prec) << *this << endl;
26
    #endif
27
  }
20
{
21
  ofstream& ofs=(ofstream&)_ofs;
22
#ifndef __ZTC__
23
  ofs << setprecision(prec) << dvariable(*this) << endl;
24
#else
25
  ofs << setw(prec+6) << setprecision(prec) << *this << endl;
26
#endif
27
}
28 28

  
29 29
void param_init_vector::save_value(const ofstream& _ofs, int prec)
30
{
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff