<commit_before>#include <vector>
#include <iostream>

#include "FeindNs.h"
#include "Parent.h"
#include "LibDefine.h"
#include "RamLib.h"

#include "DecayEndf6.h"
#include "Eaf41.h"
#include "Cinder.h"
#include "EndfIeaf.h"

using namespace std;
using namespace FEIND;

#include "Elements.h"
#include "GroupStructs.h"

RamLib FEIND::Library;

ErrCode FEIND::LoadLibrary(const LibDefine& lib)
{
  switch(lib.Format)
    {
    case DECAY_ENDF_6:
      {
	DecayEndf6 data_lib(lib);
	data_lib.LoadLibrary();
      }
      break;
    case EAF_4_1:
      {
	Eaf41 data_lib(lib);
	data_lib.LoadLibrary();
      }
      break;
    case CINDER:
      {
	Cinder data_lib(lib);
	data_lib.LoadLibrary();
      }
      break;
    case ENDF_IEAF:
      {
	EndfIeaf data_lib(lib);
	data_lib.LoadLibrary();
      }
      break;
    default:
      return FEC_UNKNOWN_FORMAT;
      break;
    }


  return FEC_NO_ERROR;
}

// ErrCode FEIND::AddEntry(const Parent& parent)
// {
//   return FEC_NO_ERROR;
// }

Kza FEIND::DecayModetoKza(int decayMode, int dIso, Kza parent, Kza& sec)
{
  Kza ret;
  sec = 0;

  switch(decayMode)
    {
    case BETA_DECAY:
      // A_D = A_P, Z_D = Z_P+1:
      ret = parent + 10000;
      break;
    case ELECTRON_CAPTURE:
      // A_D = A_P, Z_D = Z_P-1:
      ret = parent - 10000;
      break;
    case ALPHA_DECAY:<commit_msg>Fixed bug where LoadLibrary wasn't returning the right error codes<commit_after>#include <vector>
#include <iostream>

#include "FeindNs.h"
#include "Parent.h"
#include "LibDefine.h"
#include "RamLib.h"

#include "DecayEndf6.h"
#include "Eaf41.h"
#include "Cinder.h"
#include "EndfIeaf.h"

using namespace std;
using namespace FEIND;

#include "Elements.h"
#include "GroupStructs.h"

RamLib FEIND::Library;

ErrCode FEIND::LoadLibrary(const LibDefine& lib)
{
  int err;

  switch(lib.Format)
    {
    case DECAY_ENDF_6:
      {
	DecayEndf6 data_lib(lib);
	err = data_lib.LoadLibrary();
      }
      break;
    case EAF_4_1:
      {
	Eaf41 data_lib(lib);
	err = data_lib.LoadLibrary();
      }
      break;
    case CINDER:
      {
	Cinder data_lib(lib);
	err = data_lib.LoadLibrary();
      }
      break;
    case ENDF_IEAF:
      {
	EndfIeaf data_lib(lib);
	err = data_lib.LoadLibrary();
      }
      break;
    default:
      return FEC_UNKNOWN_FORMAT;
      break;
    }


  return err;
}

// ErrCode FEIND::AddEntry(const Parent& parent)
// {
//   return FEC_NO_ERROR;
// }

Kza FEIND::DecayModetoKza(int decayMode, int dIso, Kza parent, Kza& sec)
{
  Kza ret;
  sec = 0;

  switch(decayMode)
    {
    case BETA_DECAY:
      // A_D = A_P, Z_D = Z_P+1:
      ret = parent + 10000;
      break;
    case ELECTRON_CAPTURE:
      // A_D = A_P, Z_D = Z_P-1:
      ret = parent - 10000;
      break;
    case ALPHA_DECAY:
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.015895953757225433, 'mean_word_length': 2.6969292389853137, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3858914', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1123, 'n_words': 232}