<commit_before>#include "XSbench_header.h"

// Calculates the microscopic cross section for a given nuclide & energy
void calculate_micro_xs( int p_energy, int nuc, int n_isotopes,
                           int n_gridpoints,
                           GridPoint * restrict energy_grid,
                           NuclideGridPoint ** restrict nuclide_grids,
                           int idx, double * restrict xs_vector ){
	// pull ptr from energy grid
	NuclideGridPoint * high = energy_grid[idx].xs_ptrs[nuc];
	NuclideGridPoint * low = high - 1;
	
	// assignments
	double e_h, e_l, xs_h, xs_l;
	e_h= high->energy;
	e_l = low->energy;

	// Total XS
	xs_h = high->total_xs;
	xs_l = low->total_xs;
	xs_vector[0] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( nuc, nuclide_grids, n_gridpoints );	
	// Elastic XS
	xs_h = high->elastic_xs;
	xs_l = low->elastic_xs;
	xs_vector[1] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+1) % n_isotopes, nuclide_grids, n_gridpoints );	
	// Absorbtion XS
	xs_h = high->absorbtion_xs;
	xs_l = low->absorbtion_xs;
	xs_vector[2] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+2) % n_isotopes, nuclide_grids, n_gridpoints );	
	// Fission XS
	xs_h = high->fission_xs;
	xs_l = low->fission_xs;
	xs_vector[3] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+3) % n_isotopes, nuclide_grids, n_gridpoints );	
	// Nu Fission XS
	xs_h = high->nu_fission_xs;
	xs_l = low->nu_fission_xs;
	xs_vector[4] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+4) % n_isotopes, nuclide_grids, n_gridpoints );	
}

// Calculates macroscopic cross section based on a given material & energy 
void calculate_macro_xs( double p_energy, int mat, int n_isotopes,
                           int n_gridpoints, int * restrict num_nucs,
                           double ** restrict concs,
						   GridPoint * restrict energy_grid,
                           NuclideGridPoint ** restrict nuclide_grids,
						   int ** restrict mats,
                           double * restrict macro_xs_vector ){
	double xs_vector[5];
	int p_nuc;<commit_msg>formatting<commit_after>#include "XSbench_header.h"

// Calculates the microscopic cross section for a given nuclide & energy
void calculate_micro_xs( int p_energy, int nuc, int n_isotopes,
                           int n_gridpoints,
                           GridPoint * restrict energy_grid,
                           NuclideGridPoint ** restrict nuclide_grids,
                           int idx, double * restrict xs_vector ){
	// pull ptr from energy grid
	NuclideGridPoint * high = energy_grid[idx].xs_ptrs[nuc];
	NuclideGridPoint * low = high - 1;
	
	// assignments
	double e_h, e_l, xs_h, xs_l;
	e_h= high->energy;
	e_l = low->energy;

	// Total XS
	xs_h = high->total_xs;
	xs_l = low->total_xs;
	xs_vector[0] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( nuc, nuclide_grids, n_gridpoints );	
	// Elastic XS
	xs_h = high->elastic_xs;
	xs_l = low->elastic_xs;
	xs_vector[1] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+1) % n_isotopes, nuclide_grids, n_gridpoints );	
	// Absorbtion XS
	xs_h = high->absorbtion_xs;
	xs_l = low->absorbtion_xs;
	xs_vector[2] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+2) % n_isotopes, nuclide_grids, n_gridpoints );	
	// Fission XS
	xs_h = high->fission_xs;
	xs_l = low->fission_xs;
	xs_vector[3] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+3) % n_isotopes, nuclide_grids, n_gridpoints );	
	// Nu Fission XS
	xs_h = high->nu_fission_xs;
	xs_l = low->nu_fission_xs;
	xs_vector[4] = xs_h - (e_h - p_energy) * (xs_h - xs_l) / (e_h - e_l);
	do_flops();
	do_loads( (nuc+4) % n_isotopes, nuclide_grids, n_gridpoints );	
}

// Calculates macroscopic cross section based on a given material & energy 
void calculate_macro_xs( double p_energy, int mat, int n_isotopes,
                         int n_gridpoints, int * restrict num_nucs,
                         double ** restrict concs,
                         GridPoint * restrict energy_grid,
                         NuclideGridPoint ** restrict nuclide_grids,
                         int ** restrict mats,
                         double * restrict macro_xs_vector ){
	double xs_vector[5];
	int p_nuc;
{'fraction_non_alphanumeric': 0.11911666294891814, 'fraction_numerical': 0.004907428061565916, 'mean_word_length': 2.5390686661404893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '51406', 'n_tokens_mistral': 1866, 'n_tokens_neox': 1778, 'n_words': 393}