-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add scalar template parameter in magnetic field #247
Conversation
class constant_magnetic_field { | ||
|
||
public: | ||
using vector3 = __plugin::vector3<scalar>; | ||
using point3 = __plugin::point3<scalar>; | ||
using vector3 = __plugin::vector3<scalar_t>; |
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.
This might be what @krasznaa you mentioned during the chat?
plugin-specific type should also be templated if I am correct
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.
Yes. In this class's case I would imagine making it templated on the vector3
and point3
types. Like:
template <typename vector3_t, typename point3_t, typename context_t = dindex>
class constant_magnetic_field {
Since the scalar type is only used for defining these two types in this class, we can even forego declaring those types as templates. So, we would specify a concrete type like:
using b_field_t = constant_magnetic_field<algebra::eigen::vector3<float>, algebra::eigen::point3<float> >;
I didn't try any of this out, but I think something like that could work.
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.
This looks good! Let's not try to bite off more than we can chew. We can come back to generalising the templates even further in future PRs.
class constant_magnetic_field { | ||
|
||
public: | ||
using vector3 = __plugin::vector3<scalar>; | ||
using point3 = __plugin::point3<scalar>; | ||
using vector3 = __plugin::vector3<scalar_t>; |
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.
Yes. In this class's case I would imagine making it templated on the vector3
and point3
types. Like:
template <typename vector3_t, typename point3_t, typename context_t = dindex>
class constant_magnetic_field {
Since the scalar type is only used for defining these two types in this class, we can even forego declaring those types as templates. So, we would specify a concrete type like:
using b_field_t = constant_magnetic_field<algebra::eigen::vector3<float>, algebra::eigen::point3<float> >;
I didn't try any of this out, but I think something like that could work.
You'll need to resolve the conflict before it could be merged though. 😉 |
Is this resolved with #291? |
Um no. I think magnetic field should still take scalar_type rather than transform_type. |
I think this can be closed now that #311 is merged, right? |
yes |
For #246