@@ -232,11 +232,11 @@ struct fe_ls_elliptic {
232232 int old_n_obs = n_obs_;
233233 if (nan_pattern.any ()) {
234234 n_obs_ = n_locs_ - nan_pattern.count ();
235- B_ = nan_pattern.repeat (1 , n_dofs_).select (Psi_, 0 );
236- y_ = nan_pattern.select (y_, 0 );
235+ B_ = (~ nan_pattern) .repeat (1 , n_dofs_).select (Psi_, 0 );
236+ y_ = (~ nan_pattern) .select (y_, 0 );
237237 }
238238 if (old_n_obs != n_obs_) { W_ *= (double )old_n_obs / n_obs_; }
239- b_.block (0 , 0 , n_dofs_, 1 ) = -PsiNA ().transpose () * D_ * W_ * y ;
239+ b_.block (0 , 0 , n_dofs_, 1 ) = -PsiNA ().transpose () * D_ * W_ * y_ ;
240240 // enforce dirichlet bc, if any
241241 for (int i = 0 ; i < dirichlet_dofs_.size (); ++i) { b_.row (dirichlet_dofs_[i]).setConstant (dirichlet_vals_[i]); }
242242 return ;
@@ -267,10 +267,10 @@ struct fe_ls_elliptic {
267267 y_ = y;
268268 // correct \Psi for missing observations
269269 auto nan_pattern = na_matrix (y);
270- if (nan_pattern.any ()) {
270+ if (nan_pattern.any ()) {
271271 n_obs_ = n_locs_ - nan_pattern.count ();
272- B_ = nan_pattern.repeat (1 , n_dofs_).select (Psi_, 0 );
273- y_ = nan_pattern.select (y_, 0 );
272+ B_ = (~ nan_pattern) .repeat (1 , n_dofs_).select (Psi_, 0 );
273+ y_ = (~ nan_pattern) .select (y_, 0 );
274274 }
275275 update_weights (W);
276276 return ;
0 commit comments