Commit 8b33972e authored by gbalduzz's avatar gbalduzz
Browse files

fixed index selection in multinsert test

parent ba112b4c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ using MatrixPair = std::array<Matrix, 2>;

auto getVertexRng = [](int id) {
  const double n_vertices = 12.;
  return (n_vertices - id - 0.1) / n_vertices;
  return (n_vertices - id - 0.5) / n_vertices;
};

// Compare single versus double update without a submatrix update.
@@ -67,10 +67,10 @@ TEST_F(G0Setup, NoSubmatrix) {
  rng.setNewValues(std::vector<double>{getVertexRng(8), 0.19, 1, 0});
  walker_single.tryVertexInsert();

  // interaction, trash, trash, accept
  rng.setNewValues(std::vector<double>{0, 0, 0, 0});
  // interaction, accept
  rng.setNewValues(std::vector<double>{0, 0});
  walker_single.tryVertexRemoval();
  rng.setNewValues(std::vector<double>{0, 0, 0, 0});
  rng.setNewValues(std::vector<double>{0, 0});
  walker_single.tryVertexRemoval();

  auto M1 = walker_single.getM();
@@ -158,8 +158,8 @@ TEST_F(G0Setup, Submatrix) {
  WalkerSubmatrix walker_subm(parameters_, rng);

  std::vector<double> random_vals{// (insert, first_id, partner_id, tau, aux, tau, aux, accept) x 2
                                  0, getVertexRng(6), 0, 0.41, 0, 0.53, 1, 0,
                                  0, getVertexRng(7), 0.9, 0.34, 0, 0.36, 0, 0,
                                  0, getVertexRng(6), 0, 0.41, 0, 0.53, 1, 0, 0, getVertexRng(7),
                                  0.9, 0.34, 0, 0.36, 0, 0,
                                  // remove, first_id, double_removal, second_id, accept
                                  1, 0, 0, 0, 0};

+2 −2
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ TYPED_TEST(CtintWalkerSubmatrixGpuTest, doSteps) {
  SbmWalkerGpu::setDMatrixBuilder(g0_gpu);
  SbmWalkerGpu::setDMatrixAlpha(parameters.getAlphas(), false);

  SubmatrixWalker<CPU>::setInteractionVertices(*data_, parameters_);
  SubmatrixWalker<GPU>::setInteractionVertices(*data_, parameters_);
  SbmWalkerCpu::setInteractionVertices(data, parameters);
  SbmWalkerGpu::setInteractionVertices(data, parameters);

  // ************************************
  // Test vertex insertion / removal ****
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
    "t"       : 0,
    "U"       : 1,
    "V"       : 0,
    "Jh"      : 2
    "Jh"      : 1
  },