src/vcfr.cpp
// This implementation does not round regrets to ints, nor do scaling.
This implementation does not round regrets to ints, nor do scaling.
This implementation does not round regrets to ints nor do scaling .
void VCFR::UpdateRegretsBucketed(Node *node, int *street_buckets, double *vals,
				 shared_ptr<double []> *succ_vals, double *regrets) {
  int st = node->Street();
  int num_succs = node->NumSuccs();
  int num_hole_card_pairs = Game::NumHoleCardPairs(st);
  double floor = regret_floors_[st];
  double ceiling = regret_ceilings_[st];
  if (nn_regrets_) {
    for (int i = 0; i < num_hole_card_pairs; ++i) {
      int b = street_buckets[i];
      double *my_regrets = regrets + b * num_succs;
      for (int s = 0; s < num_succs; ++s) {
	double newr = my_regrets[s] + succ_vals[s][i] - vals[i];
	if (newr < floor) {
	  my_regrets[s] = floor;
	} else if (newr > ceiling) {
	  my_regrets[s] = ceiling;
	} else {
	  my_regrets[s] = newr;
	}
      }
    }
  } else {
    for (int i = 0; i < num_hole_card_pairs; ++i) {
      int b = street_buckets[i];
      double *my_regrets = regrets + b * num_succs;
      for (int s = 0; s < num_succs; ++s) {
	my_regrets[s] += succ_vals[s][i] - vals[i];
      }
    }
  }
}
void VCFR :: UpdateRegretsBucketed ( Node * node , int * street_buckets , double * vals , shared_ptr < double [ ] > * succ_vals , double * regrets ) { int st = node -> Street ( ) ; int num_succs = node -> NumSuccs ( ) ; int num_hole_card_pairs = Game :: NumHoleCardPairs ( st ) ; double floor = regret_floors_ [ st ] ; double ceiling = regret_ceilings_ [ st ] ; if ( nn_regrets_ ) { for ( int i = 0 ; i < num_hole_card_pairs ; ++ i ) { int b = street_buckets [ i ] ; double * my_regrets = regrets + b * num_succs ; for ( int s = 0 ; s < num_succs ; ++ s ) { double newr = my_regrets [ s ] + succ_vals [ s ] [ i ] - vals [ i ] ; if ( newr < floor ) { my_regrets [ s ] = floor ; } else if ( newr > ceiling ) { my_regrets [ s ] = ceiling ; } else { my_regrets [ s ] = newr ; } } } } else { for ( int i = 0 ; i < num_hole_card_pairs ; ++ i ) { int b = street_buckets [ i ] ; double * my_regrets = regrets + b * num_succs ; for ( int s = 0 ; s < num_succs ; ++ s ) { my_regrets [ s ] += succ_vals [ s ] [ i ] - vals [ i ] ; } } } }
This implementation does not round regrets to ints, nor do scaling.
This implementation does not round regrets to ints nor do scaling .