1 #ifndef VTESTBED_CORE_MASS_HH 2 #define VTESTBED_CORE_MASS_HH 6 #include <vtestbed/base/blitz.hh> 7 #include <vtestbed/core/types.hh> 18 using vec3 = blitz::TinyVector<T,3>;
25 inline Mass(T mass,
const vec3& point): m(mass), x(point) {}
27 inline T mass()
const {
return m; }
28 inline const vec3& point()
const {
return x; }
39 using base_type::base_type;
44 for (
const auto& m : *
this) { s += m.mass(); }
50 template <
class T,
class ... Args>
52 flatten(
const Args& ... args) {
55 for (
const auto& a : arrays) { n += a.get().size(); }
58 for (
const auto& a : arrays) {
59 for (
const auto& m : a.get()) { result.emplace_back(m); }
68 #endif // vim:filetype=cpp Mass attached to specified point in space.