30 const std::vector<double>& batch_y,
31 const std::vector<double>& batch_z,
32 const std::vector<double>& batch_px,
33 const std::vector<double>& batch_py,
34 const std::vector<double>& batch_pz,
35 const std::vector<double>& batch_w) {
36 size_t n = batch_x.size();
39 x.insert(
x.end(), batch_x.begin(), batch_x.end());
40 y.insert(
y.end(), batch_y.begin(), batch_y.end());
41 z.insert(
z.end(), batch_z.begin(), batch_z.end());
43 px.insert(
px.end(), batch_px.begin(), batch_px.end());
44 py.insert(
py.end(), batch_py.begin(), batch_py.end());
45 pz.insert(
pz.end(), batch_pz.begin(), batch_pz.end());
47 weight.insert(
weight.end(), batch_w.begin(), batch_w.end());
std::vector< double > weight
size_t size() const
Возвращает текущее количество макрочастиц в контейнере.
void add_particles_batch(const std::vector< double > &batch_x, const std::vector< double > &batch_y, const std::vector< double > &batch_z, const std::vector< double > &batch_px, const std::vector< double > &batch_py, const std::vector< double > &batch_pz, const std::vector< double > &batch_w)
Массовое добавление пучка частиц (Batch insert).
void reserve(size_t capacity)
Резервирует память для заданного количества частиц.
void add_particle(double new_x, double new_y, double new_z, double new_px, double new_py, double new_pz, double new_w)
Добавляет одну новую макрочастицу в конец контейнера.