Aether icon indicating copy to clipboard operation
Aether copied to clipboard

[FEAT] reduce duplicate code

Open aburrell opened this issue 4 years ago • 1 comments

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.

aburrell avatar Sep 23 '21 16:09 aburrell

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

qalshidi avatar Sep 23 '21 16:09 qalshidi

I think that this is an outlier and this issue can be closed. Aether is pretty good at moving repeated code into functions.

aaronjridley avatar Nov 04 '24 12:11 aaronjridley