Skip to content

Commit

Permalink
fix accidentally introduced segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
dselivanov committed Dec 13, 2022
1 parent cb1c75c commit 739516e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inst/include/wrmf_implicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ T als_implicit(const dMappedCSC& Conf, arma::Mat<T>& X, arma::Mat<T>& Y,
arma::Col<T> confidence =
arma::conv_to<arma::Col<T> >::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<T>(X_nnz, is_x_bias_last_row);
// init = drop_row<T>(init, !is_x_bias_last_row);
init = drop_row<T>(init, !is_x_bias_last_row);
}

if (solver == CONJUGATE_GRADIENT) {
init = Y.col(i);
if (!with_biases && !global_bias)
Y_new = cg_solver_implicit<T>(X_nnz, confidence, init, cg_steps, XtX);
else if (with_biases) {
Expand Down

0 comments on commit 739516e

Please sign in to comment.