Optimize narrow phase contact detection for phyiscs simulation code
delete[] sum_rad_;
    sum_rad_ = new double[NbPairs];
    delete[] distance_vector_;
    distance_vector_ = new Vector3d[NbPairs];
    delete[] sq_dist_;
    sq_dist_ = new double[NbPairs];


Why all these bare array-pointers that you have to manage yourself?  You'd have much more maintainable code with std::vector or even just std::unique_ptr&lt;T[]&gt;.