1. Seperate physics from numerical stuff.


  1. vectors are convinient but slow. Ref
  2. Do not copy arrays if not necessary. The example would be for a function return. Most of the times, we can pass pointer of array to the function and update the array itself without copying anything and no return is needed at all.
  3. inline function.
  4. Use namespace instead of class if no data structure is stored in it.

Back to top

© 2016-2018, Lei Ma | Created with Sphinx and . | On GitHub | Physics Notebook Statistical Mechanics Notebook Neutrino Physics Notes Intelligence | Index | Page Source