AetherModel / Aether

This is the home of the Aether model of the thermosphere and ionosphere
GNU General Public License v3.0
19 stars 29 forks source link

[FEAT] reduce duplicate code #67

Open aburrell opened 3 years ago

aburrell commented 3 years ago

Is your feature request related to a problem? Please describe. In the src/electrodynamics_unit_tests.cpp program, there is a section of code that is repeated frequently:

//results verification
  for (int i = 0; i < vals.n_rows; ++i) {
    for (int j = 0; j < vals.n_cols; ++j) {
      if (res(i, j) != answer(i, j))
        return false;
    }
  }

Describe the solution you'd like This code snippet should be included as an evaluation routine that is called by the test functions.

Describe alternatives you've considered Leave in duplicate code that makes the routines harder to maintain.

qalshidi commented 3 years ago

This kind of code can be easily done and should be done with Armadillo.