v3: C++ optimization
profile applications for hot parts and try the following means for improving performance:
- std::array instead of std::vector, if size is known at compile time
- avoid dynamic allocation inside loops -> check assembler routines
- shared ptr are nice but come with a overhead due to dynamic allocation
- x += y instead of x = x + y
- group constants expressions in arithmetic terms with ()
- use iterators, if std::vector is passed as reference argument to functoin
- declare meber functions to be static, if they dont use member variables
- write for (size_t i=0, e=vector.size(); i!=e; ++i)
- use inline whenever possible
- function_values: check whether clear(), followed by resize() is bad for performance. if so, try std::fill()
- remove lmatrix_* classes and run profiler with poisson_gmg_test
- change call-by-value in geometric_tools file (e.g. is_aligned_rectangular_cuboid) and run profiler with poisson_gmg_test instead for resting a vector