<commit_before>#include "chrono_parallel/solver/ChSolverAPGD.h"
#include <blaze/math/CompressedVector.h>
using namespace chrono;

ChSolverAPGD::ChSolverAPGD()
    : ChSolverParallel(),
      mg_tmp_norm(0),
      mb_tmp_norm(0),
      obj1(0),
      obj2(0),
      norm_ms(0),
      dot_g_temp(0),
      theta(1),
      theta_new(0),
      beta_new(0),
      t(0),
      L(0),
      g_diff(0) {
}

void ChSolverAPGD::UpdateR() {
  const CompressedMatrix<real>& D_n_T = data_manager->host_data.D_n_T;
  const DynamicVector<real>& M_invk = data_manager->host_data.M_invk;
  const DynamicVector<real>& b = data_manager->host_data.b;
  DynamicVector<real>& R = data_manager->host_data.R;
  DynamicVector<real>& s = data_manager->host_data.s;

  uint num_contacts = data_manager->num_rigid_contacts;

  s.resize(data_manager->num_rigid_contacts);
  reset(s);

  rigid_rigid->Build_s();

  ConstSubVectorType b_n = blaze::subvector(b, 0, num_contacts);
  SubVectorType R_n = blaze::subvector(R, 0, num_contacts);
  SubVectorType s_n = blaze::subvector(s, 0, num_contacts);

  R_n = -b_n - D_n_T * M_invk + s_n;<commit_msg>Update ChSolverAPGD.cpp<commit_after>#include "chrono_parallel/solver/ChSolverAPGD.h"
#include <blaze/math/CompressedVector.h>
using namespace chrono;

ChSolverAPGD::ChSolverAPGD()
    : ChSolverParallel(),
      mg_tmp_norm(0),
      mb_tmp_norm(0),
      obj1(0),
      obj2(0),
      norm_ms(0),
      dot_g_temp(0),
      theta(1),
      theta_new(0),
      beta_new(0),
      t(0),
      L(0),
      g_diff(0) {
}

void ChSolverAPGD::UpdateR() {
  const CompressedMatrix<real>& D_n_T = data_manager->host_data.D_n_T;
  const DynamicVector<real>& M_invk = data_manager->host_data.M_invk;
  const DynamicVector<real>& b = data_manager->host_data.b;
  DynamicVector<real>& R = data_manager->host_data.R;
  DynamicVector<real>& s = data_manager->host_data.s;

  uint num_contacts = data_manager->num_rigid_contacts;

  s.resize(data_manager->num_rigid_contacts);
  reset(s);

  rigid_rigid->Build_s();

  ConstSubVectorType b_n = blaze::subvector(b, 0, num_contacts);
  SubVectorType R_n = blaze::subvector(R, 0, num_contacts);
  SubVectorType s_n = blaze::subvector(s, 0, num_contacts);

  R_n = -b_n - D_n_T * M_invk - s_n;
{'fraction_non_alphanumeric': 0.13782337198929528, 'fraction_numerical': 0.015165031222123104, 'mean_word_length': 4.19212962962963, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4765237', 'n_tokens_mistral': 930, 'n_tokens_neox': 904, 'n_words': 134}