From 739516e961faae217ffc023c68c9f25b6e3c782b Mon Sep 17 00:00:00 2001 From: Dmitriy Selivanov Date: Tue, 13 Dec 2022 21:08:00 +0800 Subject: [PATCH] fix accidentally introduced segfault --- inst/include/wrmf_implicit.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/include/wrmf_implicit.hpp b/inst/include/wrmf_implicit.hpp index 7bd5850..d8fe1c7 100644 --- a/inst/include/wrmf_implicit.hpp +++ b/inst/include/wrmf_implicit.hpp @@ -182,17 +182,17 @@ T als_implicit(const dMappedCSC& Conf, arma::Mat& X, arma::Mat& Y, arma::Col confidence = arma::conv_to >::from(arma::vec(&Conf.values[p1], p2 - p1)); X_nnz = X.cols(idx); + init = Y.col(i); // if is_x_bias_last_row == true // X_nnz = [1, ...] // if is_x_bias_last_row == false // X_nnz = [..., 1] if (with_biases) { X_nnz = drop_row(X_nnz, is_x_bias_last_row); - // init = drop_row(init, !is_x_bias_last_row); + init = drop_row(init, !is_x_bias_last_row); } if (solver == CONJUGATE_GRADIENT) { - init = Y.col(i); if (!with_biases && !global_bias) Y_new = cg_solver_implicit(X_nnz, confidence, init, cg_steps, XtX); else if (with_biases) {