Revision 1107 trunk/src/df1b2separable/fquadpri.cpp
fquadpri.cpp (revision 1107)  

2  2 
* $Id$ 
3  3 
* 
4  4 
* Author: David Fournier 
5 
* Copyright (c) 20082012 Regents of the University of California


5 
* Copyright (c) 20082012 Regents of the University of California 

6  6 
*/ 
7  7 
#include <df1b2fun.h> 
8  8  
...  ...  
22  22 
xmyindex=num_quadratic_prior; 
23  23 
ptr[num_quadratic_prior++]=this; 
24  24 
} 
25 
void df1b2quadratic_prior::get_Lxu(dmatrix& M)


25 
void df1b2quadratic_prior::get_Lxu(dmatrix& M) 

26  26 
{ 
27  27 
if (!Lxu  !index) 
28  28 
{ 
...  ...  
83  83 
{ 
84  84 
add_to_list(); 
85  85 
num_active_parameters=0; 
86 
M=0;


87 
pu=0;


86 
M=0; 

87 
pu=0; 

88  88 
index=0; 
89  89 
Lxu=0; 
90 
}


90 
} 

91  91 
df1b2quadratic_prior::~df1b2quadratic_prior(void) 
92  92 
{ 
93 
if (index) delete index;


93 
if (index) delete index; 

94  94 
index=0; 
95  95 
if (Lxu) delete Lxu; 
96  96 
Lxu=0; 
97  97 
if (M) delete M; 
98 
M=0;


98 
M=0; 

99  99 
if (pu) delete pu; 
100 
pu=0;


101 
}


100 
pu=0; 

101 
} 

102  102  
103  
104 
void df1b2quadratic_prior::allocate(const df1b2_init_vector & _u, const char * s) 

103 
void df1b2quadratic_prior::allocate(const df1b2_init_vector & _u, const char * s) 

105  104 
{ 
106  105 
allocate(_u); 
107  106 
} 
108 
void df1b2quadratic_prior::allocate(const df1b2matrix & _M,


109 
const df1b2_init_vector & _u, const char * s)


107 
void df1b2quadratic_prior::allocate(const df1b2matrix & _M, 

108 
const df1b2_init_vector & _u, const char * s) 

110  109 
{ 
111  110 
allocate(_M,_u); 
112  111 
} 
113 
void df1b2quadratic_prior::allocate(const df1b2_init_vector & _u)


112 
void df1b2quadratic_prior::allocate(const df1b2_init_vector & _u) 

114  113 
{ 
115  114 
pu = new df1b2_init_vector(_u); 
116  115 
} 
117 
void df1b2quadratic_prior::allocate(const df1b2matrix & _M,


118 
const df1b2_init_vector & _u)


116 
void df1b2quadratic_prior::allocate(const df1b2matrix & _M, 

117 
const df1b2_init_vector & _u) 

119  118 
{ 
120  119 
M =new df1b2matrix(_M); 
121  120 
pu = new df1b2_init_vector(_u); 
122  121 
} 
123  122 
void df1b2quadratic_prior::operator = (const df1b2matrix & M) 
124 
{


125 
quadratic_prior::in_qp_calculations=0;


123 
{ 

124 
quadratic_prior::in_qp_calculations=0; 

126  125 
num_active_parameters=funnel_init_var::num_vars; 
127  126 
df1b2_gradlist::no_derivatives=1; 
128  127 
dvector cu=value(*pu); 
129  128  
130 
if (laplace_approximation_calculator::where_are_we_flag==3)


129 
if (laplace_approximation_calculator::where_are_we_flag==3) 

131  130 
{ 
132  131 
df1b2variable::noallocate=1; 
133  132 
df1b2vector v(M.indexmin(),M.indexmax()); 
...  ...  
155  154 
delete index; 
156  155 
index=0; 
157  156 
} 
158 


157  
159  158 
if (num_active_parameters>0) 
160  159 
{ 
161  160 
if (!index) 
162  161 
{ 
163  162 
index=new ivector(column(*funnel_init_var::plist,1)); 
Also available in: Unified diff