TDenseVector CAR_DKW_o::ObservationEquation(int j, const TDenseVector &xt_tm1) { TDenseVector model_IE_options_vector = CAR_DKW::ObservationEquation(j, xt_tm1); if (dataP->IE_options(j,0) != MINUS_INFINITY) { TDenseMatrix tmp_b(b); tmp_b.CopyContent(b); b.Zeros(tmp_b.rows+bI_Q.rows, tmp_b.cols); b.Insert(0,0,tmp_b); b.Insert(tmp_b.rows, 1, bI_Q); TDenseVector tmp_a(a); tmp_a.CopyContent(a); a.Zeros(tmp_a.Dimension()+aI_Q.Dimension()); a.Insert(0, tmp_a); a.Insert(tmp_a.Dimension(), aI_Q); TDenseVector tmp_y_obs(y_obs); tmp_y_obs.CopyContent(y_obs); y_obs.Zeros(tmp_y_obs.Dimension()+2); y_obs.Insert(0,tmp_y_obs); y_obs(tmp_y_obs.Dimension()) = (dataP->IE_options(j,0)+dataP->IE_options(j,1)+dataP->IE_options(j,2))/3.0; y_obs(tmp_y_obs.Dimension()+1) = (dataP->IE_options(j,3)+dataP->IE_options(j,5)+dataP->IE_options(j,5))/3.0; TDenseMatrix tmp_R(R); tmp_R.CopyContent(R); R.Zeros(tmp_R.rows+delta_options.Dimension(), tmp_R.cols+delta_options.Dimension()); R.Insert(0,0,tmp_R); for (int i=0; i<delta_options.Dimension(); i++) R(i+tmp_R.rows, i+tmp_R.cols) = delta_options(i) * delta_options(i); model_IE_options_vector = aI_Q + bI_Q * xt_tm1.SubVector(1,3); } return model_IE_options_vector; }
Matrix * MatrixMultiply(Matrix *out,const Matrix *a,const Matrix *b) { if(out==nullptr) return nullptr; memset(out,0,sizeof(Matrix)); Matrix tmp_a(*a); Matrix tmp_b(*b); for(int i=0;i<4;++i) for(int j=0;j<4;++j) for(int k=0;k<4;++k) { out->m[i][j]+=(tmp_a.m[i][k]*tmp_b.m[k][j]); } return out; }
void datawidth::entry() { sc_unsigned tmp_a (in1_width); sc_unsigned tmp_b (in2_width); sc_unsigned tmp_result (result_width); while (true) { // HANDSHAKING do { wait(); } while (ready != 1); // COMPUTATION tmp_a = in1.read(); tmp_b = in2.read(); tmp_result = tmp_a + tmp_b; // WRITE OUTPUT result.write(tmp_result); // result = in1 + in2 wait(); } }