src/run_approx_rgbr.cpp
// Replicates code from StreetInitial().
Replicates code from StreetInitial().
Replicates code from StreetInitial () .
void PreResponder::DoTask(void) {
  int nst = p0_node_->Street();
  int pst = nst - 1;
  int num_boards = BoardTree::NumBoards(nst);
  int pred_num_hole_card_pairs = Game::NumHoleCardPairs(pst);
  int max_card1 = Game::MaxCard() + 1;
  unique_ptr<int []> pred_canons(CreatePredCanons(trunk_hand_tree_.get(), pst, pbd_));
  ret_vals_.reset(new double[pred_num_hole_card_pairs]);
  total_num_samples_ = 0;
  for (int i = 0; i < pred_num_hole_card_pairs; ++i) ret_vals_[i] = 0;
  for (int ngbd = thread_index_; ngbd < num_boards; ngbd += num_threads_) {
    if (! has_continuation_[nst][ngbd]) continue;
    int board_variants = BoardTree::NumVariants(nst, ngbd);
    total_num_samples_ += board_variants;
    SetStreetBuckets(nst, ngbd);
    auto next_vals = Process(p0_node_, p1_node_, *reach_probs_, ngbd, action_sequence_, nst);
    const CanonicalCards *hands = trunk_hand_tree_->Hands(nst, ngbd);
    int num_next_hands = hands->NumRaw();
    for (int nhcp = 0; nhcp < num_next_hands; ++nhcp) {
      const Card *cards = hands->Cards(nhcp);
      Card hi = cards[0];
      Card lo = cards[1];
      int enc = hi * max_card1 + lo;
      int pred_canon = pred_canons[enc];
      ret_vals_[pred_canon] += board_variants * next_vals[nhcp];
    }
  }
}
void PreResponder :: DoTask ( void ) { int nst = p0_node_ -> Street ( ) ; int pst = nst - 1 ; int num_boards = BoardTree :: NumBoards ( nst ) ; int pred_num_hole_card_pairs = Game :: NumHoleCardPairs ( pst ) ; int max_card1 = Game :: MaxCard ( ) + 1 ; unique_ptr < int [ ] > pred_canons ( CreatePredCanons ( trunk_hand_tree_ . get ( ) , pst , pbd_ ) ) ; ret_vals_ . reset ( new double [ pred_num_hole_card_pairs ] ) ; total_num_samples_ = 0 ; for ( int i = 0 ; i < pred_num_hole_card_pairs ; ++ i ) ret_vals_ [ i ] = 0 ; for ( int ngbd = thread_index_ ; ngbd < num_boards ; ngbd += num_threads_ ) { if ( ! has_continuation_ [ nst ] [ ngbd ] ) continue ; int board_variants = BoardTree :: NumVariants ( nst , ngbd ) ; total_num_samples_ += board_variants ; SetStreetBuckets ( nst , ngbd ) ; auto next_vals = Process ( p0_node_ , p1_node_ , * reach_probs_ , ngbd , action_sequence_ , nst ) ; const CanonicalCards * hands = trunk_hand_tree_ -> Hands ( nst , ngbd ) ; int num_next_hands = hands -> NumRaw ( ) ; for ( int nhcp = 0 ; nhcp < num_next_hands ; ++ nhcp ) { const Card * cards = hands -> Cards ( nhcp ) ; Card hi = cards [ 0 ] ; Card lo = cards [ 1 ] ; int enc = hi * max_card1 + lo ; int pred_canon = pred_canons [ enc ] ; ret_vals_ [ pred_canon ] += board_variants * next_vals [ nhcp ] ; } } }
Replicates code from StreetInitial().
Replicates code from StreetInitial () .
// Assumes we are splitting on the flop