From: Sebastián Mancilla Subject: [PATCH] Fix compile errors when using Eigen 3.4 --- .../machine/gp/MultiLaplaceInferenceMethod.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp index 2e27678d2..60050afea 100644 --- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp +++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp @@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base float64_t result=0; for(index_t bl=0; blblock(bl*n,0,n,1)*CMath::exp(log_scale*2.0); - result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0; - eigen_f.block(bl*n,0,n,1)+=eigen_m; + eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0); + result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0; + eigen_f.segment(bl*n,n)+=eigen_m; } // get first and second derivatives of log likelihood @@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha() { Map alpha(m_alpha.vector, m_alpha.vlen); for(index_t bl=0; bl chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+ MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols)); MatrixXd eigen_L_tmp=chol_tmp.matrixU(); @@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha() VectorXd tmp2=m_tmp.array().rowwise().sum(); for(index_t bl=0; bl &eigen_c=eigen_W; for(index_t bl=0; bl c_tmp(eigen_c.data(),n,C); @@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix CMultiLaplaceInferenceMethod::get_derivative_wrt_mean( result[i]=0; //currently only compute the explicit term for(index_t bl=0; bl