Open user34523303 opened 2 years ago
Code review up to this point:
Classes and class functions need to be properly commented using the correct style for generating auto documentation with Sphinx. This uses Doxygen commenting style. In C++ this is usually beginning the function/class with * and ending with */. Use the @param, @return, and @brief identifiers to describe the function/class. Not all classes or functions need this as some are self-explanatory but it makes your code much more readable, especially in physics with regards to knowing what units a function takes in and outputs e.g. in main.cpp angularFreq() on line 222 has no units describing input or output so it's not clear what units the wavelength should be in. Same with your python functions in ctop.py. All the functions and classes need proper commenting. Doxygen style guide reference points to start: https://www.doxygen.nl/manual/docblocks.html#cppblock and https://caiorss.github.io/C-Cpp-Notes/Doxygen-documentation.html
Individual classes may need to be split up into different .cpp files in main.cpp gets any larger.
Line 307 use your constant PI here instead of 3.1415...
Nit: Small comment here, in your ggpp(), eepp(), etc. functions use the summation variables qp or gp instead of q or g as these make it easier to see the different summation variables and this stands for q' and g'
Writing a C++ extension could potentially increase the program speed. The extension module will be written in C++ with library: pybind11(https://github.com/pybind/pybind11), Eigen(https://eigen.tuxfamily.org/) The distribution will be handle by pip, a setup.py is needed. The aim of this module is to generate and solve A matrix in C++, Then return the D, V matrix to python. The function of this module should be minimal so it can fit in the python package well.