<commit_before>#ifndef BART_SRC_CONVERGENCE_GROUP_FLUX_CHECKER_SEQUENTIAL_H_
#define BART_SRC_CONVERGENCE_GROUP_FLUX_CHECKER_SEQUENTIAL_H_

#include <memory>

#include "flux_checker_i.h"
#include "group_flux_checker_i.h"


namespace bart {

namespace convergence {

/*! \brief Checks each flux group sequentially for convergence.
 * Will not re-check converged groups until final convergence is believed to
 * have been reached. */

class GroupFluxCheckerSequential : public GroupFluxCheckerI {
 public:
  GroupFluxCheckerSequential() = default;
  GroupFluxCheckerSequential(std::unique_ptr<FluxCheckerI> &tester);
  ~GroupFluxCheckerSequential() = default;
  
  void ProvideChecker(std::unique_ptr<FluxCheckerI> &tester) {
    tester_ = std::move(tester); };
  
  bool isConverged(data::GroupFluxPointers &current,
                   data::GroupFluxPointers &last);
  int GetFailedGroup() const { return failed_group_; };

 private:
  /*! Flux convergence tester that will be used to check sequentially */
  std::unique_ptr<FluxCheckerI> tester_;
  /*! Stores the ID of the first group that failed the convergence check */
  int failed_group_; 
};

} // namespace convergence

} // namespace bart

#endif // BART_SRC_CONVERGENCE_GROUP_FLUX_CHECKER_SEQUENTIAL_H_<commit_msg>updated GroupFluxCheckerSequential to use GroupFluxPointers, added isConverged() to get if converged<commit_after>#ifndef BART_SRC_CONVERGENCE_GROUP_FLUX_CHECKER_SEQUENTIAL_H_
#define BART_SRC_CONVERGENCE_GROUP_FLUX_CHECKER_SEQUENTIAL_H_

#include <memory>

#include "flux_checker_i.h"
#include "group_flux_checker_i.h"


namespace bart {

namespace convergence {

/*! \brief Checks each flux group sequentially for convergence.
 * Will not re-check converged groups until final convergence is believed to
 * have been reached. */

class GroupFluxCheckerSequential : public GroupFluxCheckerI {
 public:
  GroupFluxCheckerSequential() = default;
  GroupFluxCheckerSequential(std::unique_ptr<FluxCheckerI> &tester);
  ~GroupFluxCheckerSequential() = default;
  
  void ProvideChecker(std::unique_ptr<FluxCheckerI> &tester) {
    tester_ = std::move(tester); };
  
  bool isConverged(data::GroupFluxPointers &current,
                   data::GroupFluxPointers &last);
  bool isConverged() { return converged_; };
  int GetFailedGroup() const { return failed_group_; };

 private:
  /*! Flux convergence tester that will be used to check sequentially */
  std::unique_ptr<FluxCheckerI> tester_ = nullptr;
  /*! Stores the ID of the first group that failed the convergence check */
  int failed_group_ = 0;
  /*! Stores value of last isConverged call */
  bool converged_ = false;
};

} // namespace convergence

} // namespace bart

#endif // BART_SRC_CONVERGENCE_GROUP_FLUX_CHECKER_SEQUENTIAL_H_
{'fraction_non_alphanumeric': 0.08529092880375859, 'fraction_numerical': 0.0003614022406938923, 'mean_word_length': 5.2342342342342345, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1683740', 'n_tokens_mistral': 890, 'n_tokens_neox': 871, 'n_words': 214}