Revision 692 branches/merge-trunk-davef/src/df1b2-separable/fquadpri.cpp

fquadpri.cpp (revision 692)
11 11
static char unallocatederror[] = " Trying to access unallocated"
12 12
 " matrix in df1b2quadratic_prior";
13 13

  
14
int quadratic_prior::sparse_flag=0;
15
int quadratic_prior::calc_matrix_flag=0;
16
int quadratic_prior::matrix_mult_flag=0;
14 17
 df1b2quadratic_prior * df1b2quadratic_prior::ptr[100]; // this should be a resizeable array
15 18
 int df1b2quadratic_prior::num_quadratic_prior=0;
16 19
 const int df1b2quadratic_prior::max_num_quadratic_prior=100;
......
87 90
    pu=0; 
88 91
    index=0;
89 92
    Lxu=0;
93
    SCM=0;
94
    DFSCM=0;
95
    S_dfpMinv=0;
96
    dfpMinv=0;
97
    CM=0;
90 98
  } 
99

  
91 100
  df1b2quadratic_prior::~df1b2quadratic_prior(void)
92 101
  {
102
    deallocate();
103
    if (pu) delete pu;
104
    pu=0; 
105
  }
106
  void df1b2quadratic_prior::deallocate(void)
107
  {
93 108
    if (index) delete index; 
94 109
    index=0;
110
    if (DFSCM) delete DFSCM;
111
    DFSCM=0;
112
    if (CM) delete SCM;
113
    CM=0;
114
    if (SCM) delete SCM;
115
    SCM=0;
95 116
    if (Lxu) delete Lxu;
96 117
    Lxu=0;
97 118
    if (M) delete M;
98 119
    M=0; 
99
    if (pu) delete pu;
100
    pu=0; 
120
    //if (pu) delete pu;
121
    //pu=0; 
122
    if (S_dfpMinv)
123
      delete S_dfpMinv;
124
    S_dfpMinv=0;
125
    if (dfpMinv)
126
      delete dfpMinv;
127
    dfpMinv=0;
101 128
  } 
102 129

  
103 130

  
......
123 150
  void df1b2quadratic_prior::operator = (const df1b2matrix & M)
124 151
  { 
125 152
    quadratic_prior::in_qp_calculations=0; 
126
    num_active_parameters=funnel_init_var::num_vars;
153
    num_active_parameters=funnel_init_var::num_active_parameters;
127 154
    df1b2_gradlist::no_derivatives=1;
128 155
    dvector cu=value(*pu);
129 156

  
......
215 242
    df1b2_gradlist::no_derivatives=0;
216 243
  }
217 244

  
245
  void df1b2quadratic_prior::operator = (const df1b2_compressed_triplet & _M)
246
  { 
247
    ADUNCONST(df1b2_compressed_triplet,M)
248
    quadratic_prior::in_qp_calculations=0; 
249
    num_active_parameters=funnel_init_var::num_active_parameters;
250
    df1b2_gradlist::no_derivatives=1;
251
    dvector cu=value(*pu);
252

  
253
    if (laplace_approximation_calculator::where_are_we_flag==3) 
254
    {
255
      df1b2variable::noallocate=1;
256
      df1b2vector v(1,M.get_n());
257
      df1b2variable::noallocate=0;
258
      switch (old_style_flag)
259
      {
260
      case 0:
261
      case 1:
262
        cerr << "Error -- no solve defined yet" << endl;
263
        ad_exit(1);
264
        //v = solve(M,cu);
265
        break;
266
      case 2:
267
        v = M*cu;
268
        break;
269
      default:
270
        cerr << "Illegal value for quadratic_prior::old_style_flag"
271
             << endl;
272
        ad_exit(1);
273
      }
274
      int mmin=v.indexmin();
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff