-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflection move sampler #72
base: dev-minor
Are you sure you want to change the base?
Conversation
reflection relative to a given plane in labolatory reference frame. It is realized by rotation and reflects particle primary axis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally it looks ok, but it would do with the optimizations and cosmetic changes I've described in per-line comments.
|
||
void setStepSize(const std::string &, double) override { } | ||
|
||
void setupForShapeTraits(const ShapeTraits &shapeTraits) override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can save only the primary axis instead of storing the pointer to ShapeGeometry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
primary axis should be recalculated each time due to particle rotation, thus there is no advantage of storing it in terms of calculation time. On the other hand, storing a pinter takes less memory than storing a vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have to worry about the memory footprint of a single instance of the class. The problem is that ShapeGeometry::getPrimaryAxis
is a virtual function called repeatedly in a critical code path, which prevents many optimization that compiler can do.
reflection relative to a given plane in labolatory reference frame. It is realized by rotation and reflects particle primary axis
No description provided.