Skip to content

Commit

Permalink
start fixing issues with braces
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafedeli88 committed Sep 5, 2024
1 parent 7f3336b commit 757413c
Show file tree
Hide file tree
Showing 28 changed files with 175 additions and 101 deletions.
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_algo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ const float float_tolerance = 1.0e-6;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

// ------------- Tests --------------
Expand Down
11 changes: 6 additions & 5 deletions multi_physics/QED/QED_tests/test_picsar_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ BOOST_AUTO_TEST_CASE( picsar_array_range_based_loops )
{
auto arr = picsar_array<int,3>();
int i = 0;
for(auto& el : arr) el = ++i;
for(auto& el : arr){ el = ++i; };
int sum = 0;
for(const auto& el : arr) sum += el;
for(auto el : arr) sum += el;
for(const auto& el : arr){ sum += el; }
for(auto el : arr){ sum += el; }
BOOST_CHECK_EQUAL(sum, 12);
}

Expand All @@ -86,10 +86,11 @@ BOOST_AUTO_TEST_CASE( picsar_array_copy )
{
auto arr = picsar_array<int,3>();
int j = 0;
for(auto& el : arr) el = ++j;
for(auto& el : arr){ el = ++j; }
auto c_arr = arr;
for(int i = 0; i < arr.size(); ++i)
for(int i = 0; i < arr.size(); ++i){
BOOST_CHECK_EQUAL(arr[i], c_arr[i]);
}
}

// *******************************
12 changes: 8 additions & 4 deletions multi_physics/QED/QED_tests/test_picsar_breit_wheeler_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ using namespace picsar::multi_physics::math;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

template<typename RealType>
Expand Down
12 changes: 8 additions & 4 deletions multi_physics/QED/QED_tests/test_picsar_breit_wheeler_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ using namespace picsar::multi_physics::phys::breit_wheeler;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

// ------------- Helper functions --------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,23 @@ using namespace picsar::multi_physics::phys::breit_wheeler;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

const double chi_min = 0.1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,23 @@ using namespace picsar::multi_physics::phys::breit_wheeler;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

// ------------- Tests --------------
Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_chi_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ const float float_tolerance = 1.0e-6;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}


Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_gamma_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ const float float_tolerance = 1.0e-6;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}


Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_phys_constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ const float float_tolerance = 1.0e-7;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

// ------------- Tests --------------
Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_quadrature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ const float float_tolerance = 1.0e-3;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

// ------------- Tests --------------
Expand Down
12 changes: 8 additions & 4 deletions multi_physics/QED/QED_tests/test_picsar_quantum_sync_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ using namespace picsar::multi_physics::math;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

template<typename RealType>
Expand Down
12 changes: 8 additions & 4 deletions multi_physics/QED/QED_tests/test_picsar_quantum_sync_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ using namespace picsar::multi_physics::phys::quantum_sync;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

const double chi_min = 0.001;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,23 @@ using namespace picsar::multi_physics::phys::quantum_sync;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

const double chi_min = 0.01;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,23 @@ using namespace picsar::multi_physics::phys::quantum_sync;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

template <typename T>
T constexpr small()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_small;
else
}
else{
return double_small;
}
}

// ------------- Tests --------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ const float float_tolerance = 1.0e-4;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

// ------------- Tests --------------
Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_spec_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ const float float_tolerance = 1.0e-4;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

// ------------- Tests --------------
Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ const float float_tolerance = 1.0e-5;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

double linear_function(double x)
Expand Down
6 changes: 4 additions & 2 deletions multi_physics/QED/QED_tests/test_picsar_units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ const float float_tolerance = 1.0e-4;
template <typename T>
T constexpr tolerance()
{
if(std::is_same<T,float>::value)
if(std::is_same<T,float>::value){
return float_tolerance;
else
}
else{
return double_tolerance;
}
}

//Auxiliary functions for tests
Expand Down
Loading

0 comments on commit 757413c

Please sign in to comment.